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): fix linker issue when running test with "local" tag on osx & linux #1835

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

gregmagolan
Copy link
Collaborator

    const maybe = path.resolve(`${symlinkRoot}/external/${root}`);
    if (fs.existsSync(maybe)) {
      // Under runfiles, when not in the sandbox we must symlink node_modules down at the execroot
      // `execroot/my_wksp/external/npm/node_modules` since `runfiles/npm/node_modules` will be a
      // directory and not a symlink back to the root node_modules where we expect
      // to resolve from. This case is tested in internal/linker/test/local.
      return maybe;
    }
    // However, when in the sandbox, `execroot/my_wksp/external/npm/node_modules` does not exist,
    // so we must symlink into `runfiles/npm/node_modules`. This directory exists whether legacy
    // external runfiles are on or off.
    return path.resolve(`${startCwd}/../${root}`)

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@gregmagolan gregmagolan merged commit 98d3321 into bazel-contrib:master Apr 16, 2020
gregmagolan added a commit to gregmagolan/rules_nodejs that referenced this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants