-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
[feature] Compile script: Add a BUILD_ONLY switch to the build procedure #4421
Comments
Relates to armbian/build#4421 and to pull request armbian/build#4422
This config simplifies the U-Boot build only scenario. If this switch is set, then KERNEL_ONLY is implied to "yes". The U-Boot only build also ensures proper host prepare and any other validation, the default build procedure performs. closes armbian#4421
Stupid question: The benefit for all @armbian/build-scripts of us will be if we cancel this key KERNEL_ONLY and instead introduce a new key BUILD_ONLY="list packages" |
I think we all forget this build/lib/functions/cli/cli-entrypoint.sh Lines 107 to 111 in c29e51c
We can use the following command to build U-boot only.
|
No we can't! Do you have tricky settings? If you can do it.
Only ATF is being assembled |
@hzyitc I don't want to talk or discuss about what doesn't work in the build system. |
@The-going Yes. I think this is a good way to do this. Similar like
Just need a small modify to support multi actions. |
No. it's bad. |
So you mean a new script to build a package? |
I want to implement a command that you just run with parameters. The command must be packaged in a debian package and installed on the host system. |
@hzyitc Yes, I am aware about this, but this does not include all the other tasks and validations the script framework does - like prepare_host() etc. - so I wanted to behave the compile procedure exactly as it does, if you use e.g. |
I don't think this is a good idea since we're just a build system. The |
@mhoffrog Marcus, you can hack the entire build system in a very simple way:
This is taken from -> lib/functions/main/default-build.sh
I think you got the idea. |
@The-going many thanks for this hint! |
That's right. We often want something more than the build system provides. |
This is not enough. |
@The-going If I get your last comment right, you would like to get this If this is the case then this is a valid request. I'd then recommend to open a separate improvement request issue for that one. My current purpose was just to get a quick and simple solution for now and for myself and others to only compile U-Boot without considering what existing methods I would have to call or what portion of That there is still space for improving the structure of the one or other existing script is no doubt I guess. I leave it up to you guys @hzyitc , @The-going - whatever you prefer. I really appreciate your great build framework and all the work you spend to it! |
This is too far from what we support. At lease we don't support to build any libraries.
Yes, this is another problem. We didn't append the kernel version into the package version. But I remember thar someone is trying to solve it. |
Relates to armbian/build#4421 and to pull request armbian/build#4422
@hzyitc @mhoffrog Excuse me. I proceed from the following simple logic. I suggest entering a new key BUILD_ONLY="list name". build/lib/functions/cli/cli-entrypoint.sh Lines 107 to 111 in c29e51c
If the list is not empty, start a new function. To begin with, add only for the kernel and uboot name.
A little later I will add there the option of choosing packages to build in a chroot environment. The implementation in the pull request #4422 does not change anything fundamentally for me. With respect. |
@The-going Your proposed looks perfect to me! @hzyitc Please do not merge this pull request - I will replace it by a new one to revert my current commit(s) and will provide additional one(s) implementing the BUILD_ONLY switch as proposed. By that I am supposed to refactor |
I had in mind the following strategy: build/lib/functions/cli/cli-entrypoint.sh Lines 107 to 111 in c29e51c
If the list is not empty, start a new function. To begin with, add only for the kernel and uboot name.
There is no need to make changes with the If the user wants to build only one package, he writes: |
@mhoffrog Only when the new function is filled with correctly working code will we be able to afford to change the function of the do_default build system. |
If you don´t mind, I would like to use the same syntax and artifact names as for
sure - I will run appropriate tests and assign you for code review. Many thanks for all your comments so far! |
@igorpecovnik How do you think about this. BTW, GHA need to be changed. |
|
This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to armbian#4421
…tion This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to armbian#4421
Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to armbian#4421
- update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes armbian#4421
PR #4455 is created, implementation is done - with the following results:
Yes, the implementation does exactly this - implemented in function build_uboot() in functions/main/build-tasks.sh
Yes, realized this as well - KERNEL_ONLY option has been fully considered in the implementation and the build tasks performed are exactly the same as before, if BUILD_ONLY is not set. See Test 3 and 4 results on #4455. @hzyitc @The-going Please look to my particular full commit comments (there are more lines!) for the details. 4 relevant test scenarios have been performed (s. PR) and the build artifacts/steps for those were exactly as before. In summary:
From my point of view there is no reason why GHA is affected by the current implementation. Many thanks in advance for your review efforts! |
This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to armbian#4421
…tion This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to armbian#4421
Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to armbian#4421
- update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes armbian#4421
This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to #4421
…tion This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to #4421
Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to #4421
- update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes #4421
This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to #4421
…tion This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to #4421
Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to #4421
- update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes #4421
This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to #4421
…tion This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to #4421
Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to #4421
- update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes #4421
* Rename default-build.sh -> build-tasks.sh This commit is just a file rename without any further code change before this script will be refactored to improve build task structure for partial building. Refers to armbian#4421 * Prepare build-tasks.sh for moving each build step to a dedicated function This commit is an intermediate update to reflect NO functional code changes of the particular build steps before moving the unmodified code into the appropriate function by copy/paste. Only build_get_boot_sources() has slightly changed to an appropriate if / fi structure. Note: This .sh file is bash syntactically not correct. The purpose of this commit is to leverage code review. Refers to armbian#4421 * Update build-tasks.sh function do_default() for filtered function calls Function do_default(): - Add $1 function parameter for filtering build tasks and assign this to local variable $_buildOnly - move "pseudo inline"-functions to the beginning of the script - replace the "inline functions" by filtered function calls - add BUILD_ONLY variable to the build epilog print Refers to armbian#4421 * Complete refactoring of build-tasks.sh for BUILD_ONLY support - update indentation of functions build_get_boot_sources() and build_get_kernel_sources() to meet code style - rename original function do_default() -> build_main() - create new do_default() for backward compatibility and comment this one as deprecated - call build_main "" from this deprecated do_default() - cli-entrypoint.sh: - update call of do_default by build_main "${BUILD_ONLY}" closes armbian#4421 * Print final runtime as min:seconds As with filtered build runtimes may get below a minute, we would like to get the runtime printed with seconds. * Delete duplicate messages * Fix the confusion of the choice of building the kernel * Fix a typo in comment on do_default() * Backward compatibility of KERNEL_ONLY and new BUILD_ONLY keys. * interactive_config: replace KERNEL_ONLY on BUILD_ONLY * Fix: Correct verification when an image is created * Abort with error if BUILD_ONLY contains invalid build task names - add function build_validate_buildOnly() - call this function from build_main - fix position of KERNEL_ONLY / BUILD_ONLY contradiction message (did log empty _buildOnly content all time) - improve local variable names * Improve final error message to list valid BUILD_ONLY task names * Improve error message logging - collect multiple invalid BUILD_ONLY task names in a single error message - log final message for valid BUILD_ONLY task names on ext level - simple exit with exit code 1 in case of error * The RELEASE variable cannot be empty. Additional conditions for checking RELEASE are unacceptable. * Fix build_main() to use BUILD_ONLY inside instead of local var set from parameter $1 - build-tasks.sh: - build_main(): - don't take parameter $1 - replace usage of $_buildOnly by $BUILD_ONLY - added info messages on KERNEL_ONLY cases in case BUILD_ONLY was propagated - build_validate_buildOnly(): - remove parameter $2 - assign _buildOnly from global BUILD_ONLY accordingly - cli-entrypoint.sh: - call build_main without parameter * Choosing interactive_config if the goal is bootstrap * fix: order of selection backward_compatibility_build_only * Update function comments to match current state - removed obsolete parameter of build_main call do_default() - replaced :space: by :comma: in _kernel_buildOnly to leverage copy / paste for final repeatable command line printed after build * Improve logic coding to filter build tasks - build-tasks.sh: - added functions: - build_task_is_enabled() - build_task_one_of_is_enabled() - build_task_each_of_is_enabled() - updated existing build task filter logic to use function build_task_is_enabled - config-prepare.sh, prepare-host.sh: - replaced existing build task filter logic to use function build_task_is_enabled * Remove unused functions - remove function build_task_one_of_is_enabled() and build_task_each_of_is_enabled() according to code review Co-authored-by: The-going <48602507+The-going@users.noreply.github.com>
Feature
Add a BUILD_ONLY compile switch as a list of partial build artifacts to perform just a partial builds like `u-boot,kernel´
The motivation for this enhancement is to simplify and shorten U-Boot or other artifacts only builds.
Solution
Pull request #4455 has been created.
The text was updated successfully, but these errors were encountered: