tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.25k stars 900 forks source link

Allows compilation of code using debug.BuildInfo and show correct tinygo version #4343

Closed ldemailly closed 2 months ago

ldemailly commented 2 months ago

That let's me build a 245k tinygo target https://github.com/grol-io/grol/pull/37 (also needed some change in fortio.org/log)

Many thanks to @ydnar and @dankegel for their help and guidance.

ldemailly commented 2 months ago

output comparison (through fortio.org/version) - edited for latest commit:

$ ./grol.tiny buildinfo
dev  tinygo0.33.0-dev arm64 darwin
go  tinygo0.33.0-dev
$ ./grol buildinfo
dev  go1.22.5 arm64 darwin
go  go1.22.5
path    grol.io/grol
mod grol.io/grol    (devel) 
dep fortio.org/cli  v1.7.0  h1:w+uXZLGi4t3Vn/BvbeMuSw84Z1pvNPG9HqeGfpP68cc=
dep fortio.org/log  v1.15.0-pre4    h1:jAr6cn7AHhKBBdD6M2WlCqNWnePyCMp9A6++o0Zl0jY=
dep fortio.org/struct2env   v0.4.1  h1:rJludAMO5eBvpWplWEQNqoVDFZr4RWMQX7RUapgZyc0=
dep fortio.org/version  v1.0.4  h1:FWUMpJ+hVTNc4RhvvOJzb0xesrlRmG/a+D6bjbQ4+5U=
dep github.com/kortschak/goroutine  v1.1.2  h1:lhllcCuERxMIK5cYr8yohZZScL1na+JM5JYPRclWjck=
build   -buildmode=exe
build   -compiler=gc
build   -tags=no_net,no_json
build   -trimpath=true
build   CGO_ENABLED=0
build   GOARCH=arm64
build   GOOS=darwin
build   vcs=git
build   vcs.revision=9396c9b051e054a7783f75195aac0084f20911d2
build   vcs.time=2024-07-16T07:02:48Z
build   vcs.modified=true
ldemailly commented 2 months ago

I see the approvals, thanks, would one of you merge, I can't (wouldn't anyway)

ldemailly commented 2 months ago

hmm I messed up my fork trying to start a new PR earlier (about TLS) let me fix this (hopefully) fixed PTAL

ldemailly commented 2 months ago

The previous build https://github.com/tinygo-org/tinygo/actions/runs/9977696304 of size difference, before llvm18 got broken, passed, so can we merge this ? (only difference is the comment at the top of the file, since that build)

ldemailly commented 2 months ago

ping

deadprogram commented 2 months ago

@ldemailly please rebase against the latest dev and this PR should pass CI now.

deadprogram commented 2 months ago

Actually, I can just squash/merge this now, I think.

Thank you very much @ldemailly for working on this and to @ydnar and @dkegel-fastly for guidance and reviews.