Just re-ran this (2 years later) with: go version go1.21.1 linux/amd64 Ubuntu 22.04.3 LTS
and there is a new limit that is unhappy: too much data, last section SXCOFFTOC (2097170064, over 2e+09 bytes) too much data, last section SDATA (2097170064, over 2e+09 bytes) * too much data, last section SCOVERAGE_COUNTER (2097373648, over 2e+09 bytes)* (Which makes sense). https://pkg.go.dev/runtime/coverage https://github.com/golang/go/blob/master/src/cmd/link/internal/ld/data.go Glen On Monday, September 20, 2021 at 8:29:30 PM UTC-4 Glen Newton wrote: > Hello, > > Thanks for this, and also sorry for the lazy question. > > My testing on my machine indicates a limit of 2GB total limit on compile: > > too much data in section SXCOFFTOC (over 2e+09 bytes) > too much data in section SDATA (over 2e+09 bytes) > > I have built a bash script that creates large random files of a fixed size > and then generates a short Go program that embeds them, increasing the > number of files with each run, so you can see when your compile fails. > You can find the bash and instructions here: > https://github.com/gnewton/test_go_embed > > I just threw it together, so might be a little rough around the edges. > Feedback welcome. > > Question: Wondering why the above error complains about too much data in > *two* sections: are the embedded files stored across multiple sections (I > know nothing of how this is done internally to the elf format)? > > Thanks, > Glen > > On Monday, September 20, 2021 at 5:11:45 PM UTC-4 Ian Lance Taylor wrote: > >> On Mon, Sep 20, 2021 at 2:04 PM Glen Newton <glen....@gmail.com> wrote: >> > >> > I am testing this with an increasing number of 1GB files. At 3 files, >> and I am getting this error: >> > >> > compile: writing output: write $WORK/b001/_pkg_.a: no space left on >> device >> > >> > I haven't been able to find how to change $WORK to point to a larger >> partition. Suggestions? >> >> Set the TMPDIR environment variable to control temporary files in >> general, or the GOTMPDIR environment variable to control just >> temporary files created by the go tool. >> >> Ian >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/28cad6f3-7f37-4b65-9004-00e5c8229f41n%40googlegroups.com.