-
Notifications
You must be signed in to change notification settings - Fork 676
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
Runs make clean
after make-install
to reduce used disk
#855
Conversation
Make install leaves many .o and other files Fixes problems with disk space on github actions runner
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 LGTM, though we should quickly poll the Chipyard group if this is fine with them. Hopefully, there isn't a corner use case that wants the intermediate files.
Lets make this a flag that CI sets. |
If the toolchain fails, then the intermediate files will not be deleted. The |
For reclaiming space, it's better to deinit the toolchain submodules at the very end after the build succeeds. |
I'd prefer having a flag to control this behavior. Cleaning after each step makes it harder to debug cases where an earlier step might succeed but was built with incorrect options, so the failure only manifests after attempting a later step that depends on the first. Retaining the intermediate files is also useful for incremental builds. |
Sounds good, flag it is. This PR should probably also bump the CircleCI |
…argument to `make_build` function.
@abejgonzalez I've implemented a flag to keep the existing behavior the default. I'm not particularly enthused by the implementation. Feedback appreciated |
scripts/build-toolchains.sh
Outdated
-a | --arch ) | ||
shift | ||
ARCH=$1 ;; | ||
riscv-tools | esp-tools) |
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 is mis-aligned, the riscv-tools
and ec2fast
sections should be indented the same as the -a
.
I'm fine with this implementation (though I'm not picky at all about it). Can you bump the
|
scripts/build-toolchains.sh
Outdated
@@ -132,7 +136,7 @@ else | |||
esac | |||
|
|||
module_prepare riscv-gnu-toolchain qemu | |||
module_build riscv-gnu-toolchain --prefix="${RISCV}" --with-cmodel=medany ${ARCH:+--with-arch=${ARCH}} | |||
module_build riscv-gnu-toolchain $CLEANAFTERINSTALL --prefix="${RISCV}" --with-cmodel=medany ${ARCH:+--with-arch=${ARCH}} |
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 only cleans the newlib toolchain build. To also clean after the Linux toolchain, the module_make
function needs to be changed as well.
scripts/build-util.sh
Outdated
@@ -81,6 +86,9 @@ module_build() ( # <submodule> [configure-arg..] | |||
"${MAKE}" | |||
echo "==> Installing ${name}" | |||
"${MAKE}" install | |||
if [ "$clean_after_install" = "true" ] ; then |
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.
Based on the original patch, I assumed the intent was to clean up after all the submodules rather than just riscv-gnu-toolchain:
if [ "$clean_after_install" = "true" ] ; then | |
if [ -n "$CLEANAFTERINSTALL" ] ; then |
which makes parsing --clean-after-install
unnecessary.
If a particular submodule needs to be excluded, the variable could be overridden at the call site:
CLEANAFTERINSTALL= module_build ...
…argument to `make_build` function. Ups tools-cache-version to v7
… variable when using scripts that call `module_make` or `module_build`. Those two bash functions will check CLEANAFTERINSTALL and if it is non-empty, they will call `make clean` after other `make` calls.
@a0u I changed this as you suggested, and I think it serves my purposes and preserves default behavior. |
@chick Sorry, I should have been more specific. I meant that |
--clean-after-install to turn enable `make clean` in `module_make` and `module_run`
@a0u No problem, I think it's a lot clearer with it explicitly in the flags for build-toolchains. |
Make install leaves many .o and other files laying around
Fixes problems with disk space on Github Actions runner
Type of change: other enhancement
Impact: other
Reduces used disk space after toolchain build
Release Notes
Intermediate .o and other files are removed after building toolchain components.
Reduces disk requirements