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

2.4 breaks dumb (http) git repo support (for no good reason?) #7547

Open
costa opened this issue Mar 31, 2024 · 5 comments
Open

2.4 breaks dumb (http) git repo support (for no good reason?) #7547

costa opened this issue Mar 31, 2024 · 5 comments
Labels

Comments

@costa
Copy link

costa commented Mar 31, 2024

Describe the problem as clearly as you can

With 2.3, say, gem 'ffmprb', :git => 'http://git/ffmprb/.git'
works within my setup (git being a dumb [work-dir mirror] http server),
and with 2.4,
fatal: dumb http transport does not support shallow capabilities

Did you try upgrading rubygems & bundler?

The problem was introduced in recent versions.

Post steps to reproduce the problem

Find yourself in an older ruby environment (e.g. $ docker run -it --rm --name bundler-test ruby:3.1 sh)
Clone any gem (e.g. $ git clone https://github.com/costa/ffmprb.git),
Update server info (e.g. $ cd ffmprb; git update-server-info),
Serve the directory via HTTP locally (e.g. $ gem install webrick; ruby -run -e httpd . -p 8080),
In another term, in a temporary directory (e.g. $ docker exec -it bundler-test sh, $ mkdir test-proj; cd test-proj),
Create a Gemfile (e.g. $ echo "source 'https://rubygems.org'" > Gemfile; echo "gem 'ffmprb', :git => 'http://localhost:8080/.git'" >> Gemfile),
See that it succeeds (e.g. $ bundle) and exit the first term's environment (Ctrl-C, Ctrl-D).

Now, try the same with a newer ruby environment (e.g. $ docker run -it --rm --name bundler-test ruby:3.2 sh),
See, after all the steps above, instead of the big success, you get:
fatal: dumb http transport does not support shallow capabilities

Which command did you run?

See above

What were you expecting to happen?

See above

What actually happened?

See above

If not included with the output of your command, run bundle env and paste the output below

See above, it's your standard official Docker env.

@costa costa added the Bundler label Mar 31, 2024
@hsbt
Copy link
Member

hsbt commented Apr 1, 2024

fatal: dumb http transport does not support shallow capabilities

The above messages was displayed by git, not RubyGems and Bundler.

@costa
Copy link
Author

costa commented Apr 1, 2024

fatal: dumb http transport does not support shallow capabilities

The above messages was displayed by git, not RubyGems and Bundler.

Correct, yet I believe the message is caused by some options Bundler is passing to git.

@deivid-rodriguez
Copy link
Member

I think #4475 may have broken that, since it indeed started cloning swallow repositories by default for performance.

It seems like very few users are affected by this, since this has gone unreported for more than a year. That said, I would be open to reviewing a patch that when this kind of error happens, it retries a full clone.

@costa
Copy link
Author

costa commented Apr 9, 2024

I think #4475 may have broken that, since it indeed started cloning swallow repositories by default for performance.

It seems like very few users are affected by this, since this has gone unreported for more than a year. That said, I would be open to reviewing a patch that when this kind of error happens, it retries a full clone.

Agreed, except for the "very few users affected" — I'm not sure who stays on the edge with bundler, but Ruby 3.2 is just a recent new stable version, so for those riding the stable (Docker) train, this problem has really just begun appearing.

@deivid-rodriguez
Copy link
Member

Normally we get regressions reported very soon. In this case that did not happen. In addition to that, it's the first time I see git sources used like that, so that makes me think it's quite uncommon. That's why I'd say there are not many people affected.

In any case, happy to take a patch as I said before.

llenk added a commit to llenk/rubygems that referenced this issue May 8, 2024
Remove depth arguments when git responds with error indicating it can't handle depth arguments
llenk added a commit to llenk/rubygems that referenced this issue May 8, 2024
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