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

Install some dummy and optional packages using conda-forge (micromamba) #35585

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Apr 29, 2023

📚 Description

sage -i pandoc or make pandoc will now use micromamba to install the package into an isolated conda environment in $SAGE_LOCAL/var/lib/sage/conda.
Likewise for the other dummy packages.

We also reduce normal optional packages info, valgrind, rubiks to conda-installed packages.

This reduces platform support for these optional packages to the platforms supported by conda-forge / micromamba, in particular, it drops support for 32-bit Linux. See:

This is the first step toward:

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Apr 29, 2023
@mkoeppe mkoeppe requested review from dimpase and isuruf April 29, 2023 06:49
@mkoeppe mkoeppe changed the title Add installation script for current dummy packages via mamba-forge Add installation script for dummy and optional packages via mamba-forge Apr 29, 2023
@isuruf
Copy link
Member

isuruf commented Apr 29, 2023

Would this work for the 3-manifolds binary distribution? You might want to use micromamba instead of mambaforge to make it better for 3-manifolds build.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2023

Thanks! https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html indeed looks like a better choice.

@mkoeppe mkoeppe changed the title Add installation script for dummy and optional packages via mamba-forge Install some dummy and optional packages using conda-forge (micromamba) Apr 29, 2023
src/bin/sage-env Outdated Show resolved Hide resolved
src/bin/sage-env Outdated Show resolved Hide resolved
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2023

Would this work for the 3-manifolds binary distribution?

@culler Could you take a look if this breaks anything for your distro build?

@culler
Copy link
Contributor

culler commented Apr 29, 2023

Thank you for checking!

I checked my last build of 10.0.rc0. When I look in logs/pkgs I do not see log files for packages named conda, micromamba, info, or rubiks. I also do not see any of those packages in local/var/lib/sage/venv-python3.11.1/var/lib/sage/installed or local/var/lib/sage/installed. I think that means that we are not building any of those packages, and therefore will not be affected by any changes to those packages.

We don't support sage -i so changes to sage -i pandoc will not affect us. And we do not run make pandoc.

I see changes to bootstrap and Makefile.in. Potentially those will cause trouble, of course, but I do not see anything obviously problematic.

There are changes to sage-env but I have to patch that anyway. I would rather not change my patch, but I can do that if forced to and I don't think I will have to. I see that conda has been added as a dependency to several packages, including ffmpeg and imagemagick. But as far as I can tell we are not building those either.

Are there some other places where I should be looking?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2023

I do not see log files for packages named conda, micromamba

This branch has not been merged yet!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2023

The packages info, valgrind, rubiks are the only three affected by this branch that could be installed before using Sage scripts, and will be installed using conda after this PR.

Sounds like this PR won't have a direct effect on your distribution.
But if we go forward with this approach, at some point we will hit optional packages that you do install. (For example, I briefly had latte_int in the list of packages that this PR changes in the same way, but for now I've backed it out again.)

@culler
Copy link
Contributor

culler commented Apr 29, 2023

I was not reporting that as an error. I was reporting it as evidence that we have not built those packages in any previous release, and therefore can be hopeful that changes to them will not affect our build..

@culler
Copy link
Contributor

culler commented Apr 29, 2023

Our guiding principle has been that we include every optional package which (1) we are able to build and (2) cannot be installed with pip. So removing packages which we currently install will be fine as long as those packages can be installed with pip. On the other hand, breaking optional packages which build without problems and run fine, but cannot be installed with pip, will make our distribution worse. I don't know why you would want to do that, though.

Maybe you could give me an idea of which packages you are referring to. What would be the reason for getting rid of your example package, latte_int?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2023

We're not removing packages. We're replacing the custom installation script by a general installation script that uses conda for the installation.
The reason for that is to reduce the maintenance effort for packages on our side.
I've put a list of candidate packages for this in #35583.

Matthias Koeppe added 3 commits December 8, 2023 10:16
Matthias Koeppe added 5 commits December 8, 2023 10:16
src/doc/en/developer/packaging.rst: Expand on conda packages
src/bin/sage-env: Add the conda env to PATH if present

build/make/Makefile.in: Try to install script packages without spkg-install using mamba

build/make/Makefile.in, src/bin/sage-env: Activate the conda env for installing, remove user conda env vars

Switch from mamba-forge to micromamba

build/pkgs/conda/SPKG.rst: Update

Simplify placement of conda env

Update build/pkgs/conda/spkg-install

Co-authored-by: Isuru Fernando <[email protected]>

src/bin/sage-env: Do not override conda env vars here; do that only in build/make/Makefile.in
Copy link

github-actions bot commented Dec 8, 2023

Documentation preview for this PR (built with commit 3193b87; changes) is ready! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants