Skip to content
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

build_dist.sh not working on OpenBSD #8156

Closed
garrett-ts opened this issue May 17, 2023 · 1 comment · Fixed by #8271
Closed

build_dist.sh not working on OpenBSD #8156

garrett-ts opened this issue May 17, 2023 · 1 comment · Fixed by #8271
Labels

Comments

@garrett-ts
Copy link

garrett-ts commented May 17, 2023

What is the issue?

Raising this issue on behalf of a user who reached out in this ticket: HS #13216

Not sure how to report and send this fix on Github, I'm sending this email.

The build_dist.sh script execs ./tools/go instead of $go on line 52, this breaks it on OpenBSD 7.3 (stable).

To make build_dist.sh work, I changed the following (git diff in Full log):

-exec ./tool/go build ${tags:+-tags=$tags} -ldflags "$ldflags" "$@"
+exec $go build ${tags:+-tags=$tags} -ldflags "$ldflags" "$@"

Based on line 14-17 I think this line shoud be with $go.

Full log:

gravitas$ uname -a
OpenBSD gravitas.openbsd.amsterdam 7.3 GENERIC#1072 amd64
gravitas$ pkg_info go
Information for inst:go-1.20.1

Comment:
Go programming language

Description:
The Go programming language is an open source project to make
programmers more productive. Go is expressive, concise, clean, and
efficient. Its concurrency mechanisms make it easy to write programs
that get the most out of multicore and networked machines, while its
novel type system enables flexible and modular program construction. Go
compiles quickly to machine code yet has the convenience of garbage
collection and the power of run-time reflection. It's a fast, statically
typed, compiled language that feels like a dynamically typed,
interpreted language.

Maintainer: Joel Sing jsing@openbsd.org

WWW: https://golang.org/

gravitas$
gravitas$ git clone --branch v1.40.0 --single-branch https://github.com/tailscale/tailscale.git
gravitas$ cd tailscale
gravitas$ ./build_dist.sh tailscale.com/cmd/tailscale
go: downloading go4.org/mem v0.0.0-20210711025021-927187094b94
go: downloading github.com/google/uuid v1.3.0
go: downloading golang.org/x/mod v0.9.0
go: downloading golang.org/x/crypto v0.6.0
go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: downloading golang.org/x/sys v0.6.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 9 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
gravitas$ ls -al tailscale*
ls: tailscale*: No such file or directory
gravitas$ git diff build_dist.sh
diff --git a/build_dist.sh b/build_dist.sh
index 8a77bf8a..a5b0b163 100755
--- a/build_dist.sh
+++ b/build_dist.sh
@@ -49,4 +49,4 @@ while [ "$#" -gt 1 ]; do
esac
done

-exec ./tool/go build ${tags:+-tags=$tags} -ldflags "$ldflags" "$@"
+exec $go build ${tags:+-tags=$tags} -ldflags "$ldflags" "$@"
gravitas$ ./build_dist.sh tailscale.com/cmd/tailscale
go: downloading go4.org/mem v0.0.0-20210711025021-927187094b94
go: downloading github.com/google/uuid v1.3.0
go: downloading golang.org/x/mod v0.9.0
go: downloading golang.org/x/crypto v0.6.0
go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: downloading golang.org/x/sys v0.6.0
go: downloading github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading github.com/mattn/go-isatty v0.0.17
go: downloading github.com/peterbourgon/ff/v3 v3.1.2
go: downloading github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
go: downloading github.com/toqueteos/webbrowser v1.2.0
go: downloading golang.org/x/net v0.8.0
go: downloading golang.org/x/oauth2 v0.5.0
go: downloading golang.org/x/time v0.0.0-20220609170525-579cf78fd858
go: downloading k8s.io/client-go v0.25.0
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading software.sslmate.com/src/go-pkcs12 v0.2.0
go: downloading golang.org/x/text v0.8.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading nhooyr.io/websocket v1.8.7
go: downloading github.com/tcnksm/go-httpstat v0.2.0
go: downloading github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05
go: downloading github.com/fxamacker/cbor/v2 v2.4.0
go: downloading github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3
go: downloading github.com/klauspost/compress v1.15.4
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading github.com/x448/float16 v0.8.4
go: downloading filippo.io/edwards25519 v1.0.0-rc.1
go: downloading go4.org/netipx v0.0.0-20220725152314-7e7bdc8411bf
go: downloading golang.org/x/sync v0.1.0
gravitas$ ls -al tailscale*
-rwxr-xr-x 1 bram bram 15563132 May 8 23:24 tailscale
gravitas$ chmod a+x tailscale
gravitas$ ./tailscale version
1.40.0
tailscale commit: 9bdaece3d7c3c83aae01e0736ba54e833f4aea51-dirty
go version: go1.20.1

Steps to reproduce

No response

Are there any recent changes that introduced the issue?

No response

OS

Linux

OS version

OpenBSD 7.3

Tailscale version

1.40.0

Other software

No response

Bug report

No response

@DentonGentry
Copy link
Contributor

I don't understand why they didn't send a pull request.

@DentonGentry DentonGentry added L1 Very few Likelihood P2 Aggravating Priority level T5 Usability Issue type and removed needs-triage labels Jun 4, 2023
DentonGentry added a commit that referenced this issue Jun 4, 2023
The invocation at the end unconditionally used
./tool/go, but the structuring on lines 14-17
sets up to use a different toolchain if the
platform requires it.

Fixes #8156

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
DentonGentry added a commit that referenced this issue Jun 5, 2023
The invocation at the end unconditionally used
./tool/go, but the structuring on lines 14-17
sets up to use a different toolchain if the
platform requires it.

Fixes #8156

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants