Skip to content

Comments

Add support for Arch and Envs for nfpm_package.#8

Open
sfc-gh-ptabor wants to merge 3 commits intoericnorris:mainfrom
sfc-gh-ptabor:20250530-env-and-arch
Open

Add support for Arch and Envs for nfpm_package.#8
sfc-gh-ptabor wants to merge 3 commits intoericnorris:mainfrom
sfc-gh-ptabor:20250530-env-and-arch

Conversation

@sfc-gh-ptabor
Copy link

@sfc-gh-ptabor sfc-gh-ptabor commented Apr 30, 2025

Add support for Arch and Envs for nfpm_package.

1. Arch allows to build multiple variants of package using different
   architectures, thanks to Bazel transitions from the same definition
   (https://bazel.build/rules/lib/builtins/transition).

2. Envs is a common way for passing bazel level data to templates (like
   the config). It supports location expansion:
   https://bazel.build/rules/lib/builtins/ctx#expand_location

[Please see the last commit only... as I cannot select the base branch]

Refreshed the dependencies in the project to make it Bazel 7 buildable.
Renamed go/v2 directory to be compatible with golang naming convention for code versioning. cd go/v2 && go build ./... works without complaining.
Applied current gazelle behaviour that generate build files in any directory.
Made sure stardoc and buildifier still work
Note:

On my linux I had to use:
CC=clang bazel build ... --sandbox_writable_path=$HOME/.ccache --sandbox_writable_path=/run/user
to build it and avoid information about missing ld or being unable to write caches.
1. Arch allows to build multiple variants of package using different
   architectures, thanks to Bazel transitions from the same definition
   (https://bazel.build/rules/lib/builtins/transition).

2. Envs is a common way for passing bazel level data to templates (like
   the config). It supports location expansion:
   https://bazel.build/rules/lib/builtins/ctx#expand_location
@sfc-gh-ptabor sfc-gh-ptabor marked this pull request as ready for review April 30, 2025 16:33
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.

1 participant