Repository navigation
Conversation
`processPath` and `processCfgPath` skipped prepending the base directory when the path contained `$`, because `$nim`, `$lib`, `$config` etc. expand to absolute paths. `$projectName` does not, so `--nimcache:build/nimcache/$projectName` stayed relative while `--nimcache:build/nimcache/foo` became absolute. The base directory is now prepended after the substitution when the result is still relative.
Member
|
Implementation is too messy, probably improves a lot with a helper proc. |
Contributor
Author
|
Moved the shared logic into a |
Member
|
Sorry but I'm still not happy. Instead put the logic into |
…paths against a base
…cessCfgPath into the pathSubs variant
Contributor
Author
|
Moved the logic into a |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #26296
processPathandprocessCfgPathdo not prepend the base directory when the path contains$, because most variables ($nim,$lib,$home,$config,$projectdir,$nimcache) expand to absolute paths.$projectNameexpands to a bare name, soleft
querySetting(nimcacheDir)andquerySetting(outDir)relative (build/nimcache/repro), while the same paths written without$became absolute. In a config NimScript the same switch already comes back absolute, becausepathRelativeToConfigprepends the config dir beforeprocessPathruns.Fix: substitute first, and if the original path contained
$and the result is still relative, prepend the same base directory a path without$would get (the current directory for--nimcache/--outdir/--out, the project path for--path, the config file's directory inprocessCfgPath). Paths without$, and$paths that expand to an absolute path, are handled as before.Test: a new block in
tests/misc/trunner.nimrunsnim checkwith relative--nimcache/--outdircontaining$projectNameand checks thatquerySettingreturns absolute paths (tests/misc/m26296.nim).Verification, on macOS arm64:
./koch test run tests/misc/trunner.nimfails on the new assertion for bothcandcpp(the output isbuild/D26296/nimcache/m26296). After the fix, it passes for both../koch boot -d:releasereaches a fixed point../koch tests cfornewconfig,nimble,import_in_config,compileoption,compilerapi,misc: all pass excepttests/misc/tjoinable.nim, which assertsdefined(nimMegatest)and only passes inside megatest. Inmanylocandtools,nakefile,keineschweine(need thezippackage) andtnimgrep(needs a builtnimgrep) fail in my local setup for reasons unrelated to this change.