-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
atlantis: 0.22.3 -> 0.27.0 #279776
atlantis: 0.22.3 -> 0.27.0 #279776
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.
nix run https://codeload.github.com/siddharthdhakane/nixpkgs/zip/refs/heads/update-atlantis#atlantis -- version
atlantis 0.27.0 (commit: none) (build date: unknown)
Builds and runs
patchPhase = '' | ||
substituteInPlace main.go --replace dev ${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.
Can you set using it with Go flags instead?
patchPhase = '' | |
substituteInPlace main.go --replace dev ${version} | |
''; | |
ldflags = [ "-X=main.version=${version}" ]; |
(I am not 100% sure if this works in non-public vars, but we should at least try).
BTW, we probably also should set the commit
and date
(with Unix epoch) flags: https://github.com/runatlantis/atlantis/blob/main/main.go#L30-L32
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.
It definitely seems to work, so we should use it instead of fragile substituteInPlace
hacks.
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.
Adding date will make this impure. Also, fetchFromGithub doesn't give you any information about the commit ID. Hardcoding the commit ID or switching to fetchgit just to add this output to the version subcommand is excessive.
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.
Adding date will make this impure.
This is why I suggested to use the Unix Epoch: https://en.wikipedia.org/wiki/Unix_time, not the actual build time.
Also, fetchFromGithub doesn't give you any information about the commit ID. Hardcoding the commit ID or switching to fetchgit just to add this output to the version subcommand is excessive.
This is fair enough.
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've added the date in the RFC3339 format as recommended here.
48f27b6
to
171e8c3
Compare
171e8c3
to
018f9e3
Compare
Result of 1 package built:
|
date = "1970-01-01T00:00:00Z"; | ||
ldflags = [ "-X=main.version=${version}" "-X=main.date=${date}"]; |
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.
date = "1970-01-01T00:00:00Z"; | |
ldflags = [ "-X=main.version=${version}" "-X=main.date=${date}"]; | |
ldflags = [ | |
"-X=main.version=${version}" | |
"-X=main.date=1970-01-01T00:00:00Z" | |
]; |
There is no need to add date
as an attr to the derivation
018f9e3
to
3144139
Compare
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.