As part of https://golang.org/s/better-linker, we now build a binary called oldlink in our release of Go. While it may be useful to include in the beta, we should make a decision on whether this is included in the RC or final releases of Go 1.15, vs asking people to rebuild it on their own if necessary.
/cc @cherrymui @aclements @golang/osp-team
/cc @jeremyfaller @thanm
I think it's a good idea to include this in the beta. While our internal testing gets good coverage of certain configurations, it doesn't get very good coverage of others, and shipping this in the beta will help with any problems uncovered there.
However, the new linker roll out has been going really smoothly so far. Assuming the beta doesn't uncover any serious linker issues, I'd be inclined to leave oldlink out of the RC.
@aclements 's suggestion SGTM.
A test may fail if the old linker is not present. We could change the test to skip if the binary does not exist.
I'm happy with @aclements 's suggestion too.
It was really @toothrot 's suggestion, so I think we're all in agreement. :)
A test may fail if the old linker is not present. We could change the test to skip if the binary does not exist.
@cherrymui Were you referring to a specific test? Or did you mean we should look for such tests and update them as needed?
I can try to find anything by taking go1.15beta1, removing the oldlink binary, then seeing if anything comes up during go test std cmd.
@cherrymui Were you referring to a specific test?
TestOldLink in cmd/link.
Thanks!
This is how the test fails when oldlink binary isn't present:
$ go test -v -run=TestOldLink -count=1 cmd/link
=== RUN TestOldLink
link_test.go:558: [/tmp/tmp.AG3oE0Ne/go/bin/go run -gcflags=all=-go115newobj=false -asmflags=all=-go115newobj=false -ldflags=-go115newobj=false /tmp/TestOldLink814981397/main.go]: exit status 2:
# command-line-arguments
2020/07/14 18:36:02 invoke oldlink failed:fork/exec /tmp/tmp.AG3oE0Ne/go/pkg/tool/darwin_amd64/oldlink: no such file or directory
--- FAIL: TestOldLink (0.14s)
FAIL
FAIL cmd/link 0.269s
It's going to affect people who try to run go test cmd/link after installing a binary release of Go from https://golang.org/dl (but not anyone who builds from source via make.bash or all.bash).
Given that 1.15 is shipping a new linker, it's better to avoid misleading test failures, so skipping the test if oldlink binary isn't available seems like a good solution.
Change https://golang.org/cl/242604 mentions this issue: cmd/link: skip TestOldLink if the old linker does not exist
The binary was removed from releases in https://golang.org/cl/242643, but the commit message incorrectly failed to mention the repository to reference this issue.