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

Default compiler flags (or cli options) #7805

Closed
bcardiff opened this issue May 21, 2019 · 3 comments · Fixed by #7837
Closed

Default compiler flags (or cli options) #7805

bcardiff opened this issue May 21, 2019 · 3 comments · Fixed by #7837

Comments

@bcardiff
Copy link
Member

I would like to be able to run the compiler specs against some specific flags.
This would help to test some opt-in features behind flags (overflow, mt, etc).

  1. I would like to agree on the scope:
    1.a) This change could be either be scoped only the compiler_specs (changing https://github.com/crystal-lang/crystal/blob/0.28.0/spec/spec_helper.cr#L160) or,
    1.b) to the whole compiler (changing https://github.com/crystal-lang/crystal/blob/0.28.0/src/compiler/crystal/compiler.cr#L198).

  2. I would like to agree on the interface
    2.a) Use an env variable like CRYSTAL_COMPILER_FLAGS that will contain a space separated list of flags to be used.
    2.b) Use an env variable to mimic any CLI option of the compiler via an env variable like CRYSTAL_COMPILER_OPTS. The implementation will need to parse them (instead of just split spaces).

I would be happy with 1.b + 2.a.

@asterite
Copy link
Member

Does this need to be in the compiler or in the spec suite? You can probably do bin/crystal spec spec/compiler_spec.cr -Dflag1 -Dflag2, right? And that can be simplified/manipulated in a Makefile, I think.

@bcardiff
Copy link
Member Author

I want to inject the flags in the Crystal::Compiler instances that are created in the compiler_specs. Your snippet will affect the compiled suite, but not each test.

@asterite
Copy link
Member

Oooh... I see.

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 a pull request may close this issue.

2 participants