Addressing Dependency Challenges / Future of Sage-the-Distribution #39272
Replies: 12 comments 19 replies
-
This is a good topic to open in Discussions but inappropriate as an issue, which should focus narrowly. |
Beta Was this translation helpful? Give feedback.
-
@tobiasdiez let me know if you want me to convert this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
I would like to add pixi to the list. I think it solves many of the usability problems that a plain conda setup has when providing developer dependencies. |
Beta Was this translation helpful? Give feedback.
-
one immediate improvement of the current sage the distro model would be to make minimal requirements not as needlessly minimal as now. You could see that e.g. on Linux systems these don't include g++ and gfortran - something which makes no sense, as all the Linux systems we support have these ready to build Sage. These are set in build/pkgs/_prereq/distros/ |
Beta Was this translation helpful? Give feedback.
-
Now that we can build sagelib independently using meson, I'm pretty happy. We have at least five people packaging the dependencies of sage in various ecosystems. I'm quite content to build sagelib and ignore everything under I'll be focusing on the few remaining issues (database packages) needed to get sage into Gentoo. When that's done, if you want to use sage, install the Gentoo package. If you want to develop sage... install the Gentoo package, and then clone sage.git and build sagelib using meson. That doesn't work for non-Gentoo users, but I think that taking a similar stance with (say) conda would be a lot more scalable than what we are doing now. |
Beta Was this translation helpful? Give feedback.
-
Based on above discussions, I think:
Please let me know is this can be an effective solution or not as mixed approach can be a better option as beginners can be covered (via conda) and there can be flexibility for advanced users (via package managers or custom scripts). This approach also remains maintainable and adaptable to evolving needs. |
Beta Was this translation helpful? Give feedback.
-
It seems natural at this point to decouple, as much as possible, sagelib and its requirements/dependencies (a.k.a. sage the distro). This will simplify packaging sagelib for the linux distros and for conda, as well as acknowledge the reality of how sagelib is used. People who are not interested in maintaining sage the distro won't be distracted from work on sagelib, too. This will also make it easier to design, if desired, a slimmer alternative to the current sage the distro, which is a product of many years of incremental updates, and as such is way too complicated and suboptimal. |
Beta Was this translation helpful? Give feedback.
-
I was not aware that we use Discussions actively. Feel free to move it there if you think it's a more appropriate category.
Thanks for the suggestion. I agree pixi looks great (so does uv if they would support conda). I've added it as a suboption of conda in the list above since they are quite similar in many regards. Okay? So your preference is a pixi-only setup, or how would you envision the setup to look like?
While I agree with the general sentiment here, I was hoping to find a solution that would fit most people's needs and wishes. I think we have also seen that the each-developer-their-own-corner approach only works as long as the corners don't intersect. But at some point you are bound to run into problems because one person needs some change that conflicts with someones else approach. To give some concrete examples:
Sure, in each instance you could say, I don't care about sage-the-distro and just move ahead with the necessary changes in sage-the-lib; but then you are bound to get very angry looks from the people that would like to keep sage-the-distro as the main installation mechanism. So, in summary, my hope was to find a way that would unite most developers to work in the same direction. For what's worth, I personally I essentially agree with the approach sketched above by @PredictiveManish, except that I don't think we need point 3 "installer scripts": Conda as the primary installation method and to setup the dev environment; complemented by sufficiently strong dependency checks in meson to make it possible to also manually install all dependencies (say via package managers) and meson-wraps for some important dependencies that are hard to install (on a given system). |
Beta Was this translation helpful? Give feedback.
-
Yes you're right point 3 is just an additional point. We can easily eliminate it apart from it all others can do the whole bunch of tasks covering entire spectrum either beginner or advanced developers. |
Beta Was this translation helpful? Give feedback.
-
For developers, yes. You can still pip install if you happen to have all the dependencies ready (e.g., because you are building for a distro.) I have not migrated a project the size of SageMath to pixi obviously, but otherwise the experience has been great. It's a great means to ship a very opinionated yet robust setup…I think it gives us everything that Sage the distro ever wanted (except we loose support for any platforms that are not supported by conda-forge.) |
Beta Was this translation helpful? Give feedback.
-
@orlitzky One use of By the way, does Gentoo project run CI on not yet released by them soft? |
Beta Was this translation helpful? Give feedback.
-
I've asked fpylll people to have a new release, as all this is now fixed in their master. @malb @ludopulles - bij voorbaat dank. |
Beta Was this translation helpful? Give feedback.
-
One of the major pain points for users and developers of Sage is the need to install a wide range of dependencies before getting started with actually building sagelib. The idea of this issue is to discuss potential solutions and hopefully converge to one long-term vision, which can then be presented/discussed further on the mailing list.
Problem Overview
Potential Solutions
1. Provide Build and Install Scripts for All Dependencies
This is the current status quo for sage-the-distribution. Based on a minimal set of dependencies, all Sage dependencies are installed via a manually maintained set of installation scripts and a dependency tree.
Advantages:
Disadvantages:
2. Provide Build and Install Scripts for a Minimal Set of Dependencies
This approach involves selecting a set of supported operating systems and maintaining scripts only for a minimal set of dependencies required to install
sagelib
after using the OS-provided package manager. There are different flavors, Python could be managed via external tools like pyenv or uv.Advantages:
Disadvantages:
3. Conda
Use Conda as the primary package and environment manager for Sage. Either directly using
conda/mamba
or viapixi
.Advantages:
Disadvantages:
4. Meson Wrap-DB
Explore using Meson Wrap-DB to manage dependencies. Meson Wrap-DB allows dependencies to be included as subprojects, simplifying their integration into the build system. In essence it is similar to the current sage-the-distro setup, but the build scripts of dependencies are written in Meson.
Advantages:
Disadvantages:
5. Only Rely on Package Managers to Install Dependencies
This approach would remove the need for custom build and install scripts and instead rely entirely on popular package managers like
apt
,yum
,brew
,pacman
for dependency management. Users would be instructed to install dependencies using these package managers, and SageMath would ensure compatibility by specifying the required versions.If an required version is not available, Sage would simply not install the part of sagelib that requires on this dependency.
Advantages:
Disadvantages:
Mixed Strategies
These potential solutions should not necessarily be seen as mutually exclusive. A mixed approach could combine the strengths of different strategies to balance simplicity, flexibility, and maintainability. For example: Conda could be the recommended installation procedure (3.) and otherwise Sage would simply not install parts of sagelib if a dependency is not installed via the system's package maanger (5.).
Request for Community Input
I invite the SageMath community to share their experiences and thoughts about these solutions. Are there additional tools or approaches we should consider to reduce the dependency burden?
Looking forward to your feedback and ideas!
Pinging a few people that showed interest in discussing these topics in the past: @kwankyu @dimpase @orlitzky @tornaria @antonio-rojas @saraedum
Beta Was this translation helpful? Give feedback.
All reactions