Repository navigation
Use build tags in the version and selfupdate commands - #5151
Conversation
|
LGTM.
Could have an option, e.g. |
I feel reluctant to add flags, as usual. Let's see what Nick says during review. Opposed by two, I will instantly yield :-) |
|
I am also of the opinion to skip the Should we consider separating out the version info based on its type ( This does have the possibility of breaking any scripts that parse this output, however. |
I feel like it's not going to wreak havoc. The |
d705370 to
cceb574
Compare
This comment has been minimized.
This comment has been minimized.
|
One minor consideration: Do we want to split |
What would Nick say? |
I'm thinking the same.. |
This patch modifies the output of `rclone version`. The `os/arch` line is split into `os/type` and `os/arch`. The `go version` line is now tagged as `go/version` for consistency. Additionally the `go/linking` line tells whether the rclone was linked as a static or dynamic executable. The new `go/tags` line shows a space separated list of build tags. The info about linking and build tags is also added to the output of the `core/version` RC endpoint.
|
done |
ncw
left a comment
There was a problem hiding this comment.
Both those commits look great - thanks.
Please merge when ready.
Use build tags in the
versionandselfupdatecommandsWhat is the purpose of this change?
Knowing build tags would be useful.
For example, only
cmountbuilds support passing custom libfuse flags.(See #3545 for an example why it matters).
As stated in golang/go#7007 (comment), golang does not and will not provide any runtime API for finding build tags on the fly:
This PR uses this very technique to initialize an internal array of build tags.
The technique has a limitation that every detectable tag must be known in advance.
Currently only the
cmountandcgotags are supported.Knowing whether it is a CGO enabled build or not (so whether it is static or dynamic) would be really useful for debugging DNS problems.
As described in the go documentation (https://golang.org/cmd/cgo), when cgo builds a dynamic executable, it marks itself by the
cgobuild tag.This PR makes
rclone versionshow a list of predefined build tags ornone.The
cgotag will not be included in the list but used to determine whether the rclone binary is static or dynamic.Additionally this PR makes
rclone selfupdateaware of thecmountbuild tag to detect whether the FUSE support is in.An update will be refused if the running executable supports FUSE semantics but the update would discard it and consequently break tooling wrappers.
Was the change discussed in an issue or in the forum before?
Proposed in https://forum.rclone.org/t/rclone-cmount-on-linux/22602/4
Fixes #5091
Checklist
Testing
It is hard to test build capabilities automatically as CI/CD builds heavily depend on the build environment.
Instead, I will run the following manual test:
Merging
I think this PR can be merged as two commits, where one patches the
versioncommand and the other patchesselfupdate.