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

On Windows an Error Occurs When a --top-dir Option Contains Spaces #331

Closed
NorthLarry opened this issue May 22, 2017 · 13 comments
Closed

On Windows an Error Occurs When a --top-dir Option Contains Spaces #331

NorthLarry opened this issue May 22, 2017 · 13 comments
Labels
Milestone

Comments

@NorthLarry
Copy link

On Windows an error occurs when a --top-dir option contains spaces. The result is similar to this:

sqitch --top-dir "C:\path\with some spaces" revert --target some_target -y
Reverting all changes from some_target
  - some_script .............. C:/path/with:  No such file or directory
not ok
"psql.exe" unexpectedly returned exit value 1
@theory theory added the bug label May 22, 2017
@theory theory added this to the v1.0.0 milestone May 22, 2017
@theory
Copy link
Collaborator

theory commented Jul 11, 2017

Huh. Might be an issue with IPC::System::Simple, though I don't see this limitation in its Windows notes. @pjf, any ideas? Sqitch invokes runx here.

@theory
Copy link
Collaborator

theory commented Jul 13, 2017

Works for me when i make the path locally:

screen shot 2017-07-13 at 2 33 31 pm

And also when I use a full path:

screen shot 2017-07-13 at 2 34 55 pm

@theory
Copy link
Collaborator

theory commented Jul 13, 2017

Although maybe psql doesn't like it?

@NorthLarry
Copy link
Author

Yes, it looked as though psql could not find a script on path with spaces or was provided an incomplete path..

@theory
Copy link
Collaborator

theory commented Jul 13, 2017

So, does this work for you?

psql -f "C:\path\with some spaces/deploy/some_script.sql"

If it doesn't, then it's psql's bug.

@NorthLarry
Copy link
Author

NorthLarry commented Jul 13, 2017 via email

@theory
Copy link
Collaborator

theory commented Jul 13, 2017

Hrm. How about

 perl -MIPC::System::Simple=runx -e "runx @ARGV" psql -f "C:\path\with some spaces/deploy/some_script.sql"

If that works, try replacing runx with capturex.

@NorthLarry
Copy link
Author

NorthLarry commented Jul 13, 2017 via email

@theory
Copy link
Collaborator

theory commented Jul 13, 2017

Interesting. Can you try with some other app, maybe a Windows standard app like Notepad or something?

perl -MIPC::System::Simple=runx -e "runx @ARGV" notepad "C:\path\with some spaces/deploy/some_script.sql"

@pjf
Copy link

pjf commented Jul 14, 2017

There's indeed a chance this is an IPC::System::Simple issue, in which case yes, I should definitely be fixing it. :)

Alas I don't have easy access to a Windows testing environment, so patches may be even more welcome than usual. :)

@NorthLarry
Copy link
Author

NorthLarry commented Jul 14, 2017 via email

@theory
Copy link
Collaborator

theory commented Jul 14, 2017

Yeah, I have used the Free Windows VMs to do my Windows testing. Fire one up, use IE to download Strawberry Perl, install it and go. I'll open a bug in your issue tracker for now, @pjf.

@theory theory closed this as completed Jul 14, 2017
@theory
Copy link
Collaborator

theory commented Jul 14, 2017

Curious that the Notepad example worked. Might be harder for @pjf to replicate then without installing Windows Postgres. There are installers, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants