pretext-cli icon indicating copy to clipboard operation
pretext-cli copied to clipboard

Upgrade SageMath in codespace

Open StevenClontz opened this issue 1 year ago • 5 comments

In https://github.com/TeamBasedInquiryLearning/precalculus/issues/165 we hit an issue where the version 9.2 of SageMath in our codespace hits a bug when detect_poles=True, which is fixed at least in SageMath 9.7. Can we upgrade our codespace SageMath to the most recent version?

StevenClontz avatar May 02 '24 16:05 StevenClontz

This turns out to be harder than I thought. Except for Arch and Void linux, no distribution seems to offer 10.x sagemath. So that means either completely redoing the pretext-docker using one of those linux distributions, or installing sagemath from source (which apparently requires 10GB of storage space, and takes upwards of 30 minutes after you have all the build dependencies).

So how necessary is this? Or perhaps, I'd welcome a PR on https://github.com/oscarlevin/pretext-docker.

oscarlevin avatar May 20 '24 00:05 oscarlevin

Well, the origin story for PreTeXt is to support placing Sage in textbooks. A local install is necessary for the "sageplot" element. And also for doctesting "sage" elements, which is an under-appreciated feature. So, it would be shame to not support these features.

A few years back, packages in distributions were unreliable.

In the plus column, building from source is usually easy and reliable.

On May 20, 2024 3:28:19 AM GMT+03:00, Oscar Levin @.***> wrote:

This turns out to be harder than I thought. Except for Arch and Void linux, no distribution seems to offer 10.x sagemath. So that means either completely redoing the pretext-docker using one of those linux distributions, or installing sagemath from source (which apparently requires 10GB of storage space, and takes upwards of 30 minutes after you have all the build dependencies).

So how necessary is this? Or perhaps, I'd welcome a PR on https://github.com/oscarlevin/pretext-docker.

rbeezer avatar May 20 '24 08:05 rbeezer

So how necessary is this?

From our project's perspective, I think we've managed to work around this particular bug in SageMath.

siwelwerd avatar May 20 '24 14:05 siwelwerd

@oscarlevin any chance your experimentation here pushed a change to your Docker image that causes Sage to no longer be installed?

StevenClontz avatar May 21 '24 19:05 StevenClontz

Fixed the issue with the docker image so at least the old 9.2 version gets installed now.

To get a more recent version,

  1. installing from source seems to be a no-go: codespaces run out of disk space during the build.
  2. Arch linux is a no-go: Playwright does not support Arch.
  3. Maybe working inside a Conda environment would work, although I'm not sure how to make sage available (the install directions say you need to activate with conda activate sage.
  4. Perhaps upgrading the debian version used in codespaces could bring us to 9.5.6, but that won't solve this particular bug, as far as I know.

oscarlevin avatar May 22 '24 03:05 oscarlevin