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

BazelBot hasn't created a change for a C# generator update #5039

Closed
jskeet opened this issue Apr 24, 2023 · 7 comments
Closed

BazelBot hasn't created a change for a C# generator update #5039

jskeet opened this issue Apr 24, 2023 · 7 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jskeet
Copy link
Contributor

jskeet commented Apr 24, 2023

googleapis/googleapis commit 70eaf0dbe updates the C# GAPIC generator to v1.4.14.

On a local Linux box, this correctly generates new code - the simplest way of telling being that snippets are now generated in a namespace of GoogleCSharpSnippets.

However, there isn't a corresponding commit for googleapis-gen.

Changes I'd expect from this update:

  • The namespace change in generated snippets, described above
  • Deletion of a number of copies of mixins (Google.Cloud.Iam.V1, Google.LongRunning, Google.Cloud.Location and corresponding snippets)
  • Addition of PackageReference elements in some APIs
@jskeet jskeet added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 24, 2023
@jskeet
Copy link
Contributor Author

jskeet commented Apr 24, 2023

The change also occurred on the preview branch, but that doesn't have a commit on the preview branch of googleapis-gen either.

@SurferJeffAtGoogle
Copy link
Contributor

Bazel bot failed to generate all the csharp targets. Therefore, no changes were committed.

I see this error repeated throughout the bazel bot log:

Step #1: ERROR: /workspace/googleapis/google/cloud/workstations/v1beta/BUILD.bazel:361:21: @//google/cloud/workstations/v1beta:workstations_csharp_gapic_srcjar: `bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc --experimental_allow_proto3_optional --plugin=protoc-gen-gapic=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/gapic_generator_csharp/rules_csharp_gapic/run.sh --gapic_out=bazel-out/k8-fastbuild/bin/google/cloud/workstations/v1beta/workstations_csharp_gapic_srcjar.srcjar.zip --gapic_opt=rest-numeric-enums=True,transport=grpc+rest,grpc-service-config=google/cloud/workstations/v1beta/workstations_grpc_service_config.json,common-resources-config=external/gax_dotnet/Google.Api.Gax/ResourceNames/CommonResourcesConfig.json,service-config=google/cloud/workstations/v1beta/workstations_v1beta.yaml -Igoogle/cloud/workstations/v1beta/workstations.proto=google/cloud/workstations/v1beta/workstations.proto -Igoogle/api/annotations.proto=google/api/annotations.proto -Igoogle/api/http.proto=google/api/http.proto -Igoogle/protobuf/descriptor.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/descriptor_proto/google/protobuf/descriptor.proto -Igoogle/api/client.proto=google/api/client.proto -Igoogle/api/launch_stage.proto=google/api/launch_stage.proto -Igoogle/protobuf/duration.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/duration_proto/google/protobuf/duration.proto -Igoogle/api/field_behavior.proto=google/api/field_behavior.proto -Igoogle/api/resource.proto=google/api/resource.proto -Igoogle/longrunning/operations.proto=google/longrunning/operations.proto -Igoogle/rpc/status.proto=google/rpc/status.proto -Igoogle/protobuf/any.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/any_proto/google/protobuf/any.proto -Igoogle/protobuf/empty.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/empty_proto/google/protobuf/empty.proto -Igoogle/protobuf/field_mask.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/field_mask_proto/google/protobuf/field_mask.proto -Igoogle/protobuf/timestamp.proto=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/timestamp_proto/google/protobuf/timestamp.proto -Igoogle/cloud/common_resources.proto=google/cloud/common_resources.proto -Igoogle/cloud/location/locations.proto=google/cloud/location/locations.proto -Igoogle/iam/v1/iam_policy.proto=google/iam/v1/iam_policy.proto -Igoogle/iam/v1/options.proto=google/iam/v1/options.proto -Igoogle/iam/v1/policy.proto=google/iam/v1/policy.proto -Igoogle/type/expr.proto=google/type/expr.proto google/cloud/workstations/v1beta/workstations.proto google/cloud/common_resources.proto google/cloud/location/locations.proto google/iam/v1/iam_policy.proto` failed: (Exit 1): protoc failed: error executing command (from target //google/cloud/workstations/v1beta:workstations_csharp_gapic_srcjar) bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc --experimental_allow_proto3_optional ... (remaining 28 arguments skipped)
Step #1: 
Step #1: Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Step #1: System.IO.IOException: Read-only file system : '/root/.local/share/NuGet/Migrations'
Step #1:    at System.IO.FileSystem.CreateDirectory(String fullPath)
Step #1:    at System.IO.Directory.CreateDirectory(String path)
Step #1:    at NuGet.Common.Migrations.MigrationRunner.GetMigrationsDirectory()
Step #1:    at NuGet.Common.Migrations.MigrationRunner.Run()
Step #1:    at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
Step #1:    at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean isDotnetBeingInvokedFromNativeInstaller, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider, Dictionary`2 performanceMeasurements)
Step #1:    at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
Step #1:    at Microsoft.DotNet.Cli.Program.Main(String[] args)
Step #1: The user's home directory could not be determined. Set the 'DOTNET_CLI_HOME' environment variable to specify the directory to use.
Step #1: --gapic_out: protoc-gen-gapic: Plugin failed with status code 1.

Assigning this bug back to Jon for advice.

@jskeet
Copy link
Contributor Author

jskeet commented Apr 25, 2023

My guess is that this was caused by updating the .NET SDK from 6.0.402 to 6.0.408 in the Bazel rules (in this commit). This issue may or may not be related.

In order to unblock the pipeline during the UK day, I'll revert just the Bazel part of that commit and do a new release (and update WORKSPACE to refer to it). I'll then reach out to @SurferJeffAtGoogle to find a way to reproduce this myself, so I can work on a fix without having to go via doing a release each time.

@jskeet
Copy link
Contributor Author

jskeet commented Apr 25, 2023

Reverting to 6.0.402 has fixed the build - we now have the changes propagated to googleapis-gen. I'll work on diagnosing why 6.0.408 fails.

@jskeet
Copy link
Contributor Author

jskeet commented Apr 25, 2023

An attempt to reproduce this:

First start bash in a new container with the docker image:

  • sudo docker run --rm -it --entrypoint bash gcr.io/repo-automation-bots/bazel-bot:latest

Now do the simple bits of a build, which should exercise the problematic part:

... but that succeeds :(

Next, try bazelisk instead (in a fresh container), e.g.

  • bazelisk build //google/cloud/functions/v1:google-cloud-functions-v1-csharp

... that succeeds as well. So I'm stuck as to how to reproduce this...

@jskeet
Copy link
Contributor Author

jskeet commented Apr 26, 2023

Update: I now have a docker image (from this commit) which fails in Cloud Build, but works in a local Docker build. Curiouser and curiouser.

Will try to reduce it further...

@jskeet
Copy link
Contributor Author

jskeet commented Apr 28, 2023

Fixed in googleapis/gapic-generator-csharp#623

@jskeet jskeet closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants