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

fix(builtin): look in the execroot for nodejs_binary source entry_points #1816

Merged
merged 1 commit into from
Apr 11, 2020

Commits on Apr 11, 2020

  1. fix(builtin): look in the execroot for nodejs_binary source entry_points

    In a6e29c2 we added support for generated entry_point by adding a secondary lookup.
    In 863c7de we reversed the order of the lookups to make rollup work in a certain use case.
    Neither of these was principled, because we know ahead of time whether the entry_point is generated. We can use a single lookup.
    However that depends on running the linker on all generated bin rules, which is a breaking change, so for now we just defer the FS check until after the linker runs.
    
    This also makes sure that programs run in the location where the linker will put them (note that the logic in question runs before the linker has created the node_modules directory in the execroot.)
    This is why bazel-contrib#1787 observes that some node programs were broken - we were running the entry point as
    bazel-out/host/bin/external/npm/@graphql-codegen/cli/bin/graphql-codegen.sh.runfiles/npm/node_modules/@graphql-codegen/cli/bin.js
    when it should have been
    node_modules/@graphql-codegen/cli/bin.js
    
    Fixes bazel-contrib#1787
    alexeagle committed Apr 11, 2020
    Configuration menu
    Copy the full SHA
    3d6e003 View commit details
    Browse the repository at this point in the history