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

Bazel crash after canonical repo name separator change #23216

Closed
tpudlik opened this issue Aug 5, 2024 · 2 comments
Closed

Bazel crash after canonical repo name separator change #23216

tpudlik opened this issue Aug 5, 2024 · 2 comments
Assignees
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged

Comments

@tpudlik
Copy link
Contributor

tpudlik commented Aug 5, 2024

Description of the bug:

60924fd causes Bazel to crash when building my project:

Caused by: com.google.devtools.build.lib.cmdline.LabelSyntaxException: invalid repository name 'pigweed~': repo names may contain only A-Z, a-z, 0-9, '-', '_', '.' and '+'

Note that none of the repositories involved contain the string pigweed~, so (as far as I can tell) the problem is not the trivial one that we hardcode the tilde somewhere.

@Wyverald

Which category does this issue belong to?

External Dependency

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

I don't have a minimal repo yet, but here's a not-quite-minimal one:

git clone https://pigweed.googlesource.com/pigweed/examples
cd examples
git submodule update --init
# Edit `.bazelversion to point to 60924fdc2972184494f6382d39e8c786aa14b9a9
bazelisk build //...

This produces,

FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData0{actionLookupKey=ConfiguredTargetKey{label=//libraries/pw_board_led_host:pw_board_led_host, config=BuildConfigurationKey[c82b5d5554450eaba3ca1dfae135430ff2b7c9ce6851543931912b63159b76c8]}, actionIndex=0}' (requested by nodes 'TargetCompletionKey{topLevelArtifactContext=com.google.devtools.build.lib.analysis.TopLevelArtifactContext@90904c3b, actionLookupKey=ConfiguredTargetKey{label=//libraries/pw_board_led_host:pw_board_led_host, config=BuildConfigurationKey[c82b5d5554450eaba3ca1dfae135430ff2b7c9ce6851543931912b63159b76c8]}, willTest=false}', 'ActionLookupData1{actionLookupKey=ConfiguredTargetKey{label=//libraries/pw_board_led_host:pw_board_led_host, config=BuildConfigurationKey[c82b5d5554450eaba3ca1dfae135430ff2b7c9ce6851543931912b63159b76c8]}, actionIndex=1}')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:547)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:439)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.util.concurrent.CompletionException: com.google.devtools.build.lib.cmdline.LabelSyntaxException: invalid repository name 'pigweed~': repo names may contain only A-Z, a-z, 0-9, '-', '_', '.' and '+'
        at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:204)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$13(BoundedLocalCache.java:2451)
        at java.base/java.util.concurrent.ConcurrentHashMap.compute(Unknown Source)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2449)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2432)
        at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:107)
        at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:57)
        at com.google.devtools.build.lib.cmdline.RepositoryName.createUnvalidated(RepositoryName.java:97)
        at com.google.devtools.build.lib.cmdline.PackageIdentifier.discoverFromExecPath(PackageIdentifier.java:107)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction$PackageRootResolverWithEnvironment.findPackageRootsForFiles(ActionExecutionFunction.java:733)
        at com.google.devtools.build.lib.actions.ArtifactFactory.resolveSourceArtifacts(ArtifactFactory.java:489)
        at com.google.devtools.build.lib.actions.ActionCacheChecker.getCachedInputs(ActionCacheChecker.java:828)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.getActionCachedInputs(SkyframeActionExecutor.java:805)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.collectInputs(ActionExecutionFunction.java:633)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.computeInternal(ActionExecutionFunction.java:264)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:189)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:467)
        ... 7 more
Caused by: com.google.devtools.build.lib.cmdline.LabelSyntaxException: invalid repository name 'pigweed~': repo names may contain only A-Z, a-z, 0-9, '-', '_', '.' and '+'
        at com.google.devtools.build.lib.cmdline.LabelParser.syntaxErrorf(LabelParser.java:208)
        at com.google.devtools.build.lib.cmdline.RepositoryName.validate(RepositoryName.java:167)
        at com.google.devtools.build.lib.cmdline.RepositoryName.lambda$static$0(RepositoryName.java:67)
        at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:197)
        ... 23 more

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

No response

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 HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

I confirmed using bazelisk bisect that the issue starts at this commit.

Have you found anything relevant by searching the web?

No response

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

No response

@github-actions github-actions bot added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Aug 5, 2024
@tpudlik
Copy link
Contributor Author

tpudlik commented Aug 5, 2024

Sorry, my repro instructions are not quite correct. This is actually a caching issue.

Actual repro steps:

  1. bazelisk build //... the repo at some earlier Bazel version (without touching .bazelversion).
  2. Update to 60924fd
  3. Try again, and observe the crash!

This also works going the other way, except that the error message complains about pigweed+ instead of pigweed~.

@Wyverald
Copy link
Member

Wyverald commented Aug 5, 2024

Looks like a dupe of #23180

@Wyverald Wyverald closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged
Projects
None yet
Development

No branches or pull requests

5 participants