-
Notifications
You must be signed in to change notification settings - Fork 60
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
Unexpected behavior from patches if filename extention not detected #1418
Comments
Maybe you can use the link from Gitlab instead? https://gitlab.com/hepcedar/yoda/-/archive/yoda-2.0.3/yoda-yoda-2.0.3.tar.gz I am not sure we can reasonably deduce file names from a query string. It seems pretty brittle. However, the download comes with the correct
Which we could use instead of looking only at the URL. |
Nice find! Though I know other packages with similar issues so the general case still applies.
Yeah I don't expect you'll be able to do that. I was expecting to need to set I think the bug is more that not even this works: source:
url: https://yoda.hepforge.org/downloads?f=YODA-${{ version }}.tar.gz
sha256: 28a900b62b0ac967edfd1a64196c1518a1adcec12b08da5ff4ae5adff6a69662
file_name: YODA-${{ version }}.tar.gz
patches:
- 0001-Fix-setting-rpath-when-installing-on-macOS.patch I've often wondered about having a sources repo for conda-forge that could just be based on the SHA256. But that would mean any filename based decompression techniques wouldn't work. I wonder if the libmagic-style approach would be my preferred one... |
The thing is that we don't extract the file when the file name is set explicitly. Sometimes you want an archive as archive eg for testing |
How about adding a key to control the extraction that defaults to autodetection? |
When the URL encodes the filename in a non-obvious way the sources are not extracted and instead you get the raw tarball. I'm not sure if this is intentional but if it is it's not intuitive to me. Adding
file_name: YODA-${{ version }}.tar.gz
makes it a bit more clean but it's still annoying to manually extract the tarball.I guess the bug here is that the
file_name
key is not respected when detecting how to extract the sources? Also I think thefile_name
key should be mandatory if the URL contains parameters or if the filename doesn't contain.
. Alternatively the detection could be done based on the content of the file.Debugging this led me to thinking there should be a
extract
key under sources to enable/disable extracting the sources. Defaults tonull
which means detect it based on the source content. Ifextract: false
then thepatches
key shouldn't be available.0001-Fix-setting-rpath-when-installing-on-macOS.patch
The text was updated successfully, but these errors were encountered: