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

buildGoPackage: fix preFixup failing #24942

Merged
merged 1 commit into from May 1, 2017
Merged

Conversation

snyh
Copy link
Member

@snyh snyh commented Apr 16, 2017

The preFixup is always failed if the target package hasn't any
binary output.

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

The preFixup is always failed if the target package hasn't any
binary output.
@mention-bot
Copy link

@snyh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @wkennington, @ehmry and @kamilchm to be potential reviewers.

@@ -184,7 +184,7 @@ go.stdenv.mkDerivation (
'';

preFixup = preFixup + ''
find $bin/bin -type f -exec ${removeExpr removeReferences} '{}' +
find $bin/bin -type f -exec ${removeExpr removeReferences} '{}' + || true
Copy link
Member

Choose a reason for hiding this comment

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

What was the error in this case?

Copy link
Member

Choose a reason for hiding this comment

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

I would assume that find was unhappy not to find any files

@snyh
Copy link
Member Author

snyh commented Apr 16, 2017 via email

@joachifm
Copy link
Contributor

joachifm commented Apr 16, 2017

An alternative solution is to use ${!outputBin} instead, if it is set, or some other way besides simply ignoring the error.

@kamilchm
Copy link
Member

You could also use subPackages to include only main packages, eg.

subPackages = [ "cmd/bosun" "cmd/scollector" ];

What's you use case?

@snyh
Copy link
Member Author

snyh commented Apr 20, 2017

@kamilchm I use buildGoPackage for library packages which hasn't any main .

Because there has many go programs which can't just simply use go get to build. And program like this also has many go dependencies. I want use buildGoPackage to build this go dependencies and then use normal stdenv with this dependencies.

Or is there has better way to build programs which can't simply use go get

@7c6f434c 7c6f434c merged commit e7fd6d2 into NixOS:master May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants