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

Repository mapping manifest does not exist in test sandbox #16643

Closed
fmeum opened this issue Nov 2, 2022 · 4 comments
Closed

Repository mapping manifest does not exist in test sandbox #16643

fmeum opened this issue Nov 2, 2022 · 4 comments
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged

Comments

@fmeum
Copy link
Collaborator

fmeum commented Nov 2, 2022

Description of the bug:

The .repo_mapping file does not appear in test sandboxes.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

# WORKSPACE
# MODULE.bazel
# pkg/BUILD
sh_test(
  name = "test",
  srcs = ["test.sh"],
)
# pkg/test.sh
#!/usr/bin/env bash

runfiles_dir="$TEST_SRCDIR/../test.runfiles"
if [[ ! -d "$runfiles_dir" ]]; then
  echo "$runfiles_dir does not exist"
  exit 1
fi
repo_mapping="$TEST_SRCDIR/../test.repo_mapping"
if [[ ! -f "$repo_mapping" ]]; then
  echo "$repo_mapping does not exist"
  exit 1
fi

USE_BAZEL_VERSION=last_green bazel test //pkg:test --enable_bzlmod fails
USE_BAZEL_VERSION=last_green bazel run //pkg:test --enable_bzlmod passes
USE_BAZEL_VERSION=last_green bazel test //pkg:test --enable_bzlmod --spawn_strategy=local passes

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

HEAD

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@fmeum
Copy link
Collaborator Author

fmeum commented Nov 2, 2022

@Wyverald

@fmeum
Copy link
Collaborator Author

fmeum commented Nov 3, 2022

My guess (it really is only a guess) is that we have to explicitly add the repo mapping manifest to the input mapping in SpawnInputExpander for it to show up in sandboxed and remote execution.

@fmeum
Copy link
Collaborator Author

fmeum commented Nov 3, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 3, 2022
fmeum added a commit to fmeum/bazel that referenced this issue Nov 10, 2022
By adding the repository mapping manifest to runfiles as a root symlink, it is staged as `foo.runfiles/_repo_mapping` with all execution strategies. This includes sandboxed and remote execution, which previously did not stage the manifest at all.

As a side effect, runfiles libraries can now find the repository mapping manifest via `rlocation("_repo_mapping")`.

Fixes bazelbuild#16643
Work towards bazelbuild#16124

Closes bazelbuild#16652.

PiperOrigin-RevId: 487532254
Change-Id: I9774b8930337c5967fce92a861cc0db71dea2f0f
fmeum added a commit to fmeum/bazel that referenced this issue Nov 10, 2022
By adding the repository mapping manifest to runfiles as a root symlink, it is staged as `foo.runfiles/_repo_mapping` with all execution strategies. This includes sandboxed and remote execution, which previously did not stage the manifest at all.

As a side effect, runfiles libraries can now find the repository mapping manifest via `rlocation("_repo_mapping")`.

Fixes bazelbuild#16643
Work towards bazelbuild#16124

Closes bazelbuild#16652.

PiperOrigin-RevId: 487532254
Change-Id: I9774b8930337c5967fce92a861cc0db71dea2f0f
Wyverald pushed a commit that referenced this issue Nov 10, 2022
By adding the repository mapping manifest to runfiles as a root symlink, it is staged as `foo.runfiles/_repo_mapping` with all execution strategies. This includes sandboxed and remote execution, which previously did not stage the manifest at all.

As a side effect, runfiles libraries can now find the repository mapping manifest via `rlocation("_repo_mapping")`.

Fixes #16643
Work towards #16124

Closes #16652.

PiperOrigin-RevId: 487532254
Change-Id: I9774b8930337c5967fce92a861cc0db71dea2f0f
@meteorcloudy
Copy link
Member

Fix cherry picked in #16733, removing the potential release blocker label.

@meteorcloudy meteorcloudy removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@meteorcloudy @fmeum @bazel-io and others