status-im / nim-stew

stew is collection of utilities, std library extensions and budding libraries that are frequently used at Status, but are too small to deserve their own git repository.
139 stars 18 forks source link

move `-d:nimRawSetjmp` to config.nim #118

Closed narimiran closed 1 month ago

narimiran commented 2 years ago

Refs https://github.com/status-im/nimbus-build-system/issues/44

Menduist commented 2 years ago

I've cancelled this run since it will fail on windows and our CI is slightly overloaded :)

narimiran commented 2 years ago

our CI is slightly overloaded

Ok, I'll delay pushing similar changes to other repos for tomorrow.

Menduist commented 2 years ago

Fixed upstream: https://github.com/nim-lang/Nim/pull/19899 But it will take a while, in the meantime if defined(windows) and not defined(vcc): With a comment to explain the workaround (this is only needed in this repo since we test with vcc)

arnetheduck commented 2 years ago

(this is only needed in this repo since we test with vcc)

I think better add "not vcc" in all repos - this is not something to research again

arnetheduck commented 2 years ago

per discussion in #nim-opportunities, let's use .cfg files for simple options

narimiran commented 2 years ago

per discussion in #nim-opportunities, let's use .cfg files for simple options

Ok, done. (And I'll make the same change in other repos too)

arnetheduck commented 2 years ago

So, this looks like it might need investigation on the nim side:

nim.cfg:

@if vcc
  -d:testit
@end

test.nim:

when defined(testit):
  {.error: "vcc in config".}
else:
  {.error: "vcc not in config".}
nim c --cc:vcc -c test.nim

this prints "vcc not in config" on my (linux) nim

narimiran commented 2 years ago

nim c --cc:vcc -r test.nim

It seems that --cc:... is not picked up at all! Because if I change the nim.cfg to @if gcc: ... it says Error: vcc in config regardless of what I pass to --cc.