Skip to content

[nix] Migrate linter installation to nix #3826

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

Draft
wants to merge 2 commits into
base: nix-golang
Choose a base branch
from
Draft

Conversation

maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Mar 22, 2025

Why this should be merged

Migrate linter installation to nix to reduce installation time and ensure consistency between CI and local usage.

If seeing VCS errors when running lint.sh under a nix shell on macos, the following commands should fix it:

sudo xcode-select --reset
sudo xcode-select --switch /Library/Developer/CommandLineTools

Reference: NixOS/nixpkgs#355486 (comment)

How this works

  • adds a package for golangci-lint that downloads release binaries
  • uses nixos packages for shellcheck and actionlint

How this was tested

CI

Need to be documented in RELEASES.md?

N/A

TODO

@maru-ava maru-ava added the ci This focuses on changes to the CI process label Mar 22, 2025
@maru-ava maru-ava self-assigned this Mar 22, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Mar 22, 2025
@maru-ava maru-ava moved this from Backlog 🗄️ to In Review 👀 in avalanchego Mar 22, 2025
@maru-ava maru-ava force-pushed the nix-linters branch 2 times, most recently from 0500b41 to 66d0a61 Compare March 22, 2025 03:06
@maru-ava maru-ava marked this pull request as draft March 22, 2025 03:42
@maru-ava maru-ava force-pushed the nix-linters branch 5 times, most recently from 136b062 to dcb56d9 Compare March 23, 2025 00:26
This ensures dev shell users always have the required golang version.
@maru-ava maru-ava force-pushed the nix-linters branch 2 times, most recently from 6e15af6 to b18c9d5 Compare March 23, 2025 19:08
@JuanLeon2
Copy link
Contributor

@StephenButtolph are you ok with this?
Secondarily: why does this require Stephen? Because it changes a github action?

@StephenButtolph
Copy link
Contributor

are you ok with this?

Yes.

why does this require Stephen? Because it changes a github action?

Unless otherwise specified, I am the only person that default as an owner of a file. The change in the go.mod marks me as a required reviewer

@maru-ava
Copy link
Contributor Author

maru-ava commented May 1, 2025

This PR is maybe not the best path forward, I did some work in hypersdk to ensure consistent installation of golang binaries that is probably preferable to having to package golang modules with nix:

ava-labs/hypersdk#2030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process
Projects
Status: Backlog 🧊
Development

Successfully merging this pull request may close these issues.

3 participants