Skip to content

Commit

Permalink
fix: fix make generate to build with BUILDKIT_MULTI_PLATFORM=0
Browse files Browse the repository at this point in the history
Due to the change in `BUILDKIT_MULTI_PLATFORM=1`, the generated files from `make generate` land initially in a directory named `<os>_<arch>`, which we then move into the actual destination directories with a script.

This move fails to merge the existing directories with the newly generated files. So, instead, on `generate` command, we override the `BUILDKIT_MULTI_PLATFORM` variable back to `0` to restore the old behavior. We do not need it for generating sources.

Additionally, remove the deprecated `gomnd` linter from the `golangci-lint` configuration.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Nov 15, 2024
1 parent c0e2b63 commit 91b35db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-06-19T18:39:17Z by kres 661b038.
# Generated on 2024-11-14T12:41:15Z by kres 192a4d9c.

# options for analysis running
run:
Expand Down Expand Up @@ -130,7 +130,6 @@ linters:
- gochecknoglobals
- gochecknoinits
- godox
- gomnd
- gomoddirectives
- gosec
- inamedparam
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-11-12T14:20:31Z by kres b6443eb-dirty.
# Generated on 2024-11-15T09:12:52Z by kres c89d4488.

# common variables

Expand Down Expand Up @@ -157,7 +157,7 @@ local-%: ## Builds the specified target defined in the Dockerfile using the loc
done'

generate: ## Generate .proto definitions.
@$(MAKE) local-$@ DEST=./
@$(MAKE) local-$@ TARGET_ARGS="--build-arg=BUILDKIT_MULTI_PLATFORM=0 $(TARGET_ARGS)" DEST=./

lint-golangci-lint: ## Runs golangci-lint linter.
@$(MAKE) target-$@
Expand Down
1 change: 0 additions & 1 deletion internal/output/golangci/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ linters:
- gochecknoglobals
- gochecknoinits
- godox
- gomnd
- gomoddirectives
- gosec
- inamedparam
Expand Down
2 changes: 1 addition & 1 deletion internal/project/golang/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (generate *Generate) CompileMakefile(output *makefile.Output) error {
}

output.Target("generate").Description("Generate .proto definitions.").
Script("@$(MAKE) local-$@ DEST=./")
Script(`@$(MAKE) local-$@ TARGET_ARGS="--build-arg=BUILDKIT_MULTI_PLATFORM=0 $(TARGET_ARGS)" DEST=./`)

return nil
}
Expand Down

0 comments on commit 91b35db

Please sign in to comment.