Closed sogaiu closed 3 years ago
Should be fixed in 588485be0c834d39ade9a967f254f9ca3a373082
I tried with 588485be0c834d39ade9a967f254f9ca3a373082 and 996a59e28ff758de5b73822dafa8e343e9879958 but still get similar output.
Before trying I tried to remove jpm
via jpm uninstall
from a local source repository for jpm
and I checked the typical installation location here (C:\Users\user\AppData\Local\Apps\Janet\Library/jpm
and C:\Users\user\AppData\Local\Apps\Janet\bin
) to veritfy there the jpm-related files were not there.
I also verified after uninstalling jpm that invoking jpm
resulted in the mesage 'jpm' is not recognized as an internal or external command, operable program or bathc file.
I also checked after pulling the latest jpm and installing it that shutil.janet
had the changes in 588485be0c834d39ade9a967f254f9ca3a373082
There may still be pilot error here but if there is I haven't figured out what it is.
@bakpakin When I evaluate (os/environ)
via jpm debug-repl
, the resulting table has a key Path
, but not a key for PATH
. Perhaps that is to be expected.
When the merge-into
in shell
completes, the resulting table has both an entry with key Path
and an entry with key PATH
-- and the corresponding values differ.
I don't know what's going on with the subsequent os/execute
, but I get the error output mentioned originally.
As a test, I changed the PATH
key to Path
for the struct being merged in. This results in error-less output.
I have tried examining the keys in the table that os/environ
returns in different janet repl invocations and it appears that the key that ends up there can vary (i.e. sometimes it is Path
and sometimes it is PATH
).
Curiously, merging in a struct with both Path
and PATH
didn't seem to work here (same error message).
Checking the return value of os/environ
to see if Path
or PATH
is already present and using whichever key was there (or if neither was there, just using PATH
), seems to work:
(def os-env (os/environ))
(def path-key
(if (get os-env "Path")
"Path"
# "PATH" keys exists or neither "Path" nor "PATH" keys exist
"PATH"))
(def env (merge-into os-env {"JANET_PATH" (dyn:modpath)
path-key (patch-path (os/getenv "PATH"))}))
(I replaced: https://github.com/janet-lang/jpm/blob/996a59e28ff758de5b73822dafa8e343e9879958/jpm/shutil.janet#L100-L101 with the eariler code in my successful test.)
Thanks for the change in 1cd77f978afab5c722e61c6f3cf8adb1dfbafa90 -- that worked here.
With cf6086ae3b282046141fd7b6fbd1d08edcb85fdd on Windows,
jpm deps
for a project with at least one dependency can give output like this:Following a lead from bakpakin, I tried disabling a part of this line: https://github.com/janet-lang/jpm/blob/cf6086ae3b282046141fd7b6fbd1d08edcb85fdd/jpm/shutil.janet#L101
A subsequent execution of
jpm deps
completed successfully.Version info of various bits: