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

[Bug]: js_image_layer does not include repo mapping file in app layer #1973

Open
jfirebaugh opened this issue Oct 11, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@jfirebaugh
Copy link
Contributor

jfirebaugh commented Oct 11, 2024

What happened?

js_image_layer omits the repo mapping file, so @bazel/runfiles resolution fails inside the resulting container when bzlmod is enabled.

Version

Development (host) and target OS/architectures:

Output of bazel --version: 7.3.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: 1.37.0

Language(s) and/or frameworks involved:

How to reproduce

Via `js_image_layer`, build a container image containing a `js_binary` target with a runfiles dependency, and with bzlmod enabled. The binary can do nothing but:


const runfiles = require('@bazel/runfiles')
runfiles.resolve('<repo name>/<runfile>')

Run the container. It will fail with "Error: could not resolve module /".

If you inspect the container contents (e.g. with dive), you can see that the app layer has no .repo_mapping file.



### Any other information?

_No response_
@jfirebaugh jfirebaugh added the bug Something isn't working label Oct 11, 2024
@thesayyn
Copy link
Member

This needs to be fixed in js_image_layer. However I'd like to take this opportunity and drop js_image_layers custom nodejs program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants