Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

go2nix seems overly greedy #24

@rushmorem

Description

@rushmorem

Sometimes go2nix requires additional packages beyond those required by go build to actually build. For example, if you are packaging coredns, a go get -d ./ is sufficient to fetch all its dependancies for building their main package. However, running go2nix save requires some other packages before it can successfully compile the Nix expressions.

I ran into this a number of times while packaging for Nix, I ended up creating a script that downloads these extra requirements while go2nix saveing:-

#!/bin/sh

while true; do
    missing_package=$(go2nix save 2>&1 | awk -F'"' '{print $2}')
    [[ -z $missing_package ]] && exit 0
    go get -d -v $missing_package
    echo "Finished downloading $missing_package"
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions