Skip to content

Commit 09dc53f

Browse files
authored
fix: fix the reference to the old "librariangen" folder (#2677)
The cloudbuild-exitgate.yaml was referencing the old folder librariangen. This should resolve Cloud Build failure in b/454950041: ``` unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/internal/librariangen/Dockerfile: no such file or directory "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1 ``` This change also updates the reference to "librariangen" as it's just the binary name of Java and Go language containers. The term "librariangen" should not be used in a package to be shared with other language containers.
1 parent 69ac47f commit 09dc53f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

internal/container/java/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This Dockerfile creates a MOSS-compliant image for the Go librariangen,
16-
# which is invoked by the Librarian tool. It uses a multi-stage build to
17-
# create a minimal final image.
15+
# This Dockerfile creates a MOSS-compliant image for the Java
16+
# language container, which is invoked by the Librarian tool.
17+
# It uses a multi-stage build to create a minimal final image.
1818

1919
# --- Builder Stage ---
2020
# This stage builds the librariangen binary using the MOSS-compliant base image.

internal/container/java/cloudbuild-exitgate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ steps:
2424
docker pull us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest || exit 0
2525
- name: gcr.io/cloud-builders/docker
2626
args: ["build", "--cache-from", "us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest", "-t", "us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest", "-f", "Dockerfile", "."]
27-
dir: internal/librariangen
27+
dir: internal/container/java
2828
options:
2929
machineType: 'E2_HIGHCPU_8'
3030
requestedVerifyOption: VERIFIED # For provenance attestation generation

internal/container/java/languagecontainer/generate/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Context struct {
3333
// InputDir is the path to the .librarian/generator-input directory from the
3434
// language repository.
3535
InputDir string
36-
// OutputDir is the path to the empty directory where librariangen writes
36+
// OutputDir is the path to the empty directory where a language container writes
3737
// its output.
3838
OutputDir string
3939
// SourceDir is the path to a complete checkout of the googleapis repository.

internal/container/java/languagecontainer/languagecontainer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func handleGenerate(flags []string, container *LanguageContainer) int {
8585
generateFlags := flag.NewFlagSet("generate", flag.ContinueOnError)
8686
generateFlags.StringVar(&genCtx.LibrarianDir, "librarian", "/librarian", "Path to the librarian-tool input directory. Contains generate-request.json.")
8787
generateFlags.StringVar(&genCtx.InputDir, "input", "/input", "Path to the .librarian/generator-input directory from the language repository.")
88-
generateFlags.StringVar(&genCtx.OutputDir, "output", "/output", "Path to the empty directory where librariangen writes its output.")
88+
generateFlags.StringVar(&genCtx.OutputDir, "output", "/output", "Path to the empty directory where a language container writes its output.")
8989
generateFlags.StringVar(&genCtx.SourceDir, "source", "/source", "Path to a complete checkout of the googleapis repository.")
9090
if err := generateFlags.Parse(flags); err != nil {
9191
slog.Error("failed to parse flags", "error", err)

internal/container/java/message/message.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ type Change struct {
8282
func ParseLibrary(path string) (*Library, error) {
8383
data, err := os.ReadFile(path)
8484
if err != nil {
85-
return nil, fmt.Errorf("librariangen: failed to read request file from %s: %w", path, err)
85+
return nil, fmt.Errorf("languagecontainer: failed to read request file from %s: %w", path, err)
8686
}
8787

8888
var req Library
8989
if err := json.Unmarshal(data, &req); err != nil {
90-
return nil, fmt.Errorf("librariangen: failed to unmarshal request file %s: %w", path, err)
90+
return nil, fmt.Errorf("languagecontainer: failed to unmarshal request file %s: %w", path, err)
9191
}
9292

9393
return &req, nil

0 commit comments

Comments
 (0)