Ensure cache directory is an absolute path #468
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.
Closes #467. Forces an absolute path by calling
Path.absolute
.Tested by repeating the MREs from the aforementioned issue.
The early return of
return TemporaryDirectory()
a few lines above the diff in the first commit does not affect this,as
TemporaryDirectory
will always return an absolute pathname because it uses the same rules asmkdtemp
.Specifically, for Python 3.11 and lower,
mkdtemp
will always return an absolute path whendir
is None, and since Python 3.12, will always return an absolute pathname.NOTE: It appears that when using
env HOME=.
, a later call tonom-shell
after the packages have been built suffers from a similar issue.error: string './.config/nixpkgs/config.nix' doesn't represent an absolute path
.The call in question
I suspect that this issue lies outside of this codebase, as searches for
config.nix
don't yield any matches, and thenom-shell
CLI call does not reference such a path.I had initially suspected this line, but applying
.absolute()
does not yield any change in behaviour.A suspect would be this subprocess.run wrapper, as when env is None, the new subprocess will inherit the current process’ environment.