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

Make sure that nimble.paths is checked relative to config.nims #1063

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1857,17 +1857,17 @@ proc setupNimbleConfig(options: Options) =
configFileVersion = 2
sectionEnd = "# end Nimble config"
sectionStart = "# begin Nimble config"
configFileHeader = &"# begin Nimble config (version {configFileVersion})\n"
configFileHeader = &"# begin Nimble config (version {configFileVersion})"
configFileContentNoLock = fmt"""
{configFileHeader}
when system.fileExists("{nimblePathsFileName}"):
when withDir(thisDir(), system.fileExists("{nimblePathsFileName}")):
include "{nimblePathsFileName}"
{sectionEnd}
"""
configFileContentWithLock = fmt"""
{configFileHeader}
--noNimblePath
Copy link
Member

@zah zah Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've previously agreed that --noNimblePath should be conditional on the presence of a lockfile through a check in the config file itself.

I understand that different snippets are inserted depending on the presence of a lockfile during the execution of nimble setup, but is the snippet updated when the lockfile is created with nimble lock? The approach seems slightly more risky and fragile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for using lock file is that you can write the following...

nimble --lock-file=differentLockFileName.lock setup

... and it will still do the right thing. I don't have a strong preference for the approach here - both seem to be good enough.

when system.fileExists("{nimblePathsFileName}"):
when withDir(thisDir(), system.fileExists("{nimblePathsFileName}")):
include "{nimblePathsFileName}"
{sectionEnd}
"""
Expand Down