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

fix some issues with --backend #14363

Merged
merged 4 commits into from
May 16, 2020

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented May 16, 2020

before this PR, commands like nim doc -b:cpp didn't work when the backend (eg cpp) required adjustments (such as conf.exc = excCpp), as was noticed in #14349)

this PR fixes that and other issues with --backend:

nim $cmd --backend:$backend now works reliably by splitting the backend handling logic into customizeForBackend (called for all commands) vs compileToBackend (only called for commands that compile to a backend);

  • fix nim c -b:cpp main doesn't work timotheecour/Nim#175: --backend can safely override previous options so that for eg nim c -b:cpp main and nim c -b:js -b:cpp main end with with cpp backend selected, and so that defined(c) and defined(js) would be false (no-side-effect rule)

parsing the flag --backend has by design zero side effect beyond setting conf.backend, so that it can be overridden in subsequent flags and plays well with other commands

see tests

CI failure unrelated (#13166) re-ran

@timotheecour timotheecour force-pushed the pr_fix_nim_check_backend branch 2 times, most recently from 97aeeda to 0697d9b Compare May 16, 2020 08:29
@timotheecour timotheecour force-pushed the pr_fix_nim_check_backend branch from 0697d9b to e274f58 Compare May 16, 2020 08:54
@timotheecour timotheecour marked this pull request as ready for review May 16, 2020 10:47
@timotheecour timotheecour requested a review from Araq May 16, 2020 10:47
@Araq Araq merged commit c777f2f into nim-lang:devel May 16, 2020
@timotheecour timotheecour deleted the pr_fix_nim_check_backend branch May 16, 2020 11:12
EchoPouet pushed a commit to EchoPouet/Nim that referenced this pull request Jun 13, 2020
* fix some issues with --backend
* fix timotheecour#175; improve upon nim-lang#14306
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

Successfully merging this pull request may close these issues.

nim c -b:cpp main doesn't work
2 participants