Allows compilation of code using debug.BuildInfo and show correct tinygo version#4343
Allows compilation of code using debug.BuildInfo and show correct tinygo version#4343deadprogram merged 4 commits intotinygo-org:devfrom
Conversation
src/runtime/debug/debug.go
Outdated
| // | ||
| // Not implemented. | ||
| func (bi *BuildInfo) String() string { | ||
| return "<build info placeholder>\n" |
There was a problem hiding this comment.
given everything else is empty in the struct, what would that do?
could we just import the real code from big go?
There was a problem hiding this comment.
"else"? It's not printing anything at all. It could at least return "go. " + GoVersion, couldn't it?
There was a problem hiding this comment.
ic the first line sure, I didn't notice because when I use buildinfo I print the GoVersion separately let me add something
btw should it be
go tinygo0.33.1
or
tinygo tinygo0.33.1
There was a problem hiding this comment.
doing the former, copying the code
There was a problem hiding this comment.
@dkegel-fastly so I copied the real code but... it's ugly... what is the general philosophy/must not be the first time tinygo is just a small variant of an existing go file, can you import+patch or some other way to avoid copy pasta (this is more for my education than anything specific for this PR - hopefully it's ok now with 41dd04a )
|
output comparison (through fortio.org/version) - edited for latest commit: |
src/runtime/debug/debug.go
Outdated
| @@ -1,6 +1,13 @@ | |||
| // Package debug is a dummy package that is not yet implemented. | |||
There was a problem hiding this comment.
Should this comment be removed?
There was a problem hiding this comment.
it's still kinda dummy - I was wondering about the comment
// Not implemented.
func ReadBuildInfo() and figured to leave it as it's... only giving an empty one (no modules, no settings etc) except for GoVersion
|
I see the approvals, thanks, would one of you merge, I can't (wouldn't anyway) |
| return n | ||
| } | ||
|
|
||
| // Start of stolen from big go. TODO: import/reuse without copy pasta. |
There was a problem hiding this comment.
I do believe a copyright notice should be copied here...?
There was a problem hiding this comment.
isn’t this covered by https://github.com/tinygo-org/tinygo/blob/release/LICENSE#L3 ?
There was a problem hiding this comment.
I think the copyright folks like to have a greppable marker in each file.
I like the way runtime/timer.go does it: copy the three top llines from the file you're copying, and change "Copyright" to "Portions copyright".
There was a problem hiding this comment.
Thanks, I was looking for an example, thanks for mentioning src/runtime/timer.go
Done
|
|
|
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) |
|
ping |
|
@ldemailly please rebase against the latest |
|
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. |
That let's me build a 245k tinygo target grol-io/grol#37
(also needed some change in fortio.org/log)
Many thanks to @ydnar and @dankegel for their help and guidance.