add $nim to path, controlled by define #96
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
$nim
points to the root of the Nim that is compiling the project, so if we try to bootstrap the compiler with nif imported, nif will use the bootstrapping compiler's codebase instead and not the current compiler. There is also no option to set the value of$nim
, but even if we added one, we would need the bootstrapping compiler to have it as well, so we would need csources for a 2.2+ version of the compiler.So instead we add
$nim
to the path in config files for the subdirectories that use the compiler code, but we add the option to disable this with a definenifCompilerInPath
. This would be defined when bootstrapping the Nim compiler, with the condition that when cloningnif
to use in the compiler, we add a config file inside the clonednif
directory that adds the compiler codebase to the path (i.e. ifnif
is cloned intodist
, we add a config file indist/nif
that has--path:"../.."
).This might pollute the import namespace though, or there might be other issues with
$nim
being in the search path.