mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:09:55 +08:00
Build tweaks - fixes #484
* disable CGO for static builds everywhere * override Version in release build script * don't output symbol table in release binaries
This commit is contained in:
parent
1fce83b936
commit
1d6698a754
2
Makefile
2
Makefile
|
@ -68,7 +68,7 @@ serve: website
|
||||||
tag: doc
|
tag: doc
|
||||||
@echo "Old tag is $(LAST_TAG)"
|
@echo "Old tag is $(LAST_TAG)"
|
||||||
@echo "New tag is $(NEW_TAG)"
|
@echo "New tag is $(NEW_TAG)"
|
||||||
echo -e "package fs\n\n// Version of rclone\nconst Version = \"$(NEW_TAG)\"\n" | gofmt > fs/version.go
|
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEW_TAG)\"\n" | gofmt > fs/version.go
|
||||||
perl -lpe 's/VERSION/${NEW_TAG}/g; s/DATE/'`date -I`'/g;' docs/content/downloads.md.in > docs/content/downloads.md
|
perl -lpe 's/VERSION/${NEW_TAG}/g; s/DATE/'`date -I`'/g;' docs/content/downloads.md.in > docs/content/downloads.md
|
||||||
git tag $(NEW_TAG)
|
git tag $(NEW_TAG)
|
||||||
@echo "Add this to changelog in docs/content/changelog.md"
|
@echo "Add this to changelog in docs/content/changelog.md"
|
||||||
|
|
|
@ -13,7 +13,10 @@ VERSION="$1"
|
||||||
|
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
gox -output "build/{{.Dir}}-${VERSION}-{{.OS}}-{{.Arch}}/{{.Dir}}" -os "darwin linux freebsd openbsd windows freebsd netbsd plan9 solaris"
|
# Disable CGO and dynamic builds on all platforms (including build patform)
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
gox --ldflags "-s -X github.com/ncw/rclone/fs.Version=${VERSION}" -output "build/{{.Dir}}-${VERSION}-{{.OS}}-{{.Arch}}/{{.Dir}}" -os "darwin linux freebsd openbsd windows freebsd netbsd plan9 solaris"
|
||||||
# Not implemented yet: nacl dragonfly android
|
# Not implemented yet: nacl dragonfly android
|
||||||
# gox -osarch-list for definitive list
|
# gox -osarch-list for definitive list
|
||||||
|
|
||||||
|
|
4
fs/fs.go
4
fs/fs.go
|
@ -14,8 +14,6 @@ import (
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const (
|
const (
|
||||||
// UserAgent for Fs which can set it
|
|
||||||
UserAgent = "rclone/" + Version
|
|
||||||
// ModTimeNotSupported is a very large precision value to show
|
// ModTimeNotSupported is a very large precision value to show
|
||||||
// mod time isn't supported on this Fs
|
// mod time isn't supported on this Fs
|
||||||
ModTimeNotSupported = 100 * 365 * 24 * time.Hour
|
ModTimeNotSupported = 100 * 365 * 24 * time.Hour
|
||||||
|
@ -25,6 +23,8 @@ const (
|
||||||
|
|
||||||
// Globals
|
// Globals
|
||||||
var (
|
var (
|
||||||
|
// UserAgent for Fs which can set it
|
||||||
|
UserAgent = "rclone/" + Version
|
||||||
// Filesystem registry
|
// Filesystem registry
|
||||||
fsRegistry []*RegInfo
|
fsRegistry []*RegInfo
|
||||||
// ErrorNotFoundInConfigFile is returned by NewFs if not found in config file
|
// ErrorNotFoundInConfigFile is returned by NewFs if not found in config file
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
// Version of rclone
|
// Version of rclone
|
||||||
const Version = "v1.29"
|
var Version = "v1.29"
|
||||||
|
|
|
@ -414,6 +414,7 @@ func main() {
|
||||||
log.SetOutput(f)
|
log.SetOutput(f)
|
||||||
redirectStderr(f)
|
redirectStderr(f)
|
||||||
}
|
}
|
||||||
|
fs.Debug("rclone", "Starting with parameters %+v", os.Args)
|
||||||
|
|
||||||
// Setup CPU profiling if desired
|
// Setup CPU profiling if desired
|
||||||
if *cpuProfile != "" {
|
if *cpuProfile != "" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user