Skip to content

[nix] Add package for official golang binaries #3824

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 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

maru-ava
Copy link
Contributor

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

Why this should be merged

Ensures the availability of the required golang version in the nix dev shell.

How this works

  • Adds a nix derivation for the go package in nix/go.nix
  • Adds the package to the dev shell

How this was tested

Locally verified to work. Attempts to use in CI are not recommended since it doesn't support dependency caching like action/setup-go.

Need to be documented in RELEASES.md?

N/A

@maru-ava maru-ava added the testing This primarily focuses on testing label Mar 21, 2025
@maru-ava maru-ava self-assigned this Mar 21, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Mar 21, 2025
@maru-ava maru-ava moved this from Backlog 🗄️ to In Review 👀 in avalanchego Mar 21, 2025
@maru-ava maru-ava force-pushed the nix-golang branch 11 times, most recently from deeafe0 to 29e7e3b Compare March 22, 2025 01:05
This ensures dev shell users always have the required golang version.
@joshua-kim joshua-kim moved this to Backlog 🧊 in avalanchego May 1, 2025
@JuanLeon2
Copy link
Contributor

Can you expand why this is not risky: "Attempts to use in CI are not recommended since it doesn't support dependency caching like action/setup-go." What if someone tries to use it in CI?

@JuanLeon2 JuanLeon2 assigned StephenButtolph and unassigned maru-ava May 1, 2025
@JuanLeon2
Copy link
Contributor

Actually, this seems to have been superseded by PR 3826 #3826

True?

Can you remove this PR in that case?

@JuanLeon2 JuanLeon2 self-requested a review May 1, 2025 20:31
@StephenButtolph
Copy link
Contributor

@JuanLeon2 I don't think this PR has been superseded. #3826 seems to depend on this PR, not supersede it.

@maru-ava
Copy link
Contributor Author

maru-ava commented May 1, 2025

Can you expand why this is not risky: "Attempts to use in CI are not recommended since it doesn't support dependency caching like action/setup-go." What if someone tries to use it in CI?

setup-go is an action provided by github, that automatically caches golang module dependencies on a per-job basis. So the first job run will cache things, and subsequent runs can use the cache (unless their are go.mod changes that require re-caching).

This PR ensures that golang is available in the nix shell mainly to ensure a consistent development environment, and though the potential exists to just use nix for everything in CI, that would likely require enabling similar support for caching as setup-go already supports. I figure that work is probably unjustified at least for now.

So, not really a risk. A given job would just run a bit slower without the module cache provided by setup-go.

@maru-ava
Copy link
Contributor Author

maru-ava commented May 1, 2025

I'm going to mark this PR as draft for now, I realize it's probably desirable to provide a CI shell distinct from the current development shell to ensure that setup-go is the only source of golang in CI.

@maru-ava maru-ava marked this pull request as draft May 1, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This primarily focuses on testing
Projects
Status: Backlog 🧊
Development

Successfully merging this pull request may close these issues.

3 participants