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

js_library missing rootpaths runfiles in genrule #2983

Closed
Zemnmez opened this issue Sep 27, 2021 · 3 comments
Closed

js_library missing rootpaths runfiles in genrule #2983

Zemnmez opened this issue Sep 27, 2021 · 3 comments
Labels
Can Close? We will close this in 30 days if there is no further activity

Comments

@Zemnmez
Copy link

Zemnmez commented Sep 27, 2021

🐞 bug report

Affected Rule

The issue is caused by the rule:

js_library

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Don't think so.

Description

A clear and concise description of the problem...

$(rootpaths [js_library target]) is generating paths that do not exist at runtime in the genrule, which is causing the rule to fail.

🔬 Minimal Reproduction

I am not sure about a minimal repro, but you can use https://github.com/Zemnmez/quickcult/tree/js_library_runfiles_issue

And then:

yarn bazel build //cultist/multiplayer --verbose_failures

🔥 Exception or Error

The filenames shown below are generated by the "makefile" rule $(rootpaths) -- but as shown fail to exist at runtime.

Partial:

ERROR: /home/ubuntu/devel/quickcult/cultist/multiplayer/BUILD:26:8: Executing genrule //cultist/multiplayer:multiplayer failed: (Exit 2): bash failed: error executing command 
  (cd /home/ubuntu/.cache/bazel/_bazel_ubuntu/eef25c75b9bdd1803062da64b98415bb/sandbox/linux-sandbox/176/execroot/quickcult && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    STEAM_PASSWORD=VubWxUEcK \
    STEAM_USERNAME=quickcultist \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; 
        NEXT_ROOT=./cultist/multiplayer;
        echo "pages";
        ls cultist/action.js cultist/aspects.js cultist/element.js cultist/example/savestate.js cultist/example/savestate.txt.js cultist/index.js cultist/multiplayer/pages/_app.js cultist/multiplayer/pages/demo.js cultist/multiplayer/pages/index.js cultist/react/board.jsx cultist/react/index.jsx cultist/recipe.js cultist/save.js cultist/slots.js cultist/state/deserialize.js cultist/state/index.js cultist/state/op.js cultist/state/serialize.js cultist/state/state.js cultist/types.js cultist/verb.js typescript/guard.js typescript/iter/dict.js typescript/iter/index.js typescript/tree.js typescript/util.js;
        echo "end pages";
        bazel-out/k8-opt-exec-2B5CBBC6/bin/cultist/multiplayer/next.sh build $NEXT_ROOT;
        bazel-out/k8-opt-exec-2B5CBBC6/bin/cultist/multiplayer/next.sh export $NEXT_ROOT;
        tar -czvf bazel-out/k8-fastbuild/bin/cultist/multiplayer/build.tar.gz $NEXT_ROOT/out
    ')
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
ls: cannot access 'cultist/action.js': No such file or directory
ls: cannot access 'cultist/aspects.js': No such file or directory
ls: cannot access 'cultist/element.js': No such file or directory
ls: cannot access 'cultist/example/savestate.js': No such file or directory
ls: cannot access 'cultist/example/savestate.txt.js': No such file or directory
ls: cannot access 'cultist/index.js': No such file or directory
ls: cannot access 'cultist/multiplayer/pages/_app.js': No such file or directory
ls: cannot access 'cultist/multiplayer/pages/demo.js': No such file or directory
ls: cannot access 'cultist/multiplayer/pages/index.js': No such file or directory
ls: cannot access 'cultist/react/board.jsx': No such file or directory
ls: cannot access 'cultist/react/index.jsx': No such file or directory
ls: cannot access 'cultist/recipe.js': No such file or directory
ls: cannot access 'cultist/save.js': No such file or directory
ls: cannot access 'cultist/slots.js': No such file or directory
ls: cannot access 'cultist/state/deserialize.js': No such file or directory
ls: cannot access 'cultist/state/index.js': No such file or directory
ls: cannot access 'cultist/state/op.js': No such file or directory
ls: cannot access 'cultist/state/serialize.js': No such file or directory
ls: cannot access 'cultist/state/state.js': No such file or directory
ls: cannot access 'cultist/types.js': No such file or directory
ls: cannot access 'cultist/verb.js': No such file or directory
ls: cannot access 'typescript/guard.js': No such file or directory
ls: cannot access 'typescript/iter/dict.js': No such file or directory
ls: cannot access 'typescript/iter/index.js': No such file or directory
ls: cannot access 'typescript/tree.js': No such file or directory
ls: cannot access 'typescript/util.js': No such file or directory
pages

Full:

https://gist.github.com/Zemnmez/bb6a78601e1767fbb4547d5575c66ea4

🌍 Your Environment

Operating System:

  
wsl
  

Output of bazel version:

  
Bazelisk version: v1.10.1
Build label: 5.0.0-pre.20210913.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Sep 17 16:54:24 2021 (1631897664)
Build timestamp: 1631897664
Build timestamp as int: 1631897664
Done in 0.13s.
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
4.2.0
  

Anything else relevant?

@thesayyn
Copy link
Collaborator

thesayyn commented Oct 3, 2021

I believe that this is somehow caused by the same problem that we see at #2600

Also, could you keep the reproduction as small as possible?

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

@github-actions github-actions bot added the Can Close? We will close this in 30 days if there is no further activity label Apr 5, 2022
@github-actions
Copy link

github-actions bot commented May 5, 2022

This issue was automatically closed because it went 30 days without any activity since it was labeled "Can Close?"

@github-actions github-actions bot closed this as completed May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? We will close this in 30 days if there is no further activity
Projects
None yet
Development

No branches or pull requests

2 participants