-
Notifications
You must be signed in to change notification settings - Fork 710
WGET doesn't support range requests, so we should ignore them when using it #3841
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
Conversation
What's your test plan for the change? |
As mentionned in #3799, I'm not sure what user input elicits this behavior, and I'd be glad if anyone could point me to how I can exercise this code path. |
What if you made a unit test that just called this directly? Seems like a bit easier to test then. |
@omefire so this code path gets exercised by secure repositories during
and add
Then do an initial update. This time it'll download the full index, so no range request. Now on subsequent updates if the index has changed then it'll just download the new tail of the index and this is where the range request comes in. |
@omefire Can you please use rebase instead of merge to get rid of spurious merge commits? |
@23Skidoo rebased! |
This is only a partial fix. We should also print a warning when the |
This is only a partial fix. We should also print a warning when the Something like this: $ cabal update
Warning: the 'wget' transport currently doesn't support range
requests, which wastes network bandwidth. To fix this, set
'http-transport' to 'curl' or 'plain-http' in '~/.cabal/config'. Note
that the 'plain-http' transport doesn't support HTTPS. |
@23Skidoo got it. Will address it! |
@dcoutts Thanks for explaining this, that does help a lot. |
@dcoutts So how, exactly, would you write a test for this ;) |
In order for this code path to be hit, ~/.cabal/config should contain |
I don't think we can write a unit test for this, as it requires to fake updates to the remote repo. |
… it doesn't support them and would instead fail.
@omefire FWIW, I agree. At some point the effort of testing just outweighs the benefits and I agree with you that that is the case here. |
OK, sorry, I failed to see that the ticket had updated. @omefire originally posted a suggested "fix" to get wget understanding range headers, I asked for a test, but the patch does something different now. I guess the fix didn't work. IMO the new code doesn't need a test. |
Ignore HTTP range requests when using 'wget', as it doesn't support them and would instead fail.