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

feat(freebsd): add support for freebsd #5340

Closed
wants to merge 8 commits into from
Closed

feat(freebsd): add support for freebsd #5340

wants to merge 8 commits into from

Conversation

ghuntley
Copy link
Contributor

@ghuntley ghuntley commented Dec 7, 2022

Coder fails to build [1] on FreeBSD:

transport_unix.go:52:10: cannot use t (variable of type *unixTransport) as type transport in return statement:
        *unixTransport does not implement transport (missing SendNullByte method)

Update godbus dependency to latest, post upstream PR #332 [2] via #237

Fixes: #4516

[1] #4516
[2] godbus/dbus#332
[3] godbus/dbus#237
coder currently wants GNU getopt for reasons:

  # BSD getopt (which is installed by default on Macs) is not supported.

Although getopt is notoriously non-portable and behaviour differs across
implementations and operating systems, in leui of a discussion
to remove this specific implementation requirement...

Add a GETOPT environment variable in lib.sh and build_go.sh to allow
specifying getopt location, leaving the current value 'getopt' as the
default.
Some operating systems and user environments may have or allow for
installation of multiple go versions. In the cases where these environments
are not isolated (jails, containers, etc), a `go` command, either by way of
symlink pointing to a desired go installation or default version, may not
exist, be installed, or may change targets over time.

As an example, FreeBSD Ports & Packages allows the concurrent installation
of multiple golang versions, with go commands being suffixed with a version
string (eg: go119).

In order to deterministiscally build packages on these systems, particularly
in the case of "official" packaging systems @ downstreams, it is necessary
to be able to explicitly specify what language versions is used, rather
than have them be autodetected, where PATH ordering can matter and interfere
or where the default binary name can change over time according to user
preference.

Accordingly, allow specifying `go` command location via a GOCMD environment
variable in build_go.sh.

See Also:

  golang/go#28043
I was in ports Makefile not bash mode.
`./scripts/build_go.sh --os freebsd` fails to build with the following
(unique) errors:

  termios/sgtty_unix.go:13:20: undefined: unix.TCGETS
  termios/termios.go:33:10: undefined: TTYIO
  termios/termios.go:39:9: undefined: MakeRaw
  termios/var_unix.go:42:38: undefined: syscall.IUTF8
  termios/var_unix.go:50:37: undefined: syscall.OFILL
  termios/var_unix.go:51:37: undefined: syscall.OFDEL

This was resolved upstream in u-root/u-root/pull/2544 [1]
via tailscale/tailscale/pull/6155 [2] in u-root/u-root/commit/18fd0ce36 [3]

Update termios (u-root) dependency to a commit just past that
change.

[1] u-root/u-root#2544
[2] tailscale/tailscale#6155
[3] u-root/u-root@18fd0ce36

Fixes: #4516
`./scripts/build_go.sh --os freebsd` fails to build with the following
(unique) errors:

  cli/schedule.go:223:19: undefined: tz.TimezoneIANA
  cli/util.go:116:17: undefined: tz.TimezoneIANA

coderd/util/tz currently contains per-OS implementions (one file per supported
OS), but is missing a tz_freebsd.go.

Follow the existing pattern by creating a tz_freebsd.go from tz_linux.go.

FreeBSD supports standard IANA zoneinfo (and /etc/localtime), so no other
changes are required.

Fixes: #4516
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@koobs
Copy link

koobs commented Dec 7, 2022

I have read the CLA Document and I hereby sign the CLA

@koobs
Copy link

koobs commented Dec 7, 2022

@ghuntley Looks like u-root/u-root@v0.9.1-0.20221104004445-18fd0ce36891/pkg/termios/var_darwin.go:37:28: undefined: syscall is:

Please update termios dependency to that commit or later, which should address the failure.

@github-actions
Copy link

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 16, 2022
@koobs
Copy link

koobs commented Dec 16, 2022

sudo un-stale

@github-actions github-actions bot removed the stale This issue is like stale bread. label Dec 17, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Jan 6, 2023
@github-actions github-actions bot closed this Jan 25, 2023
@koobs
Copy link

koobs commented Jan 25, 2023

@ghuntley unstale, anything else you need from me to merge PR?

@github-actions github-actions bot deleted the gh/freebsd branch June 9, 2023 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants