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

add $nim to path, controlled by define #96

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Conversation

metagn
Copy link
Contributor

@metagn metagn commented Oct 8, 2024

$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 define nifCompilerInPath. This would be defined when bootstrapping the Nim compiler, with the condition that when cloning nif to use in the compiler, we add a config file inside the cloned nif directory that adds the compiler codebase to the path (i.e. if nif is cloned into dist, we add a config file in dist/nif that has --path:"../..").

This might pollute the import namespace though, or there might be other issues with $nim being in the search path.

@Araq Araq merged commit c2ebddd into nim-lang:master Oct 8, 2024
3 checks passed
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.

2 participants