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

git archive error "gzip -cn: gzip: command not found" with MinGit package on windows #1970

Closed
Rastaban opened this issue Dec 7, 2018 · 16 comments

Comments

@Rastaban
Copy link

Rastaban commented Dec 7, 2018

  • [x ] I was not able to find an open or closed issue matching what I'm seeing

git archive does not work if you have the windows MinGit package installed because gzip is missing from the package.

gzip -cn: gzip: command not found
@dscho
Copy link
Member

dscho commented Dec 7, 2018

Full example, please.

@Rastaban
Copy link
Author

Rastaban commented Dec 7, 2018

Full example:

PS E:\vcpkg\vcpkg> git.exe archive FETCH_HEAD -o e:\vcpkg\vcpkgarchive.tar.gz
gzip -cn: gzip: command not found
PS E:\vcpkg\vcpkg>

@dscho
Copy link
Member

dscho commented Dec 8, 2018

Okay, it is specific to .tar.gz files. The major problem I have here is that gzip.exe would be needed only for this obscure command, and it would increase the size of the MinZip package (which I don't want). Also, it would encourage people to use gzip from the MinGit package, and that is not what MinGit is about.

Besides, the gzip.exe in Git for Windows' SDK is an MSYS2 one, i.e. it incurs all the problems we have occasionally with the MSYS2 runtime and its DLL base address.

So my current thinking is: If we can somehow implement the bare minimum code in archive-tar.c to perform gzip compression (we already link to zlib, and AFAIU gzip only adds a file header), then we could neatly side-step this issue without bundling gzip.exe.

@dscho
Copy link
Member

dscho commented Dec 8, 2018

the bare minimum code in archive-tar.c to perform gzip compression

This should help: https://github.com/madler/zlib/blob/master/test/minigzip.c

@dscho
Copy link
Member

dscho commented Dec 9, 2018

@Rastaban I had a thorough look today, and it seems that the proper solution to this would be to change archive-tar.c to use the git_deflate() facility (with appropriate initialization and cleanup), essentially by changing all call sites of write_or_die() so that they use a git_zstream * (which will have to be handed all the way down in the form of function parameters).

Based on past experience with Git for Windows users, I am not sure whether you fall into the exciting group of contributors who only need minimal guidance and are eager to fix their issue?

If not, you can just go and copy gzip.exe e.g. from http://github.com/git-for-windows/git-sdk-64/tree/master/usr/bin.

Of course, I hope you fall into that exciting group, in which case I would be happy to assist you.

@Rastaban
Copy link
Author

@dscho, I am unable to commit to it at this time. In order to unblock vcpkg we will switch to one of the larger packages that already has gzip. When I have a block of free time I will take you up on your offer to assist me in making this change (unless someone else gets to it first)

for future reference, where would I find the instructions for building git on windows?

@dscho
Copy link
Member

dscho commented Dec 12, 2018

where would I find the instructions for building git on windows?

Here: https://github.com/git-for-windows/git/wiki/Building-Git

When I have a block of free time I will take you up on your offer to assist me in making this change

Excellent.

@r1walz
Copy link

r1walz commented Feb 8, 2019

@dscho @Rastaban : If any of you haven't started to work on this issue, can I take this up? This would be my first contribution.

@Rastaban
Copy link
Author

Rastaban commented Feb 8, 2019

@r1walz I haven't had a chance to look at it yet, and would be happy to let you take it over.

@dscho
Copy link
Member

dscho commented Feb 8, 2019

@r1walz go for it! Do you have information to get started?

@r1walz
Copy link

r1walz commented Feb 8, 2019

@dscho : yes, I'd love to receive some extra information

@PhilipOakley
Copy link

Hi @r1walz - Is there any specific information that is currently missing in this issue (#1970) thread for you, at least to get started with a trial build of the current release, just to 'pipe clean' the process?

If any of the wiki/Building-Git steps fail to work for you then do please do tell us so we can improve them.

Philip

@dscho
Copy link
Member

dscho commented Feb 12, 2019

@r1walz did you manage to compile (and use) minigzip.c (mentioned in #1970) yet?

@r1walz
Copy link

r1walz commented Feb 12, 2019

@dscho yes, I was able to compile and run minigzip.c, but are we not going according to this plan?

@dscho
Copy link
Member

dscho commented Feb 13, 2019

For lurkers: we talked more on IRC.

@dscho
Copy link
Member

dscho commented Feb 20, 2019

@r1walz this was quite the pleasant contribution, thank you so much!

dscho pushed a commit to dscho/git that referenced this issue Feb 20, 2019
MinGit for Windows comes without `gzip` bundled inside,
git-archive uses `gzip -cn` to compress tar files but
for this to work, gzip needs to be present on the host
system, which sometimes is not the case

In the next commit, we will change the gzip compression
so that we no longer spawn `gzip` but let zlib perform
the compression in the same process

In preparation for this, we consolidate all the block
writes into a single function

Closes: git-for-windows#1970
Signed-off-by: Rohit Ashiwal <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Feb 21, 2019
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jun 18, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jun 21, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jun 22, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Jun 22, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jun 22, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jun 23, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jun 23, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jun 23, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jun 25, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Jun 27, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jun 27, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jun 27, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jul 9, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jul 9, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to microsoft/git that referenced this issue Jul 12, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jul 13, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jul 25, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jul 26, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Jul 28, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jul 29, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 5, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 11, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 12, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 14, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 27, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 30, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Aug 30, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 30, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 8, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 13, 2022
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes #1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants