1
mirror of https://github.com/rclone/rclone synced 2024-12-22 13:03:02 +01: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:
Nick Craig-Wood 2016-06-03 20:09:34 +01:00
parent 1fce83b936
commit 1d6698a754
5 changed files with 9 additions and 5 deletions

View File

@ -68,7 +68,7 @@ serve: website
tag: doc
@echo "Old tag is $(LAST_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
git tag $(NEW_TAG)
@echo "Add this to changelog in docs/content/changelog.md"

View File

@ -13,7 +13,10 @@ VERSION="$1"
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
# gox -osarch-list for definitive list

View File

@ -14,8 +14,6 @@ import (
// Constants
const (
// UserAgent for Fs which can set it
UserAgent = "rclone/" + Version
// ModTimeNotSupported is a very large precision value to show
// mod time isn't supported on this Fs
ModTimeNotSupported = 100 * 365 * 24 * time.Hour
@ -25,6 +23,8 @@ const (
// Globals
var (
// UserAgent for Fs which can set it
UserAgent = "rclone/" + Version
// Filesystem registry
fsRegistry []*RegInfo
// ErrorNotFoundInConfigFile is returned by NewFs if not found in config file

View File

@ -1,4 +1,4 @@
package fs
// Version of rclone
const Version = "v1.29"
var Version = "v1.29"

View File

@ -414,6 +414,7 @@ func main() {
log.SetOutput(f)
redirectStderr(f)
}
fs.Debug("rclone", "Starting with parameters %+v", os.Args)
// Setup CPU profiling if desired
if *cpuProfile != "" {