Re: Failing devel/esbuild after go update?

Chris Torek <[email protected]> Mon, 22 Jun 2026 04:27:41 -0700
Newsgroups gmane.os.freebsd.devel.ports
Message-ID <CAPx1GvcMcHBh4JL8sp99jY2TqEP7D2+-uiVAjnfhqdNR-maM0g@mail.gmail.com>
...
> ===>  Building esbuild from ./cmd/esbuild
> internal/fs/modkey_unix.go:9:2: cannot find module providing package golang.org/x/sys/unix: import lookup disabled by -mod=vendor
> *** Error code 1
>
> Stop.
> make: stopped making "all" in /usr/ports/devel/esbuild
>
> Is anyone else not seeing this? If not, how can I get a usable copy of golang/x/sys/unix?

This should "just work" (but see below). I tested it with
"synth build devel/esbuild" on my (16-current) system and it
did in fact build fine, using Go 1.25.11.

Here's the relevant fetch phase output:

--------------------------------------------------------------------------------
--  Phase: fetch
--------------------------------------------------------------------------------
===>  License MIT accepted by the user
=> v0.28.0.mod doesn't seem to exist in
/distfiles/go/devel_esbuild/esbuild-v0.28.0.
=> Attempting to fetch
https://proxy.golang.org/github.com/evanw/esbuild/@v/v0.28.0.mod
v0.28.0.mod                                            428  B 4910 kBps    00s
=> v0.28.0.zip doesn't seem to exist in
/distfiles/go/devel_esbuild/esbuild-v0.28.0.
=> Attempting to fetch
https://proxy.golang.org/github.com/evanw/esbuild/@v/v0.28.0.zip
v0.28.0.zip                                           2101 kB 9314 kBps    01s
===> Fetching all distfiles required by esbuild-0.28.0_2 for building
===> Fetching github.com/evanw/esbuild dependencies
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20220715151400-c0bba94af5f8.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20220715151400-c0bba94af5f8.mod:
200 OK (0.196s)
# get https://proxy.golang.org/sumdb/sum.golang.org/supported
# get https://proxy.golang.org/sumdb/sum.golang.org/supported: 404 Not
Found (0.027s)
# get https://sum.golang.org/lookup/golang.org/x/[email protected]
# get https://sum.golang.org/lookup/golang.org/x/[email protected]:
200 OK (0.350s)

Note that at this point Go will have the appropriate
golang.org/x/sys/unix files.

I've seen this kind of behavior before with bad cached distfiles. If you
look at /usr/ports/distfiles/go/devel_esbuild/ you'll find them; removing
all of them is no doubt overkill but will almost certainly fix your build.

I think what this means is that the Uses/go.mk rules aren't quite
right, that they need to clean up old (wrong version of Go) modules
that got cached via `-mod=vendor`. Coming up with a fix is a little
beyond what I have time for right now though, as there are all those
little complexities with these Mk/Uses/ files.

(Running `make gomod-clean` should also remove the
stale modules, except you might have to get synth to do
that in the special build environment.)

Chris