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

use nix-build as build command #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ unnecessary downloads even if no package has been changed.

`nix-build-uncached` is available in nixpkgs.

For nix versions bigger than 2.3.x you need to enable at least
`experimental-features = nix-command` in your `/etc/nix/nix.conf` or
`$HOME/.config/nix/nix.conf` or pass `-build-flags "--experimental-features nix-command"`
to `nix-build-uncached`.

In the following example ci.nix contains all expressions
that should be built. Since only `hello-nur` is not yet in
the binary cache, all other packages are skipped.
Expand Down
5 changes: 2 additions & 3 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func raiseFdLimit() (uint64, error) {
}

func nixBuild(drvs map[string]bool, buildArgs []string) error {
buildArgs = append([]string{"build"}, buildArgs...)
numBuildChars := len("nix") + 1
for _, arg := range buildArgs {
numBuildChars += len(arg) + 1
Expand All @@ -107,7 +106,7 @@ func nixBuild(drvs map[string]bool, buildArgs []string) error {
for drv := range drvs {
n := len(drv) + 1
if n+numChars > MAX_CHARS || uint64(len(args)-len(buildArgs)) >= maxConcurrentBuilds {
cmd := Command("nix", args...)
cmd := Command("nix-build", args...)
if err := cmd.Run(); err != nil {
return err
}
Expand All @@ -118,7 +117,7 @@ func nixBuild(drvs map[string]bool, buildArgs []string) error {
numChars += n
}
if numChars > numBuildChars {
cmd := Command("nix", args...)
cmd := Command("nix-build", args...)
if err := cmd.Run(); err != nil {
return err
}
Expand Down