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

Add rules_swift 1.5.0 #327

Merged
merged 3 commits into from
Dec 23, 2022

Conversation

BalestraPatrick
Copy link
Member

@BalestraPatrick BalestraPatrick commented Dec 22, 2022

I think this will fail the verification of the zip having the same MODULE.bazel as the one that is checked-in, because the way the our release workflow works is that we first tag and build the release archive and only then we bump the MODULE.bazel with an automated PR (such as bazelbuild/rules_apple#1793) after the release has been tagged already.

I assume a patch changing the version number is the easiest way to fix this for now, and the recommendation is to change our workflow to bump the version number before we tag a release?

@fmeum
Copy link
Contributor

fmeum commented Dec 22, 2022

I assume a patch changing the version number is the easiest way to fix this for now, and the recommendation is to change our workflow to bump the version number before we tag a release?

Yes, that's right. The "Publish to BCR" GitHub app should automatically create such a patch, but ideally you would bump the version before cutting the release.

@BalestraPatrick
Copy link
Member Author

@fmeum Yeah I just pushed a fix to our repos for hopefully getting the BCR app to work starting the next one.

@fmeum
Copy link
Contributor

fmeum commented Dec 22, 2022

@meteorcloudy I restarted the build, but the CI gets stuck consistently after trying to apply the patches: https://buildkite.com/bazel/bcr-presubmit/builds/781#01853952-c258-4daf-854e-39f35df5ee4d

@meteorcloudy
Copy link
Member

Hmm, it looks like the patch command line tools is waiting for input, probably something is wrong with the patch content. But I'll check how to solve the hanging issue and give a better error message.

@meteorcloudy
Copy link
Member

Fixing the hanging problem in bazelbuild/continuous-integration#1519

A manually run with -f gives:

$ patch -f -p1 -i ../rules_swift.patch
patching file MODULE.bazel
1 out of 1 hunks failed--saving rejects to MODULE.bazel.rej

@BalestraPatrick
Copy link
Member Author

The CI failure looks legit. I can reproduce it locally too, but there are no more details than this:

ERROR: Analysis of target '@rules_swift~override//examples/xplatform/proto:example_path_to_underscores_proto_swift' failed; build aborted:

Building the target directly in the rules_swift repo works without bzlmod. The PR under question that changed that example project lately was this one, but I can't see anything that would break under bzlmod: bazelbuild/rules_swift#919

@Wyverald
Copy link
Member

Wyverald commented Dec 22, 2022

I can reproduce the failure by building from a module that depends on rules_swift 1.5.0 via a local_path_override. Couldn't get any meaningful error message.

I wonder if this is hitting something similar to bazelbuild/bazel#16338

@fmeum
Copy link
Contributor

fmeum commented Dec 22, 2022

I ran the build with a version of Bazel that has a few printStackTrace calls patched in and got:

com.google.devtools.build.lib.skyframe.AspectCreationException: Evaluation of aspect @rules_swift~1.5.0//swift/internal:swift_protoc_gen_aspect.bzl%swift_protoc_gen_aspect on @rules_swift~1.5.0//examples/xplatform/proto:example_path_to_underscores_proto failed: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@[unknown repo 'platforms' requested from @rules_swift~1.5.0]//os': The repository '@[unknown repo 'platforms' requested from @rules_swift~1.5.0]' could not be resolved: No repository visible as '@platforms' from repository '@rules_swift~1.5.0'
	at com.google.devtools.build.lib.analysis.AspectResolver.resolveAspectDependencies(AspectResolver.java:85)
	at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.computeDependencies(ConfiguredTargetFunction.java:898)
	at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:355)
	at com.google.devtools.build.skyframe.ParallelEvaluator.bubbleErrorUp(ParallelEvaluator.java:427)
	at com.google.devtools.build.skyframe.ParallelEvaluator.waitForCompletionAndConstructResult(ParallelEvaluator.java:216)
	at com.google.devtools.build.skyframe.ParallelEvaluator.doMutatingEvaluation(ParallelEvaluator.java:182)
	at com.google.devtools.build.skyframe.ParallelEvaluator.eval(ParallelEvaluator.java:677)
	at com.google.devtools.build.skyframe.InMemoryMemoizingEvaluator.evaluate(InMemoryMemoizingEvaluator.java:203)
	at com.google.devtools.build.lib.skyframe.SkyframeExecutor.configureTargets(SkyframeExecutor.java:2220)
	at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:344)
	at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:433)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:242)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:140)
	at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:181)
	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:512)
	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:480)
	at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:103)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:608)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:233)
	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:550)
	at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:614)
	at io.grpc.Context$1.run(Context.java:566)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Not sure why the message never made it anywhere though.

@meteorcloudy
Copy link
Member

OK, sounds like bazelbuild/bazel#16338 is more important than we thought..

