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

Fix the SWH fallback feature when using wget2 #6303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

When using wget2 (default wget on Fedora 40 and 41), the testsuite fails with:

diff --git a/tests/reftests/swhid.unix.test b/tests/reftests/swhid.unix.test
--- a/tests/reftests/swhid.unix.test
+++ b/tests/reftests/swhid.unix.test
@@ -109,9 +109,18 @@ The following actions will be performed:
 
 <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
 Source https://fake.exe/url.tar.gz is not available. Do you want to try to retrieve it from Software Heritage cache (https://www.softwareheritage.org)? It may take few minutes. [y/N] y
--> retrieved snappy-swhid-dir.2  (SWH fallback)
--> installed snappy-swhid-dir.2
-Done.
+[ERROR] Failed to get sources of snappy-swhid-dir.2: SWH fallback: Unknown swhid
+
+OpamSolution.Fetch_fail("SWH fallback: Unknown swhid")
+
+
+<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
++- The following actions failed
+| - fetch snappy-swhid-dir 2
++- 
+- No changes have been performed
+'${OPAM} install snappy-swhid-dir -v' failed.
+# Return code 40 #

It turns out the issue was that by default wget2 prefers to get html files so the Software Heritage server will serve an html file instead of the expected application/json. This fix fixes this issue as well when downloading archives from some servers that also have the same behaviour of returning a different output depending on the value of Accept:.

See rockdaboot/wget2#337

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Nov 16, 2024
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

Successfully merging this pull request may close these issues.

1 participant