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

compile: pass through extra arguments to native-image #29

Merged

Conversation

charles-dyfis-net
Copy link
Contributor

...and other cleanups.

The argument-passthrough change (allowing things like -H:-CheckToolchain to be directly added to the command line passed to compile) is the primary motivator here, but doing some other cleanups while at it:

  • Use "$@" to add all arguments to target command line
  • Use exec so the shell is replaced with native-image in memory, allowing direct signal delivery
  • Use ${var?error-if-unset} syntax instead of multi-line check
  • Use $(<file) instead of $(cat file) to perform the read operation internal to bash instead of spawning a separate cat executable

All of these changes should be compatible across all versions of bash in common use, inclusive of the (pre-GPLv3-relicense) bash 3.2 binaries shipped by Apple.

…nups

The argument-passthrough change is the primary motivator here, but doing some other cleanups while at it:

- Use `"$@"` to add all arguments to target command line
- Use `exec` so the shell is replaced with native-image in memory, allowing direct signal delivery
- Use `${var?error-if-unset}` syntax instead of multi-line check
- Use `$(<file)` instead of `$(cat file)` to perform the read operation internal to bash instead of spawning a separate `cat` executable
Copy link
Owner

@dainiusjocas dainiusjocas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍 Thank you for the contribution!

@dainiusjocas dainiusjocas merged commit ab1f994 into dainiusjocas:main Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants