Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize the new "all" ARCHITECTURES keyword in most recipes. #6189

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

waddlesplash
Copy link
Member

x86_64 is used as a baseline: the "x86_64" entry, whatever status it has,
is transformed into "all", and then the other entries in ARCHITECTURES
either dropped or rearranged appropriately.

x86_64 is used as a baseline: the "x86_64" entry, whatever status it has,
is transformed into "all", and then the other entries in ARCHITECTURES
either dropped or rearranged appropriately.
@waddlesplash
Copy link
Member Author

Script used to edit recipes:

#!/bin/bash
#
# Copyright 2021, Haiku, Inc. All rights reserved.
# Distributed under the terms of the MIT license.
#

# some stub functions so we don't get errors/warnings
getPackagePrefix()
{
	:
}
defineDebugInfoPackage()
{
	:
}

remove_old_arches()
(
	set -f
	IFS=' '

	prefix=$1
	shift

	arches=""
	for arg in "$@"; do
		if [[ ! -z "$prefix" ]]; then
			if [[ $(echo $arg | cut -c1) = "$prefix" ]]; then
				arg_test=$(echo $arg | cut -c 2-)
			else
				arches="$arches $arg"
				continue
			fi
		else
			arg_test="$arg"
		fi
		if [[ "$arg_test" =~ ^(x86_64|arm|arm64|riscv64|ppc|x86_gcc2|m68k|x86|sparc)$ ]]; then
			continue
		fi
		arches="$arches $arg"
	done

	echo "$arches"
)


FILES=$(git ls-files | fgrep .recipe)
MODIFIED=0
for file in $FILES; do
	portVersion=1
	source $file
	prefix=$(echo $ARCHITECTURES | grep -o -P '.{0,1}x86_64')
	if [ $? -eq 0 ]; then
		#echo "editing $file"

		prefix=$(echo "$prefix" | cut -c1)
		if [[ $prefix != "?" ]] && [[ $prefix != '!' ]]; then
			prefix=
		fi
		ARCHITECTURES=$(remove_old_arches "$prefix" $ARCHITECTURES)
		ARCHITECTURES="${prefix}all $ARCHITECTURES"
		ARCHITECTURES=$(echo $ARCHITECTURES)
		echo $ARCHITECTURES
		sed -i "/^ARCHITECTURES=/c\ARCHITECTURES=\"$ARCHITECTURES\"" $file
		# trim trailing space while we're at it
		sed -i 's/[ \t]*$//' $file
		MODIFIED=$((MODIFIED+1))
	fi
done
echo ""
echo "done; $MODIFIED recipes edited."

@Begasus
Copy link
Contributor

Begasus commented Sep 15, 2021

Haven't had time to look into this, I was just wondering, if "all" is used will the recipes also build x86_gcc2 (currently disabled or marked broken) on buildmaster?

@waddlesplash
Copy link
Member Author

If all is used first, later additions will override it. So all !x86_gcc2 indicates that the recipe should be enabled everywhere, except for x86_gcc2.

@Begasus
Copy link
Contributor

Begasus commented Sep 15, 2021

So, ARCHITECTURES="all !x86_xgcc2" would disable the build on buildmaster (also whith ?x86_gcc2)?

@waddlesplash
Copy link
Member Author

Yes.

@Begasus
Copy link
Contributor

Begasus commented Sep 15, 2021

OK, will run some tests on 32bit later, will reports later :)

@waddlesplash waddlesplash merged commit 4f180bd into master Sep 15, 2021
@waddlesplash waddlesplash deleted the use_all branch September 15, 2021 19:40
@Begasus
Copy link
Contributor

Begasus commented Sep 16, 2021

On a sidenote, is buildmaster setup to build riscv/arm packages?

@waddlesplash
Copy link
Member Author

No, not yet.

@humdingerb
Copy link
Member

The ARCHITECTURE description of the wiki at https://github.com/haikuports/haikuports/wiki/HaikuPorter-BuildRecipes could be updated as well. Maybe also the "generic_*" example recipies of haikuporter.
Best by someone who exactly knows the in and outs... :)

@waddlesplash
Copy link
Member Author

I already added "all" there. Maybe not so easy to read, though...

@humdingerb
Copy link
Member

Yeah, maybe quote that example of "all !x86_gcc2" that supports all but gcc2 arches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants