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

"%NIM%/config/nim.cfg" is not being read #9244

Closed
rivy opened this Issue Oct 7, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@rivy
Copy link

rivy commented Oct 7, 2018

nim compile ... is not reading the configuration file at "%NIM%/config/nim.cfg" (as it should be per the documentation).

C:>ver
Microsoft Windows [Version 10.0.17134.320]

C:>nim --version
Nim Compiler Version 0.19.0 [Windows: amd64]
Compiled at 2018-09-26
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: f6c5c636bb1a1f4e1301ae0ba5a8afecef439132
active boot switches: -d:release
@Araq

This comment has been minimized.

Copy link
Member

Araq commented Oct 9, 2018

Works for me, %NIM% here means Nim's installation directory.

@Araq Araq closed this Oct 9, 2018

@rivy

This comment has been minimized.

Copy link

rivy commented Oct 9, 2018

@Araq, thanks for the reply.

When defined as "the nim installation directory", yes, it finds a "nim.cfg" file.

But that's not what "%NIM%/config/nim.cfg" means on windows. By defining it as "%NIM%/config/nim.cfg" (similar to "%APPDATA%/nim/nim.cfg" a bit later), the documentation is saying that the NIM environment variable controls where the nim.cfg files is located. But %NIM% is not used at all.

If you want to leave it as is, the documentation needs to be altered to point out the truth (eg, change it to something like "<NIM_INSTALL_ROOT>/nim/nim.cfg", or, my personal preference, actually implement the use of the NIM environment variable to allow flexibility in placing the system config file within the file system (defaulting to "NIM_INSTALL_ROOT" if NIM is null/missing).

@Araq Araq added the Documentation label Oct 9, 2018

@Araq Araq reopened this Oct 9, 2018

@Araq

This comment has been minimized.

Copy link
Member

Araq commented Oct 9, 2018

This idea of allowing for a flexible "directory hierarchy" only to patch it via flat environment variables that lack this hierarchy (because it never works!) isn't what Nim uses.

@rivy

This comment has been minimized.

Copy link

rivy commented Oct 11, 2018

I'm not sure what you mean by that... if you mean that you don't think environment variables are a good way of directing program access, I disagree. The community widely and successfully uses the XDG Base Directory specification and, in fact, you're using it here. In fact, IMO, you're being overly restrictive here by limiting it only to *nix platforms; I think it should be used regardless of platform to allow windows users access to the ability to define where they want their files to be placed and read.

But, in this case, if you don't want to implement the %NIM% indirection, just updating the documentation to say what is really going on would be fine.

@Araq Araq closed this in b340f67 Oct 16, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Oct 31, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

fixes #9244
(cherry picked from commit b340f67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment