Closed genotrance closed 4 years ago
@dom96 - PTAL
cc @alaviss
Still some issues, hold off on merge.
This is ready to go - please review and merge.
All such flags can be specified on the command line with - -passL, either with Nim or nimble. Why an extra flag?
-d:skipBuild was added to avoid building with the wrong flags or local testing.
If you have better ideas for this, please suggest specifics. This took several hours of time to get right, it's not a two minute change. I also tested this with my travister matrix which tests normal builds that users would do locally.
https://travis-ci.org/github/genotrance/travister/builds/738344603
All such flags can be specified on the command line with - -passL, either with Nim or nimble. Why an extra flag?
Because if I then want to locally create a static build then I need to copy and paste the flags manually from the CI scripts...
If you have better ideas for this, please suggest specifics. This took several hours of time to get right, it's not a two minute change. I also tested this with my travister matrix which tests normal builds that users would do locally.
proxyexe.nims
file in choosenimpkg
:when defined(staticBuild):
putEnv("CC", "musl-gcc")
switch("gcc.exe", "musl-gcc")
switch("gcc.linkerexe", "musl-gcc")
when not defined(OSX):
switch("passL", "-static")
In choosenim.nims
: import "choosenimpkg/proxyexe.nims"
(I'm not sure if this works, but AFAIK that is the point of .nims, so it would be pretty ridiculous if there wasn't a way to do it, maybe you need to wrap that stuff in a proc and call it from both the proxyexe.nims
and the choosenim.nims
)
In CI just pass the -d:staticBuild
flag
In switcher.nim:
when defined(staticBuild):
cmd.add("-d:staticBuild")
(As an aside, I'm not sure where the new flags you've added for Linux/Windows belong (-lpthread/-lws2_32). If they're also related to staticBuild then they should go under that when
otherwise they can stay in the .nims. Please do explain what they're for though.)
@dom96 - PTAL - ready to go.
Also, please migrate from travis-ci.org to travis-ci.com so that build times improve. Should take 5 minutes to migrate your repos over.