Skip to content

Conversation

maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Oct 9, 2025

Why this should be merged

Exposing the go derivation via a flake allows the firewood flake to use it to provide its go version without preventing the avalanchego flake from depending on the firewood flake.

How this was tested

  • CI
  • Manually
    • Locally: nix ./nix/go
    • Remotely: nix run 'github:ava-labs/avalanchego?dir=nix/go&ref=9cd1c3aee7c2ef1b46621799d7ef0698c2326046'

Need to be documented in RELEASES.md?

N/A

Exposing the go derivation via a flake allows the firewood flake to
use it to provide its go version without preventing the avalanchego
flake from depending on the firewood flake.
@maru-ava maru-ava self-assigned this Oct 9, 2025
@maru-ava maru-ava requested a review from joshua-kim as a code owner October 9, 2025 03:48
@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 03:48
@maru-ava maru-ava added the tooling Build, test and development tooling label Oct 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors Go derivation into a nested flake structure to enable cross-repository reuse while maintaining dependency relationships between avalanchego and firewood projects.

  • Extracts Go toolchain definition from nix/go.nix into a standalone flake (nix/go/flake.nix)
  • Updates main flake to consume Go package from nested flake instead of direct import
  • Updates documentation reference to reflect new file location

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

File Description
nix/go/flake.nix Creates new standalone flake exporting Go toolchain package
flake.nix Updates to use go-flake input instead of direct import
go.mod Updates comment to reference new Go derivation file location

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@maru-ava maru-ava moved this to Ready 🚦 in avalanchego Oct 9, 2025
@maru-ava maru-ava force-pushed the maru/nix-export-go branch from 1fc5ebf to 335c4d2 Compare October 9, 2025 04:03
@Elvis339
Copy link
Contributor

Elvis339 commented Oct 9, 2025

Just to confirm I understand the issue correctly; before this change, did the firewood flake need to depend on the entire avalanchego flake just to get the Go version, which would create a circular dependency since avalanchego also depends on firewood? And this PR solves it by letting firewood import only the Go derivation from nix/go instead of the full avalanchego flake - is that right?

@maru-ava
Copy link
Contributor Author

maru-ava commented Oct 9, 2025

Just to confirm I understand the issue correctly; before this change, did the firewood flake need to depend on the entire avalanchego flake just to get the Go version, which would create a circular dependency since avalanchego also depends on firewood? And this PR solves it by letting firewood import only the Go derivation from nix/go instead of the full avalanchego flake - is that right?

Correct. And I'd like to reuse avalancheg's go derivation in the firewood flake instead of:

  1. Using the nix version which is not guaranteed to match the version defined in firewood's go.mod
    • This will still work because golang is smart enough to download and switch to the correct version, but cleaner to just use the correct version to start with
  2. Duplicating the go derivation in the firewood repo

@StephenButtolph StephenButtolph merged commit e752db2 into master Oct 13, 2025
35 checks passed
@StephenButtolph StephenButtolph deleted the maru/nix-export-go branch October 13, 2025 13:14
@github-project-automation github-project-automation bot moved this from Ready 🚦 to Done 🎉 in avalanchego Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling Build, test and development tooling

Projects

Status: Done 🎉

Development

Successfully merging this pull request may close these issues.

3 participants