-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
shfmt: 3.0.2 -> 3.1.0 #84594
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
shfmt: 3.0.2 -> 3.1.0 #84594
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.
- build package
$ nix build --no-link --keep-going --option build-use-sandbox relaxed -f /home/phoenix/.cache/nixpkgs-review/pr-84594/build.nix
[4 built, 0.0 MiB DL]
https://github.com/NixOS/nixpkgs/pull/84594
1 package built:
shfmt
- tested against a simple shell file, formats it correctly.
}; | ||
|
||
modSha256 = "1ll2cxhgf8hh19wzdykgc81c4yfcp8bzmfaif08nvvb63rhjdb5y"; | ||
modSha256 = "080k8d5rp8kyg0x7vjxm758b9ya9z336yd4rcqws7yhqawxiv55z"; | ||
subPackages = ["cmd/shfmt"]; | ||
|
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.
would you mind adding the following?
buildFlagsArray = [ "-ldflags=-s -w -X main.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.
Upstream seems to have broken this, it wasn't needed previously and even the 3.1.0 pre-built binaries don't set the version correctly.
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 not broken per se, upstream set version
to devel, and allows to write main.version
at link time, see its dockerfile
https://github.com/mvdan/sh/blob/v3.1.0/cmd/shfmt/Dockerfile#L5
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.
mvdan/sh@bb3fed3
cmd/shfmt: set version to "devel" in master
Otherwise building master might feel like it's a release version.
Releases are tagged, and those tags have the right version.
mvdan/sh@8e403df
cmd/shfmt: start using module info for -version
This way, 'go get' installs will automatically have proper version
information. Do it in a way that doesn't break -ldflags=-X, since we use
that in the dockerfile.
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 ldflags
, we can remove it in a future release once it is fixed.
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.
Thanks for humor me. I must recognize that I barely know Golang, and you are probably right about this being a upstream issue
https://github.com/mvdan/sh/releases/tag/v3.1.0
Motivation for this change
Things done
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)