Build packages for distribution using xgo
#32
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This follows a suggestion from @flowrean in #18 to use
xgo
for cross-compiling thegocsv
binary for distribution.In general this works well and should allow the
sql
subcommand (which depends on the go-sqlite3 package) to work on other platforms and architectures. It also provides more platforms and architectures than the whitelisted set previously provided.I have only tested the Mac binary (
darwin
andamd64
) on my local machine and the Linux binary (linux
andamd64
) on thealpine:3.12.0
andubuntu:12.04
Docker images.On my Mac, everything works with the
xgo
compiled version ofgocsv
.With Linux, all subcommands now work on the
ubuntu
image, includingsql
which previously did not work. However, there is a regression in that thexgo
-builtgocsv
does not work at all onalpine
, whereas previously all subcommands except thesql
subcommand worked.The issue I ran into with
alpine
was (afterdocker cp
-ing a CSV and the cross-compiledgocsv
binary into an interactive terminal in thealpine
container):This may be a duplicate of karalabe/xgo#183 (i.e.
xgo
may not supportalpine
). Regardless, I'm not too worried about it. I doubt people will be usinggocsv
in a container based onalpine
, and if they are they can compile it themselves IMO.I have not tested the Windows binaries, which would be helpful to determine if this can close the issue #18.
Here are the zip files that it now creates via
xgo
, which I'm fine with publishing in the release(s):