WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: If and how to split 'go' (the programming language) in separate extensions  (Read 869 times)

Offline rhermsen

  • Jr. Member
  • **
  • Posts: 99

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: [Select]
$ 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?

To get this binary (to obtaint the same as above):
Code: [Select]
wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
tar xzf go1.22.2.src.tar.gz

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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10992
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.
The only barriers that can stop you are the ones you create yourself.

Offline rhermsen

  • Jr. Member
  • **
  • Posts: 99
Thanks for clarifying -dev should not be used.

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

Code: [Select]
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)

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