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
conftest: fix version command #99557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
λΠ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/pull/99557/head -p conftest --run 'conftest --version'
unpacking 'https://github.com/NixOS/nixpkgs/tarball/pull/99557/head'...
these derivations will be built:
/nix/store/n7qzhx2yv1r81578p0q318whaajnscbf-remove-references-to.drv
/nix/store/c7qjsn8ibg62bwcngxxk3ynbxqkd3fla-conftest-0.21.0.drv
these paths will be fetched (94.48 MiB download, 418.09 MiB unpacked):
/nix/store/18ggindri5xm8zbdpzy7x2927z1lg5gc-stdenv-linux
/nix/store/3qhafmf9yj5nyyrnm9xnil6vl6gglsf5-bash-interactive-4.4-p23-info
/nix/store/546gk8pnvdya2m2a6y791ppr71wj2imq-bash-interactive-4.4-p23-doc
/nix/store/fabkq7vbl5x6q85rg150sxr1g3rixyys-go-1.15.2
/nix/store/g5asxygf03fbkbr9h8sw15ac978bjppg-conftest-0.21.0-go-modules
/nix/store/l2g6my7nykfshahijqnk7gy7s5lq2r3k-bash-interactive-4.4-p23-man
/nix/store/ly74nfilzwx6raicvc53jdplhh4f6b0r-source
...
Version: 0.21.0
Commit:
Date:
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
/marvin opt-in |
Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here. |
The PR author cannot set the status to If you are not the PR author and you are reading this, please review the usage of this bot. You may be able to help. Please make an honest attempt to resolve all outstanding issues before setting to |
Result of 1 package built:
|
/status needs_merger |
"-ldflags=" | ||
"-s" | ||
"-w" | ||
"-X github.com/open-policy-agent/conftest/internal/commands.version=${version}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to document these? Using a long form would be ideal but if not just giving a couple of words each helps readers looking for something quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's worth documenting buildFlagsArray
/ldflags
as most people packaging know what they are and they're easy to look up in ld
documentation. As the variable name says they're flags for ld
.
Also there are many many many packages with almost identical inputs that aren't documented.
I wouldn't add a comment above vendorSha256
explaining what it's for or add a comment for why there's rec
in buildGoModule rec {
I'm happy to remove -s
and -w
though as now that I think about it they're not particularly necessary, it was mostly leftover from another derivation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Removing -s
and -w
makes sense, and removes two of the things to question. I honestly can't find out what -X
is. I agree, -ldflags
is obvious enough.
I'm going to megre for now. But feel free to send me a follow up with some comments if you think that is a good idea. |
Motivation for this change
Fix
conftest --version
so it outputs the versionThings done
Now outputs the following:
Also added a longDescription
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)