techknowlogick / xgo

Go CGO cross compiler
MIT License
478 stars 79 forks source link

Split out base and toolchain and ensure CI tests the current PR #194

Closed zeripath closed 1 year ago

zeripath commented 1 year ago

This PR substantially restructures the xgo dockers creating a separate toolchain container, go-version container and then a merged container with the build.sh and xgo. This should in future allow for more caching and allows pr test cases to avoid rebuilding the whole toolchain.

In doing this I've noticed and fixed a number of bugs:

  1. Yet another bug relating to remote paths that would cause a #181 and #109
  2. The default naming for "packages" on module builds is incorrect and unhelpful. (#174) The default name will now be: modulename/pack-...
  3. Use mkdir -p /deps instead of /deps to permit reuse of the /deps dir

Fix #174 Fix #181 Fix #164 Fix #109

Signed-off-by: Andrew Thornton art27@cantab.net

zeripath commented 1 year ago

Hopefully this might actually work in 0f2e6ff

I've noticed another bug whilst working on this - I can extract out the fix if preferred.

zeripath commented 1 year ago

@techknowlogick would you be able to take a look at this?

I've split base into a toolchain container containing the compilers. This toolchain is then used as the base for a bootstrapped go container which is finally then used to add xgo and the build.sh

The test.yml has been extensively rewritten to ensure that the tests are run on the built container but it attempts to cache the toolchain docker if it's docker directory is unchanged.

In doing this and running the tests I've noticed another bug and have also fixed that.

zeripath commented 1 year ago

OK I'm convinced that this is now working and is a substantial improvement on the previous situation and fixes a number of issues therefore I'm gonna merge.