+
Skip to content

contrib/persistent-https: update ldflags syntax for Go 1.7+ #271

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

Closed
wants to merge 1 commit into from
Closed

contrib/persistent-https: update ldflags syntax for Go 1.7+ #271

wants to merge 1 commit into from

Conversation

parkr
Copy link
Contributor

@parkr parkr commented Jul 15, 2016

This fixes contrib/persistent-https builds for Go v1.7+ and is compatible with Go v1.5+.

Running make all in contrib/persistent-https results in a failure on Go 1.7 and above.

Specifically, the error is:

go build -o git-remote-persistent-https \
        -ldflags "-X main._BUILD_EMBED_LABEL 1468613136"
# _/Users/parkr/github/git/contrib/persistent-https
/usr/local/Cellar/go/1.7rc1/libexec/pkg/tool/darwin_amd64/link: -X flag requires argument of the form importpath.name=value
make: *** [git-remote-persistent-https] Error 2

This name=value syntax for the -X flag was introduced in Go v1.5 (released Aug 19, 2015):

In Go v1.7, support for the old syntax was removed:

This patch includes the = to fix builds with Go v1.7+.

This fixes contrib/persistent-https builds for Go v1.7+ and is compatible with Go v1.5+.

Running `make all` in `contrib/persistent-https` results in a failure on Go 1.7 and above.

Specifically, the error is:

    go build -o git-remote-persistent-https \
		    -ldflags "-X main._BUILD_EMBED_LABEL 1468613136"
    # _/Users/parkr/github/git/contrib/persistent-https
    /usr/local/Cellar/go/1.7rc1/libexec/pkg/tool/darwin_amd64/link: -X flag requires argument of the form importpath.name=value
    make: *** [git-remote-persistent-https] Error 2

This `name=value` syntax for the -X flag was introduced in Go v1.5 (released Aug 19, 2015):

- release notes: https://golang.org/doc/go1.5#link
- commit: golang/go@12795c0

In Go v1.7, support for the old syntax was removed:

- release notes: https://tip.golang.org/doc/go1.7#compiler
- commit: golang/go@51b624e

This patch includes the `=` to fix builds with Go v1.7+.
@parkr
Copy link
Contributor Author

parkr commented Jul 15, 2016

/cc #270 which was to master instead of maint.

@parkr parkr closed this Jul 15, 2016
@parkr parkr deleted the patch-2 branch July 15, 2016 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载