Skip to content

bazel sync fails during yarn_installΒ #1086

@ian-h-chamberlain

Description

@ian-h-chamberlain

🐞 Bug report

Affected Rule

Failure occurs in ts_setup_workspace() from rules_typescript

Is this a regression?

I don't think so – I can't find any other Github issues describing this problem, but I'm not sure whether the sync operation was ever supported/tested.

Description

bazel sync fails to complete yarn_install for build_bazel_rules_typescript_tsc_wrapped_deps repository. It appears that the failing yarn_install rules were removed from rules_typescript as part of bazelbuild/rules_typescript#429, but still remain in this repo's version of ts_repositories.bzl – perhaps the checked-in version simply needs to be updated to upstream rules_typescript? I'm not quite clear on the relationship between the packages/typescript directory and the rules_typescript repository.

πŸ”¬ Minimal Reproduction

I have created a minimal reproduction with a simple nodejs_binary typescript target here:

https://github.com/ian-h-chamberlain/bad-yarn-install

Simply clone and run bazel sync to see the error.
Note that fetch/build/run etc. work without a problem... only bazel sync is affected.

πŸ”₯ Exception or Error


INFO: Call stack for the definition of repository 'build_bazel_rules_typescript_tsc_wrapped_deps' which is a yarn_install (rule definition at /private/var/tmp/_bazel_ichamberlain/6f039f055d4e51b6e0afb14d1a8ec43c/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:406:16):
 - /private/var/tmp/_bazel_ichamberlain/6f039f055d4e51b6e0afb14d1a8ec43c/external/build_bazel_rules_nodejs/defs.bzl:82:5
 - /private/var/tmp/_bazel_ichamberlain/6f039f055d4e51b6e0afb14d1a8ec43c/external/npm_bazel_typescript/internal/ts_repositories.bzl:35:5
 - /Users/ichamberlain/Documents/thirdparty/bad-yarn-install/WORKSPACE:61:1
ERROR: An error occurred during the fetch of repository 'build_bazel_rules_typescript_tsc_wrapped_deps':
   Not a regular file: /private/var/tmp/_bazel_ichamberlain/6f039f055d4e51b6e0afb14d1a8ec43c/external/npm_bazel_typescript/internal/tsc_wrapped/yarn.lock
ERROR: Not a regular file: /private/var/tmp/_bazel_ichamberlain/6f039f055d4e51b6e0afb14d1a8ec43c/external/npm_bazel_typescript/internal/tsc_wrapped/yarn.lock
Loading: loading...

🌍 Your Environment

Operating System:

  
macOS Mojave 10.14.6
  

Output of bazel version:

  
$ bazel version 
Build label: 0.28.1
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jul 19 15:22:50 2019 (1563549770)
Build timestamp: 1563549770
Build timestamp as int: 1563549770
  

Rules version (SHA):

  
git_repository(
    name = "build_bazel_rules_nodejs",
    commit = "e04c8c31f3cb859754ea5c5e97f331a3932b725d",
    remote = "https://github.com/bazelbuild/rules_nodejs.git",
    shallow_since = "1567186025 -0700",
)
  

Let me know if any additional information is required – this is blocking my organization's use of rules_nodejs as we utilize bazel sync to create a kind of lockfile for transitive dependencies coming from our WORKSPACE file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions