Multi Build System Packages [Prototype; Please Review]#12941
Multi Build System Packages [Prototype; Please Review]#12941
Conversation
…ckages can be created. This should utlimately be packaged up into something robust and reusable.
|
Trying to build Looks like the problem is a missing |
|
We will also need to implement something like this for the PAPI package once the next release comes out (in 6 months to 1 year). |
|
I worry that pushing all of this into a single package can become unmaintainable. There was a while back the idea of having "archived" versions of packages that spack could use, thus the current package would use "buildsystemA" and the archived version would use "buildsystemB", etc. I think that would be much more sustainable, although probably harder to implement in core spack. |
|
I agree with @chuckatkins, @alalazo had a nice idea where we could create a separate repository for older build systems of packages. The package names themselves would be the same, so the concretizer could still find them. I'm not sure how much work that would be in Spack core to make this happen though. |
|
What does "unmaintainable" mean here, can one be specific? How about something more convenient, built into Spack Core: Expand the concept of "package" to allow for two or more recipes (xyz/package.py) side by side. As long as the versions in the recipes don't conflict, all is OK. Spack would load whichever package.py makes sense for the version the user requests. For example: In this case, the autotools/ and cmake/ directories could be anything. As long as the package.py files don't specify conflicting versions. If Spack wants to know the versions available for the package, it looks in all the subdirectories. If it wants to concretize, it only loads up the |
|
In any case... my current problem is I can't use the versions of SuperLU-dist that I need to use, because they were removed to "make way" for newer versions. |
|
@adamjstewart @citibeth Can you list a few packages that have already been changed from one build-system to another? I'll try to see how far I can go with the idea of having a |
|
We currently have 3 suggestions on the table, and (AFAIK) no processes of thinking through the pros and cons of them. BEFORE we go to the work to implement one solution, can we work through on how that solution would work, how it would affect end users, and agree that it's a good compromise for all the different angles? Can you describe how the |
|
I would prefer a solution that was a bit more general than just addressing the build system change problem. For example, a solution that would allow distinct recipes based on version would address this problem as well as the problem of a recipe becoming too complicated when the build process changes significantly between versions. |
|
@citibeth It works like an additional repo, docs here, which contains legacy recipes and is set at lower priority than |
Use cases are essentially what I was asking for. |
|
@alalazo OK... I don't know all the packages that have been "buried" with new packages, hopefully not too many so far. But you can certainly start by digging the old version of the |
|
There are also upstream packages that have switched to CMake; but we still use the Autotools build becuase we don't know how to support both at once. The NetCDF packages is a good example of that; and it's quite widely used in various concretizations. To try that, one would have to make a new NetCDF package based on |
|
@alalazo one thing to keep in mind here: There may be packages, that support multiple build systems for some versions (thinking about tensorflow with bazel/Cmake). Sure ultimately most will revert to only supporting one, but still. We may very well decide, that we just don't care enough for this (hopefully rare) edge-case. But we should make that decision consciously |
Here is what I found. Feel free to add to this list:
|
This is one of the reasons Mesa is pinned to a year old version (not being able to consider the deps as a graph in the concretizer is another).
Namely that the particular package becomes very complex and very difficult for somebody other than the person who wrote it or other spack maintainers to make changes and add features.
I think this is a fantastic solution!!! It gives the ability to do more than just one previous version which can be important if a package goes through a major overhaul where variants are changed, etc. This will be increasingly common as spack ages and packages have more than just build system changes. |
|
A comment that I did on a similar issue some time ago is #10411 (comment) very much in line with @healther concerns. |
It's not that easy I think.
already implies that the version is known, which might not be. Also, it's very likely that different |
|
Do we want to consider the possibility that a particular version can be built using multiple build systems? Is there any advantage to allowing this? It sounds like it increases the complexity quite a bit. |
|
I don’t think it’s that important but maybe I’m wrong
…On Fri, Oct 4, 2019 at 11:38 Adam J. Stewart ***@***.***> wrote:
Do we want to consider the possibility that a particular version can be
built using multiple build systems? Is there any advantage to allowing
this? It sounds like it increases the complexity quite a bit.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12941?email_source=notifications&email_token=AAOVY5Z4RFAFBP6BC5VM3HLQM5PPLA5CNFSM4I2HDQX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMBUGY#issuecomment-538450459>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOVY5YHSDCPCLFZV6PUNW3QM5PPLANCNFSM4I2HDQXQ>
.
|
|
I agree with @citibeth on that point. It's a use case for sure but I don't think spack needs to worry about it. So long as the upstream dependee packages can use it, even if it takes a little hand holding by explicitly pulling the pieces out of the dependency spec to craft the right configure args i think it'd be fine. |
|
Follow-up: do we want to consider the possibility of a package that changes its build system multiple times? I'm not aware of any packages in Spack right now that do this, but as Spack ages, I wouldn't be shocked to see a Makefile -> Autotools -> CMake build system change for a single package. This renders the |
We might have to if there are exotic build systems. A current example I have is everything that is
It definitely does and there likely aren't that many package versions that will end up supporting multiple build systems. However From a user/developer perspective I like the idea of just having multiple
I don't think that 2 is a fundamental problem, it is quite a large step from our current setup and it probably wouldn't work out too nice with the current state of the optimiser. I'm really quite torn here, on the one hand I really want an easy way to add new build systems to new versions of packages, on the other hand screwing the implementation up here will hurt us in the long term. As @citibeth said: The number of packages we will have to deal with will only grow. It would probably be a good idea to separate the two questions here:
Ideally we want an answer to 1) before we should talk about 2), however for practical reasons 2 is the more pressing question. My gut feeling is that separating the implementation of different build system receipts is the right call. I'd probably prefer it in a single file, in order to allow for helper functions to be reused, but that's not a strong opinion. In the short run we could then go ahead and enforce (by convention) that each version may only appear under one build system, reducing the implementation problem (for now) to "aggregate all versions before selecting one". edit:
We should, it's not much more (implementation) work and as you say: It will happen and at least we use spack mainly because it can build older software without much headaches (looking at you: Qt) |
|
@healther I agree that it would be nice to support multiple build-systems for the same version of a package, if we can figure out a simple way to do it. But I personally rank simplicity higher than flexibility, so the final solution should ideally have both. |
Spack does not only select based on versions. The concretizer might need to undo its decisions and the two classes, even with disjoint versions, might have different variants. |
|
It’s already the case that different versions have different variants
…On Fri, Oct 4, 2019 at 16:32 Massimiliano Culpo ***@***.***> wrote:
In the short run we could then go ahead and enforce (by convention) that
each version may only appear under one build system, reducing the
implementation problem (for now) to "aggregate all versions before
selecting one".
Spack does not only select based on versions. The concretizer might need
to undo its decisions and the two classes, even with disjoint versions,
might have different variants.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12941?email_source=notifications&email_token=AAOVY54ZGDZTIJSSFSLHFJDQM6R6ZA5CNFSM4I2HDQX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMZ5PQ#issuecomment-538549950>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOVY57AWO6NRJSSN46ZMATQM6R6ZANCNFSM4I2HDQXQ>
.
|
|
@citibeth Since when do we have conditional variants? |
In reality, yes. In Spack, no. We could really use a |
|
@adamjstewart Exactly, and that needs modifications to the concretizer. See #9740 |
@adamjstewart ack, the problem is that we need to decide how we want the final solution (kind of a weird phrasing from my german perspective ;)) to look before we can implement something that works right now. Which makes life tricky... |
|
I talked to @becker33 about this a bit after #10411. I think there are four use cases here:
I think 1-3 have been discussed above. I tend to agree that we should not try to do (3), at least not immediately. I'll say more below. (4) is one that other package managers (like npm) support -- it essentially allows a project to have many different versions of its package file over time, and you just version the changes to the package file with the project. I do not know that we're completely ready for that one -- it's a different package manager architecture in that the package repo data is fundamentally distributed, and you collect it periodically in a registry. I don't see us going completely down that route -- it's harder for Spack to do this than other PMs as we have build recipes in addition to metadata, and Spack is always going to be at least partly centralized (or at least someone will have to write recipes because not all projects will maintain them). But it would enable some developer workflows we've been thinking about. That's another discussion, but it is related. I think allowing multiple Here's my proposal. Allow something like this: I suppose these could be subdirectories if we want, but things will get complicated w.r.t. locating any common patch files, etc. that might live in the directory with the package. From a build environment perspective, this is not actually so hard to implement. Packages are instantiated using This is a major change but I don't think it's a huge lift. This is probably a good place to use some type of composite I think (3) could be supported in a similar way, but I have a hard time thinking about how you'd want to lay out package files to support it. In my outline above, the packages are distinguished by version, and we only allow so many characters to be in versions, so they make decent suffixes. I worry it'll get extremely cumbersome to support more than that. I think you'd need to just allow arbitrarily-named package files and require them to specify what they match as a class decorator or something. e.g.: @when("+meson")
class MyPackage():
passYou could allow these classes to live in the same My thought for (4) is that if you do the by-version thing described here, you can pretty easily make a loader later that supports looking through git history or tags for historical versions of a package, and basically use the same techniques. That wouldn't be part of the initial implementation, but it's something I think about when this comes up. Thoughts? |
|
The key insight I've had from this discussion is that concretization and building are different things. For the purposes of concretization, it makes sense to have just one package. But for building, we sometimes need different implementations for different versions (or variants or whatnot). Conceptually, imagine if we had classes The concretization package would have (among other things): available versions (including download locations), available variants (undoubtedly with The concretization package would ALSO contain instructions on which build package to use, using standard For example: mypackage/package.pymypackage/packageA.pymypackage/packageB.pyPS: Any way we can get #10403 merged? |
This is good. It checks a lot of the boxes for addressing most of the pain points at issue here. I'd jump on using it for |
They're not entirely different things, though. For example, the build system superclasses provide metadata, like dependencies on CMake, Python, etc. We are not using build system packages strictly as build systems. |
Unearthing this… We've had this issue come up with the Neuron simulator, switching from Autotools to CMake. To be sure that the transition is smooth and for the peace of mind of all collaborators, it was decided to keep both build systems upstream for the time being. For now, we resolved to having a This should allow us to build FYI, @pramodk, @iomaganaris |
closes spack#10411 closes spack#12941 This commit introduces a new repository where to move deprecated recipes e.g. for packages that changed build system. This will allow to benefit from base classes specialized for each build-system while still providing support for both recipes. Mpifileutils used as an example.
|
Is there a recommended best practice for packages that seem to be in the process of switching build systems (has both Makefiles and Meson build files, presumably the Makefiles will be going away in the future)? Would it be better to stick with the old build system until it gets removed or pick an intermediate version for the spack package to switch over to using Meson? |
|
@nightlark we don't really have an agreed upon approach to handle that at the moment. For now, I would stick with a single build system for as long as you can, so if older versions only support one and newer versions support two stick with the older one. In the long run, it will probably be whichever build system is better supported by the developers, or whichever is "newer". In your example, Meson is likely better for cross-platform builds than Makefiles. CMake would be another example of a "newer" build system. |
|
Closing as stale. Feel free to reopen if you want to rebase and restart working on it. |
related #10411
@alalazo @scheibelp @adamjstewart
With a mass migration to
CMakeand Spack having lasted more than a couple of years, it is now becoming common for Spack packages to change build system due to upstream changes in build system. For example,superlu-distchanged from ad-hoc manually-edited makefiles to CMake (see #12938). This introduces a problem because now there need to be two fundamentally different Spack recipes for the same package --- one to build older versions, and one to build newer versions. So far, there is no way to do this. Instead, people have simply been dropping old versions of packages, which can create its own problems.This PR provides a prototype of how a multiple build systems can be handled for a package in Spack, using
superlu-distas a real-world example. I have used it successfully to install[email protected]. The downside of this is that now, the phases of the CMake-build package are hidden. I'm sure that could cause headaches somewhere; but remember that early versions of Spack only had a singleinstall()phase and life went on. Maybe there is some what to finess the phase issue; for example, make the top-level package inherit phaes from the most-recent sub-package (in this case, theCMakePackageversion ofsuperlu-dist).Comments / improvements welcome. Ultimately, it would be great if this could be turned into a top-level, reusable
MultiBuildPackageor something of the sort.