You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running compiler specs, we want them to pick up the standard library at the source location that goes alongside it.
Specs often run with `bin/crystal spec` where the wrapper already assigns `CRYSTAL_PATH` appropriately. But when executing a spec binary independently, this environment variable is missing.
We used to explicitly set the `CRYSTAL_PATH` env var, but we want to remove `ENV` mutations (cf. #16449).
For the actual value, `Crystal::PATH` could also be an option instead of `"#{__DIR__}/../src"`. The result is equivalent, but maybe it's a bit more clear that we're baking the compiler's path. `Crystal::PATH` includes `./lib` though, which we don't really need here. It probably doesn't do any harm, but it shouldn't be there. So we could consider removing it, but then I'm not sure it's worth it over `"#{__DIR__}/../src"`.
Copy file name to clipboardExpand all lines: spec/spec_helper.cr
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{% raise("Please use `make test` or `bin/crystal` when running specs, or set the i_know_what_im_doing flag if you know what you're doing") unless env("CRYSTAL_HAS_WRAPPER") || flag?("i_know_what_im_doing") %}
0 commit comments