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

Building on windows: tar falls over trying to chdir to tempdir via -C #17

Closed
nicolan opened this issue Aug 11, 2016 · 1 comment
Closed

Comments

@nicolan
Copy link

nicolan commented Aug 11, 2016

I leap in where angels fear to tread.

Attempting to use sphinx-versioning on Windows (both native and cygwin). My first problem was that the pipe of git archive ... | tar -C was failing. The command with arguments as given worked okay from the command line, but from within Python, tar was falling over trying to chdir to the temp dir. I got past that by patching thusly to let Python set the cwd instead of relying on tar:

In git.py : export

    git_command = ['git', 'archive', '--format=tar', commit, '--output='+os.path.join(temp_dir,'foo.tar')]
    # Run commands.
    run_command(local_root, git_command, piped=None)
    run_command(temp_dir, ['tar', '-x', '-f', 'foo.tar'], piped=None)
    os.chdir(local_root)

My python is nonexistent so I submit the gist of the idea here only. (foo.tar is madness? os.chdir may not be necessary?)

@Robpol86
Copy link
Collaborator

Getting this to work on Windows won't be trivial since I used os.path.join() for URLs and multiprocess features that probably don't work on Windows without if statements. Also Windows doesn't support pipes (though cygwin does).

I'm tracking Windows support in #3 but it will be a few months before I can get to it.

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

No branches or pull requests

2 participants