dom96 / choosenim

Tool for easily installing and managing multiple versions of the Nim programming language.
BSD 3-Clause "New" or "Revised" License
681 stars 64 forks source link

Linux build, windows init.sh fixes #238

Closed genotrance closed 4 years ago

genotrance commented 4 years ago
genotrance commented 4 years ago

@dom96 - PTAL

cc @alaviss

genotrance commented 4 years ago

Still some issues, hold off on merge.

genotrance commented 4 years ago

This is ready to go - please review and merge.

genotrance commented 4 years ago

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

dom96 commented 4 years ago

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.

when defined(staticBuild):
  putEnv("CC", "musl-gcc")
  switch("gcc.exe", "musl-gcc")
  switch("gcc.linkerexe", "musl-gcc")
  when not defined(OSX):
    switch("passL", "-static")
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.)

genotrance commented 4 years ago

@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.