-
Notifications
You must be signed in to change notification settings - Fork 203
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
Move installation of include headers into a separate script (NFC) #552
Move installation of include headers into a separate script (NFC) #552
Conversation
This change is not meant to change any functionality, only move some Bash-specific logic out of the `Makefile` into its own script: `install-include-headers.sh`. This reduces the perceived complexity of the `Makefile` but the complexity is still there, tucked away in this script. This script also has the advantage that it can be run separately if needed. This commit comes after a few different attempts at building up `Makefile` lists of headers to copy over along with the various locations they must be copied from. It is certainly possible to do this, but due to how we need to remove some headers from the list, it ends up being easier to just `cp` and then `rm`, which this script retains.
I kind of like the llvm (and now emscripten) convention of adding (edit: meaning Non Functional Change) |
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.
Overall this looks good; just one minor comment:
scripts/install-include-headers.sh
Outdated
# | ||
# Usage: SYSROOT_INC=... TARGET_TRIPLE=... ./install-include-headers.sh | ||
|
||
set -e |
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 recommend adding set -euo pipefail
to all bash scripts. In particular here, -u
will catch the case where someone forgets to set SYSROOT_INC
or TARGET_TRIPLE
.
Also removes the ability to set `DRY_RUN` due to `set -u`; instead, this allows redefining the commands that remove and copy the headers.
This change is not meant to change any functionality, only move some Bash-specific logic out of the
Makefile
into its own script:install-include-headers.sh
. This reduces the perceived complexity of theMakefile
but the complexity is still there, tucked away in this script. This script also has the advantage that it can be run separately if needed.This commit comes after a few different attempts at building up
Makefile
lists of headers to copy over along with the various locations they must be copied from. It is certainly possible to do this, but due to how we need to remove some headers from the list, it ends up being easier to justcp
and thenrm
, which this script retains.