Tiny Core Extensions > TCE Q&A Forum

If and how to split 'go' (the programming language) in separate extensions

(1/1)

rhermsen:
Hello,

For go (the programming language) I would like to update the extension to a current version.
I currently get a squashfs image of about 80MB.
I'm not familiar with Go, just try to compile something which requires a more recent version of Go.

Does someone have more insight in Go to advice on splitting the image into e.g. a main, dev and doc image?

Below the structure of a binary version (go-1.22.2) of Go with size info.
In the current extension for both x86 and x86_64 the complete content is added.


--- Code: ---$ du -sh *
4.0K    CONTRIBUTING.md  <=== leave out
4.0K    LICENSE          <=== main
4.0K    PATENTS          <=== leave out
4.0K    README.md        <=== leave out
4.0K    SECURITY.md      <=== leave out
4.0K    VERSION          <=== leave out
8.6M    api              <=== doc? or dev?
14.6M   bin              <=== main
4.0K    codereview.cfg   <=== leave out
572.0K  doc              <=== doc?
4.0K    go.env           <=== ?
408.0K  lib              <=== main?
164.0K  misc             <=== ?
84.4M   pkg              <=== ?
121.3M  src              <=== leave out or dev?
16.9M   test             <=== leave out or dev?

--- End code ---

To get this binary (to obtaint the same as above):
x86_64

--- Code: ---wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
tar xzf go1.22.2.src.tar.gz

--- End code ---


fyi, I'm waiting for the current maintainers for an ok to update the extension.

curaga:
Go does not have a runtime, it always compiles statically. So there is no -dev distinction, you only use it to compile - it won't be a runtime dep.

rhermsen:
Thanks for clarifying -dev should not be used.

I tried to compile without ./src directory, but than compile fails.


--- Code: ---pkg/cmd/root.go:12:2: package context is not in std (/tmp/tcloop/go/usr/local/src/context)
pkg/cmd/prompt.go:12:2: package errors is not in std (/tmp/tcloop/go/usr/local/src/errors)
pkg/cmd/prompt.go:13:2: package fmt is not in std (/tmp/tcloop/go/usr/local/src/fmt)
/home/tc/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/input.go:3:8: package bytes is not in std (/tmp/tcloop/go/usr/local/src/bytes)
..
..
..
<snip>
--- End code ---

So, it looks only a few files can be left out and a few to a -doc.

Navigation

[0] Message Index

Go to full version