fmeum added a commit to fmeum/bazel that referenced this pull request Dec 23, 2022
Since ec4be00,
`AspectCreationException`s were no longer reported to the user,
resulting in error messages such as:

```
ERROR: Analysis of target '//pkg:foo' failed; build aborted:
```

With this commit, the error looks like this instead:

```
ERROR: Evaluation of aspect //aspects:aspects.bzl%my_aspect on //pkg:foo failed: <causes...>
```

Context: bazelbuild/bazel-central-registry#327
@fmeum
Copy link
Contributor

fmeum commented Dec 23, 2022

OK, sounds like bazelbuild/bazel#16338 is more important than we thought..

I think it's actually an unrelated issue: a small regression introduced by bazelbuild/bazel@ec4be00, which is already in Bazel 5.

I submitted a fix as bazelbuild/bazel#17071

fmeum added a commit to fmeum/bazel that referenced this pull request Dec 23, 2022
Since ec4be00,
`AspectCreationException`s were no longer reported to the user,
resulting in error messages such as:

```
ERROR: Analysis of target '//pkg:foo' failed; build aborted:
```

With this commit, the error looks like this instead:

```
ERROR: Evaluation of aspect //aspects:aspects.bzl%my_aspect on //pkg:foo failed: <causes...>
```

Context: bazelbuild/bazel-central-registry#327
@BalestraPatrick
Copy link
Member Author

Thanks a lot for the investigation @fmeum! That was indeed the problem. I added a dep on platforms and the PR is green now.

@meteorcloudy meteorcloudy merged commit 92fba89 into bazelbuild:main Dec 23, 2022
@BalestraPatrick BalestraPatrick deleted the rules-swift-1.5.0 branch December 23, 2022 13:59
BalestraPatrick added a commit to bazelbuild/rules_swift that referenced this pull request Dec 23, 2022
This was discovered while registering the latest rules_swift release
into the BCR and running the validation pipelines there. It was tricky
to debug, but it seems like either a recent change in rules_swift or
bzlmod and Bazel caused this to be required.

bazelbuild/bazel-central-registry#327

Now that bzlmod is more stable, we should likely look into adding a
bzlmod verification pipeline directly in this repo so we can catch
regressions earlier.
copybara-service bot pushed a commit to bazelbuild/bazel that referenced this pull request Jan 10, 2023
Since ec4be00, `AspectCreationException`s are no longer reported to the user, resulting in error messages such as:

```
ERROR: Analysis of target '//pkg:foo' failed; build aborted:
```

With this commit, the error looks like this instead:

```
ERROR: Evaluation of aspect //aspects:aspects.bzl%my_aspect on //pkg:foo failed: <causes...>
```

Context: bazelbuild/bazel-central-registry#327

Closes #17071.

PiperOrigin-RevId: 500883551
Change-Id: Iaf3b1dff8cb0915dd1ddc51d1d5e6578ff44029b
meteorcloudy pushed a commit to bazelbuild/bazel that referenced this pull request Jan 20, 2023
Since ec4be00, `AspectCreationException`s are no longer reported to the user, resulting in error messages such as:

```
ERROR: Analysis of target '//pkg:foo' failed; build aborted:
```

With this commit, the error looks like this instead:

```
ERROR: Evaluation of aspect //aspects:aspects.bzl%my_aspect on //pkg:foo failed: <causes...>
```

Context: bazelbuild/bazel-central-registry#327

Closes #17071.

PiperOrigin-RevId: 500883551
Change-Id: Iaf3b1dff8cb0915dd1ddc51d1d5e6578ff44029b

Co-authored-by: Fabian Meumertzheim <[email protected]>
hvadehra pushed a commit to bazelbuild/bazel that referenced this pull request Feb 14, 2023
Since ec4be00, `AspectCreationException`s are no longer reported to the user, resulting in error messages such as:

```
ERROR: Analysis of target '//pkg:foo' failed; build aborted:
```

With this commit, the error looks like this instead:

```
ERROR: Evaluation of aspect //aspects:aspects.bzl%my_aspect on //pkg:foo failed: <causes...>
```

Context: bazelbuild/bazel-central-registry#327

Closes #17071.

PiperOrigin-RevId: 500883551
Change-Id: Iaf3b1dff8cb0915dd1ddc51d1d5e6578ff44029b
tymurmustafaiev pushed a commit to tymurmustafaiev/rules_swift that referenced this pull request Jul 19, 2023
This was discovered while registering the latest rules_swift release
into the BCR and running the validation pipelines there. It was tricky
to debug, but it seems like either a recent change in rules_swift or
bzlmod and Bazel caused this to be required.

bazelbuild/bazel-central-registry#327

Now that bzlmod is more stable, we should likely look into adding a
bzlmod verification pipeline directly in this repo so we can catch
regressions earlier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants