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

snap: Skip golangci-lint on riscv64. #198

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

fnordahl
Copy link
Member

@fnordahl fnordahl commented Nov 1, 2024

The golangci-lint snap is unfortunately not built for riscv64.

The snapcraft advanced grammar [0] does unfortunately not allow us to express different build dependencies on different architectures without repetition of the list of dependencies.

Making use of composition at the YAML level is also not possible because merging sequences is just not supported [1].

0: https://snapcraft.io/docs/snapcraft-advanced-grammar
1: yaml/yaml#35 (comment)
Reported-at: alexmurray/golangci-lint-snap#3
Signed-off-by: Frode Nordahl [email protected]

The golangci-lint snap is unfortunately not built for riscv64.

The snapcraft advanced grammar [0] does unfortunately not allow
us to express different build dependencies on different
architectures without repetition of the list of dependencies.

Making use of composition at the YAML level is also not possible
because merging sequences is just not supported [1].

0: https://snapcraft.io/docs/snapcraft-advanced-grammar
1: yaml/yaml#35 (comment)
Reported-at: alexmurray/golangci-lint-snap#3
Signed-off-by: Frode Nordahl <[email protected]>
@fnordahl fnordahl requested a review from a team as a code owner November 1, 2024 11:09
Copy link
Contributor

@mkalcok mkalcok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, one optional suggestion inline

@@ -274,7 +279,11 @@ parts:
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"

# Check that `golangci-lint` is happy with the code.
golangci-lint run --verbose
if command -v golangci-lint; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We could use more explicit condition here based on CRAFT_ARCH_BUILD_ON

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is indeed an option, I chose not to do that as we have to declare an assertion on architecture in the build-snaps already to avoid build failure on the back of the snap not being available:

      - to riscv64:
        - go/1.22/stable
      - else:
        - go/1.22/stable
        - golangci-lint

With that in mind it felt a bit too much to repeat that assertion here.

@fnordahl fnordahl merged commit 0d5d663 into canonical:main Nov 1, 2024
25 checks passed
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.

2 participants