Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--skipProjCfg --skipParentCfg do not work when compiling koch from csources #8691

Open
mratsim opened this issue Aug 20, 2018 · 3 comments
Open

Comments

@mratsim
Copy link
Collaborator

mratsim commented Aug 20, 2018

The most straightforward way of solving #8676 Usability: {.experimental: “ForLoopMacros”.} is required at all macro callsites is to use --experimental:ForLoopMacros when compiling concerned projects.

To avoid having to add that everytime we can use either of:

  • nim.cfg
  • nimble tasks

nim.cfg allows all compilations to take the experimental flag into account while nimble is restricted to predefined task.

Unfortunately during Travis and Appveyor CI, the nim.cfg of the project is contaminating the compilation of koch as root folder is a clone of the project.

Neither --skipProjCfg or --skipParentCfg prevent this contamination: https://travis-ci.org/status-im/nim-stint/jobs/418268022#L328-L329

$ git clone --depth 1 https://github.com/nim-lang/csources.git
Cloning into 'csources'...
remote: Counting objects: 933, done.
remote: Compressing objects: 100% (312/312), done.
remote: Total 933 (delta 793), reused 644 (delta 620), pack-reused 0
Receiving objects: 100% (933/933), 3.84 MiB | 5.31 MiB/s, done.
Resolving deltas: 100% (793/793), done.
Checking out files: 100% (4940/4940), done.
$ cd csources
$ sh build.sh
...
$ cd ..
$ export PATH=$PWD/bin:$PATH
$ nim c koch --skipProjCfg --skipParentCfg
Hint: used config file '/Users/travis/build/status-im/nim-stint/nim/config/nim.cfg' [Conf]
/Users/travis/build/status-im/nim-stint/nim.cfg(1, 3) Error: invalid argument for command line option: '--experimental'
@mratsim
Copy link
Collaborator Author

mratsim commented Aug 20, 2018

After rewriting the compilation script to:

  - cd ..
  - bin\nim --skipProjCfg --skipParentCfg c koch # Don't use stint's nim.cfg to compile koch
  - koch boot --skipProjCfg --skipParentCfg -d:release
  - koch --skipProjCfg --skipParentCfg nimble

I don't have the experimental issue however a new error crops up:

main.nim(13, 10) Error: nimcore MUST be defined for Nim's core tooling
FAILURE
The command "./koch boot --skipProjCfg --skipParentCfg -d:release" failed and exited with 1 during.

https://travis-ci.org/status-im/nim-stint/jobs/418298954#L457-L461

@Araq
Copy link
Member

Araq commented Aug 21, 2018

I'm not sure what you're messing around with, but put this into your nim.cfg:

@if nimHasForLoopMacros:
--experimental: forLoopMacros
@end

@mratsim
Copy link
Collaborator Author

mratsim commented Aug 31, 2018

I just tried the nim.cfg config, that doesn't work :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants