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

Sandbox integration with GraalVM #244

Open
Tracked by #221
sgammon opened this issue Jan 13, 2024 · 0 comments · May be fixed by #221
Open
Tracked by #221

Sandbox integration with GraalVM #244

sgammon opened this issue Jan 13, 2024 · 0 comments · May be fixed by #221
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@sgammon
Copy link
Owner

sgammon commented Jan 13, 2024

When a native-image invocation occurs, there are actually two sandbox/temp roots in play: there is Bazel's sandbox and execroot, and the temp path created by native-image, where it places:

  • Generated C code for the Native Image C API
  • Built objects / libraries

Native Image's sandbox typically occurs under some directory in the pattern /tmp/SVM-.....

After the compile, native-image copies these back to the output root, where they are surfaced to the Bazel developer. That's how it works now.

However, in more complex circumstances, where a Native Image C API target is using external headers or other resources, the build's posture on disk can be quite confusing: when including a header or some other file, where is it coming from? The Bazel sandbox, or the Native Image sandbox? How does one get files from one sandbox to the other? And so on.

It would be awesome if these rules could integrate Bazel's sandbox with a managed temp path for native-image. This would provide the following benefits:

  1. Clear story about accessing resources in Native Image features and directive classes
  2. Sandbox hacks can be dropped from the rule internals
  3. The full native-image compile state could be inspected in Bazel's sandbox, with files preserved via --sandbox_debug
@sgammon sgammon added bug Something isn't working enhancement New feature or request labels Jan 13, 2024
@sgammon sgammon added this to the 1.0.0 milestone Jan 13, 2024
@sgammon sgammon self-assigned this Jan 13, 2024
@sgammon sgammon linked a pull request Jan 13, 2024 that will close this issue
13 tasks
sgammon added a commit that referenced this issue Jan 14, 2024
- feat: full implementation this time of make variable and location
  expansion

- feat: managed build temp directory for `native-image`

Relates-To: #244
Relates-To: #245
Signed-off-by: Sam Gammon <sam@elide.ventures>
@sgammon sgammon linked a pull request Jan 14, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant