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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,13 @@ parts:
- ovn
- ovs
build-snaps:
- go/1.22/stable
- golangci-lint
# golangci-lint is currently not available on all architectures.
# (alexmurray/golangci-lint-snap#3)
- to riscv64:
- go/1.22/stable
- else:
- go/1.22/stable
- golangci-lint
plugin: nil
override-pull: |
craftctl default
Expand Down Expand Up @@ -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.

golangci-lint run --verbose
else
echo WARNING: Not running golangci-lint as binary is not available.
fi

# Run any unit tests.
LD_LIBRARY_PATH=${CRAFT_STAGE}/lib/:${CRAFT_STAGE}/usr/local/lib/ \
Expand Down
Loading