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

Pkg should not be shell-ing out #4888

Closed
vtjnash opened this issue Nov 22, 2013 · 8 comments
Closed

Pkg should not be shell-ing out #4888

vtjnash opened this issue Nov 22, 2013 · 8 comments
Assignees
Labels
domain:packages Package management and loading kind:regression Regression in behavior compared to a previous version status:priority This should be addressed urgently system:windows Affects only Windows
Milestone

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Nov 22, 2013

Why is the Julia Pkg manager trying to shell out? Window's doesn't have a shell.

julia> Pkg.add("Cairo")
C:\Documents and Settings\Administrator\My Documents\Downloads\julia-05c6461b55\
Git\bin\sh.exe: *** fork: can't reserve memory for stack 0x490000 - 0x690000, Wi
n32 error 0
      0 [main] sh 2604 sync_with_child: child 2848(0x32C) died before initializa
tion with status code 0x1
    238 [main] sh 2604 sync_with_child: *** child state waiting for longjmp
sh: fork: Resource temporarily unavailable
ERROR: failed process: Process(`sh -c "cd 'C:\Documents and Settings\Administrat
or\.julia\.cache\BinDeps' && git rev-parse --git-dir"`, ProcessExited(128)) [128
]
 in pipeline_error at process.jl:476
 in success at process.jl:468
 in readbytes at process.jl:430
@StefanKarpinski
Copy link
Sponsor Member

Provide me a way to cd after forking a subprocess and I can change it. cc: @loladiro

@Keno
Copy link
Member

Keno commented Nov 22, 2013

Pretty easy to do. The only question is syntax. I'd propose something similar to what we do with setenv(sh,{"A"=>"B"}) right now.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Nov 22, 2013

Mildly acceptable workaround is to use cmd

julia> ;cmd /c "cd C:\\ && ls"
AUTOEXEC.BAT            MSDOS.SYS     Program Files              WINDOWS
CONFIG.SYS              MinGW         Program Files (x86)        boot.ini
Documents and Settings  MinGW64       RECYCLER                   ntldr
IO.SYS                  NTDETECT.COM  System Volume Information  pagefile.sys

julia> ;sh -c "cd / && ls"
C:\Documents and Settings\Administrator\My Documents\Downloads\julia-05c6461b55\
Git\bin\sh.exe: *** fork: can't reserve memory for stack 0x490000 - 0x690000, Wi
n32 error 0
      0 [main] sh 600 sync_with_child: child 2372(0x32C) died before initializat
ion with status code 0x1
    607 [main] sh 600 sync_with_child: *** child state waiting for longjmp
sh: fork: Resource temporarily unavailable
ERROR: failed process: Process(`sh -c 'cd / && ls'`, ProcessExited(128)) [128]
 in pipeline_error at process.jl:476
 in success at process.jl:468
 in run at process.jl:453
 in repl_cmd at client.jl:62

@loladiro's suggestion is better

@StefanKarpinski
Copy link
Sponsor Member

How about a keyword argument that defaults to "" and does nothing when the empty string is supplied? For any other directory it does the cd first.

@StefanKarpinski
Copy link
Sponsor Member

Call it dir?

@ghost ghost assigned StefanKarpinski Dec 17, 2013
@Keno
Copy link
Member

Keno commented Dec 17, 2013

To clarify, you're proposing a dir keyword argument to setenv?

@Keno
Copy link
Member

Keno commented Jan 24, 2014

Ok, proposed syntax is

run(`ls`; dir="/")

,will implement that.

@ghost ghost assigned Keno and StefanKarpinski Jan 24, 2014
@Keno
Copy link
Member

Keno commented Jan 27, 2014

Implemented in dee7f6c. @StefanKarpinski you should have all the tools to tackle this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:packages Package management and loading kind:regression Regression in behavior compared to a previous version status:priority This should be addressed urgently system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

3 participants