-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: extended native-image build options #107
Draft
sgammon
wants to merge
38
commits into
main
Choose a base branch
from
feat/native-image-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of relying on the default shell env, get the environment variables declared by the C++ toolchain. On macOS, additionally use `apple_support` to pass in `DEVELOPER_DIR`. Since GraalVM sanitizes the environment, all variables are translated into `-E` flags. Signed-off-by: Sam Gammon <sam@elide.ventures>
- fix: move `lambda` to nested function declaration Signed-off-by: Sam Gammon <sam@elide.ventures>
- fix: unwind combined implementation of classic/modern rules - fix: classic rules should preserve older functionality - fix: modern rules should use modern toolchain env - fix: wrapped/injected `env` while still supporting bazel4 - chore: re-factor commons between old/new rules Signed-off-by: Sam Gammon <sam@elide.ventures>
- fix: use legacy rules from legacy gvm - chore: drop `MODULE-resolved.bzl` - chore: update bzlmod lock - chore: update lib/docs deps and rebuild docs - chore: remove redundant calls in sample projects Applied on top of #72 Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
When provided, the static zlib library will be used when Graal statically links in zlib. Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Fabian Meumertzheim <fabian@meumertzhe.im> Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Fabian Meumertzheim <fabian@meumertzhe.im> Signed-off-by: Sam Gammon <sam@elide.ventures>
- fix: add `gvm` toolchain to toolchain config repo - fix: add aliases from `graalvm` → toolchain targets - fix: adjust instructions for registering toolchains - fix: adjust workspace toolchain registration logic Breaking change: When registering toolchains in a Bzlmod installation of these rules, the target `@graalvm//:all` must be changed to two toolchain registrations, based on the desired functionality: Register the Java toolchain: register_toolchains("@graalvm//:jvm") Register the GVM toolchain: register_toolchains("@graalvm//:sdk") Fixes and closes #66. Relates-To: #66 Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
- test: add `java-toolchain` test, which exercises graalvm as the bazel tool/runtime java toolchain. - test: add `components-ce` test, which downloads GVM Community components with dependencies. - test: add `components-gvm` test, which downloads Oracle GVM components with `gu`. - test: add `disabled_tests` with tests for earlier versions of bazel (coming soon), including `bazel1`, `bazel2`, and `bazel3` - test: move most tests to GVM Community (except where noted) Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
- feat: detect and honor `compilation_mode` flag - feat: build with debug settings if `compilation_mode=dbg` - feat: ability to build a shared library - feat: build with `tool:coverage` if coverage is enabled and a test-only target is being built - docs: add doc which explains shared library feature - docs: add doc for built settings integration (more to come) Relates-To: #78 Relates-To: #85 Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
- test: add code to `components-ce` test to ensure `js` component is installed and usable Co-authored-by: Mantas Indrašius <mantasi@wix.com> Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
sgammon
added
feature
Mainline feature work
native-image
Features and issues relating to the Native Image tool
🚧 WIP
Work-in-progress, do not merge
labels
Sep 4, 2023
sgammon
force-pushed
the
feat/native-image-options
branch
from
September 4, 2023 02:44
5bd8af2
to
f66391a
Compare
- feat: add experimental build setting which controls the `march` parameter - feat: explicit settings with `native_image_settings`, flag overrides with `native_image_info` - fix: preserve legacy rules `march` flag (missing by default) Not yet implemented: Needs integration with Bazel's platforms feature. Signed-off-by: Sam Gammon <sam@elide.ventures>
sgammon
force-pushed
the
feat/native-image-options
branch
from
September 4, 2023 02:47
f66391a
to
f630c59
Compare
Kudos, SonarCloud Quality Gate passed! |
sgammon
force-pushed
the
release/0.10.x
branch
from
September 8, 2023 04:40
407c2e2
to
0b12c7c
Compare
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature
Mainline feature work
native-image
Features and issues relating to the Native Image tool
🚧 WIP
Work-in-progress, do not merge
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds more integration points with Bazel's build settings. Initial Platforms stuff might happen in this PR too. Targeting #80 for release if possible (we'll see).
Not yet implemented:
Needs integration with Bazel's Platforms feature, and transition implementations.
Related issues:
-march
#89Usage
There is a new
native_image_settings
target, which can be used to specify an explicit bundle of Native Image compilation settings:Overriding options via Bazel Configurations
If you do nothing at all, or map the
settings
property this way (or provide your own equivalentnative_image_info
advice target), then certain flags will override yournative_image_settings
. With the above configuration, settings are effectively resolved from the following places, in order:This allows you to set a default
march
, for instance:Which you can override easily on the command line when desired:
How you know it's working
In the
native-image
build output, thetarget
machine will be set accordingly:Opting out of rules-controlled flags
To remove (some) of the Rules-controlled flags and instead withhold them or provide them via
extra_args
, you can passNone
to thesettings
attribute, which prevents override:In this case, these flags are withheld from automatic injection, although you may still need to provide some of them to complete a
native-image
build. Effectively, most flags take on GraalVM's defaults.Changelog
march
parameter