[Discussion] How to handle os/version/arch-specific downloads#2009
[Discussion] How to handle os/version/arch-specific downloads#2009adamjstewart wants to merge 2 commits intospack:developfrom
Conversation
|
i think the Even though Spack may not have the same granularity in OS's ( |
|
Yeah, I wanted to use those. But I don't think it's documented, so I don't know what all of the options are or what possible values they return (if someone wants to do this that would be fantastic). And a lot of those return the same things as |
|
@adamjstewart: they're wrappers if you assume that the build host is where you'll actually run. The difference is that they're attributes on the |
|
That's a good explanation. Yeah, I can use them as soon as they get documented. Aside from that, how do people feel about this strategy? It's kind of a pain in the ass for packages with as many downloads as |
|
since you only need to have different url's and hashes, maybe in addition to |
|
So, I think we clearly need conditional logic for this, and what you're doing here will work right now. But if it turns out that you need a separate tarball for a backend arch, this won't work. I think I would probably initially make the Thoughts? |
|
I think adding |
|
This currently crashes on macOS because the mirror logic tries to parse the extension but |
|
@adamjstewart : is there any reason not to use |
|
The problem is that every single unit test fails: This solution is not very robust. We need to add a |
|
Oh ok, I saw the tests now. |
|
Closing as this discussion ended a long time ago. |
This PR is more of a discussion, but could probably be merged anyway if people like it.
The question is, how do we handle software that provides a different download depending on your operating system, version, architecture, etc? I chose
allinea-forgeas a particularly nasty example. See the downloads page here.Software like this provides two problems:
The second problem could be solved by including the os-version-arch in the version, but I tried to avoid this hack.
My solution was to create a function that determined the appropriate version to download. For example, if you are on RHEL or CentOS, it uses the "Redhat" version. It would be great if os-version-arch stuff like this could be included in the core Spack libraries, but since each package may name things differently, I don't think this is possible. For example, one package could have a "Redhat" version and another could have both a "rhel" and "centos" version.
With this function, I can define the
url_for_download()method. And with a case-statement-like if-statement, I can define the checksums for each version, depending on the os-version-arch.@citibeth This is what I was talking about in #1997.
Note: since I don't have every possible platform available to me, I could only test on CentOS. I couldn't find any good documentation on
platformso I don't know the exact string for each possible system, linux distro, etc. I also don't know mappings between Fedora versions and RHEL versions, so I didn't provide support for Fedora. There are probably a lot of distros that could use one of these versions even if they aren't explicitly listed. Mint could probably use the Ubuntu download for example. These would have to be added manually. If you can think of a better solution, let me know.