-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
buildsystem: rework build script #2151
Conversation
scripts/build
Outdated
elif [ -f $PKG_BUILD/Makefile ]; then | ||
PKG_TOOLCHAIN="make" | ||
else | ||
echo "Not possible to detect toolchain automactcly. Add PKG_TOOLCHAIN= in to package.mk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo + wording:
echo "Not possible to detect toolchain automatically. Add PKG_TOOLCHAIN= to package.mk"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... c++ is much more easier then english :)
scripts/build
Outdated
$PKG_TOOLCHAIN != "manual" ]; then | ||
printf "$(print_color bold-red "ERROR: ")unknown toolchain $PKG_TOOLCHAIN" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use...
if ! listcontains "meson cmake cmake-make configure make autotools manual" "$PKG_TOOLCHAIN"; then
printf "$(print_color CLR_ERROR "ERROR: ")unknown toolchain $PKG_TOOLCHAIN"
exit 1
fi
Also changed to use predefined CLR_ERROR for errors.
scripts/build
Outdated
printf "$(print_color bold-red "ERROR: ")unknown toolchain $PKG_TOOLCHAIN" | ||
exit 1 | ||
fi | ||
printf "%${BUILD_INDENT}c $(print_color CLR_TOOLCHAIN "TOOLCHAIN ")$PKG_TOOLCHAIN${_auto_toolchain}\n" ' '>&$SILENT_OUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - stylistically this is inconsistent with existing usage, eg.:
printf "%${BUILD_INDENT}c $(print_color CLR_UNPACK "UNPACK") $1\n" ' '>&$SILENT_OUT
The spaces follow the call to print_color
, so your line should be:
- printf "%${BUILD_INDENT}c $(print_color CLR_TOOLCHAIN "TOOLCHAIN ")$PKG_TOOLCHAIN${_auto_toolchain}\n" ' '>&$SILENT_OUT
+ printf "%${BUILD_INDENT}c $(print_color CLR_TOOLCHAIN "TOOLCHAIN") $PKG_TOOLCHAIN${_auto_toolchain}\n" ' '>&$SILENT_OUT
Looks like a generally positive change... to avoid constant rebasing this needs to go in sooner than later. I'll run some local builds. |
@MilhouseVH will fix you comments, add finish my open todos, this evening (CEST). |
"target") _pkg_depends="$PKG_DEPENDS_TARGET";; | ||
"host") _pkg_depends="$PKG_DEPENDS_HOST";; | ||
"init") _pkg_depends="$PKG_DEPENDS_INIT";; | ||
"bootstrap") _pkg_depends="$PKG_DEPENDS_BOOTSTRAP";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a catch-all here:
*) _pkg_depends=;;
or initialise _pkg_depends=
(or unset _pkg_depends
) before the case
. It shouldn't be set to anything, of course, but who knows what variables will be set when sourcing other files - the package.mk
is sourced shortly before this section and it can set anything it likes.
I'd even be inclined to wrap the for
loop in a test, just for clarity:
if [ -n "$_pkg_depends" ]; then
<for loop>
fi
bash will drop straight through the loop when _pkg_depends
is blank or unset, but it avoids any confusion...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the the extra if. I do not like extra code.
The unset is added, will commit later.
Adding ?w=1 makes some of these commits easier to review. :) |
printf "%${BUILD_INDENT}c $(print_color CLR_BUILD "BUILD") $PACKAGE_NAME $(print_color CLR_TARGET "($TARGET)")\n" ' '>&$SILENT_OUT | ||
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE)) | ||
|
||
# virtual packages dont must be build, they only contains dependencies, so dont go further here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (old) comment is contradictory, maybe we can improve it?
# virtual packages don't build - they only contain dependencies, so don't go further here
?
How do you feel about replacing |
sha256 takes more time. The advantage of sha256 over md5 is the security (but not relevant here). |
Fair enough. |
clean builds of many archs run over night. I think, i had fixed every package, now. |
Just to add some background on the The following test cases now work:
The old
This update fixes all three issues. |
d42527d
to
6cc498c
Compare
rebase and fix after merge of #2100 |
6cc498c
to
b660b6e
Compare
rebase and fix addon docker after #1670 |
Generally I am ok with this. It doesn't really change anything but adds a bit more readability. |
good to hear :) |
b660b6e
to
6fbabf9
Compare
a generic with addons is done. build on the other project are running, actual. |
other builds are done. looks good. |
@MilhouseVH can we hold all other PR's and test this please. If it builds just shove it in I'd also like this to be squashed |
OK I'll build it clean overnight and merge if OK (and squashed). |
6fbabf9
to
7f1800f
Compare
More efficient, slightly more functional. Can be a space delimited list of architectures. Architectures to be excluded can be specified with !ARCH. Allows "any !arm" to be interpreted as "any arch, but not arm". Blank/undefined is equivalent to "any".
7f1800f
to
e0b833c
Compare
Done:
Open:
Test: 28. 10
comments?