-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
New package: sagemath-9.5 #34030
New package: sagemath-9.5 #34030
Conversation
I'd go with
We need more expert advice with relocation. |
Should use the |
With this, at least it gets to the end
on the
Obviously, it complains that
and lots of |
Other than that, it installs fine.
|
Either |
About the doctests, I'm still unable to perform them
From terminal
What am I missing? |
You can ignore the The doctest failures probably have something to do with using python 3.9; why is this? |
I think one way would be to compile sage in-place, then remove all unnecessary stuff (or vinstall all necessary stuff). I'll give it a try later. The alternative is how sage builds binary tarballs: compile sage in a directory with a particular pathname (long enough), then search-and-replace this pathname with the location it will be installed. In their binary tarballs they do this search-and-replace step the first time sage runs after being extracted, in this way sage can be extracted anywhere and will fix its paths the first time it runs. We would do this at xbps-src install time. |
These are false warnings, we don't want this pkg to provide any shlibs and those shlibs will not be in any standard path anyway. As a matter of fact, all of those should eventually be gone and used from system instead. |
No, this is because sage needs the source files to be available, and I didn't include in the pkg. This is not just for testing, but also for inline help. You can see it complains about missing I'll do a second attempt soon. |
Second draft:
A useful reference is https://github.com/sagemath/binary-pkg. Now it's possible to run tests on the installed sage, for instance:
to test all with 8 parallel jobs. |
It's getting better. |
@leahneukirchen What do you think? |
Definitely :) |
Dumb question: does this in htop mean it is using system python? |
Could you add |
It seems
|
b0a333c
to
ad557eb
Compare
New on sagemath-9.5.beta6_2:
This one should save ~ 3.8G installed size. Again, it should be possible to run tests on the installed sage, for instance:
to test all with 8 parallel jobs. There are a few tests failing will look into it when I get a chance. It may also be useful to compare tests failing on
|
Good point, we have to explicitly add anything that is needed at runtime that is not implicitly required by shlibs. Maybe we should try to run all tests in a barebones chroot with only sagemath installed. |
Was the building taking 90+ min on the ci also before? I'm not yet using a chroot, but my system is quite clean: it seems we also miss
|
perhaps also add to depends: flintqs pari-datapkgs and zn_poly |
Sorry, forget about singular and pari. |
Running the test suite also requires git. |
Also sympow. We may want to add this patch: https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-mathematics/sympow/files/sympow-2.023.6-no-pkgdatafilesbindir-warnings.patch |
Note: I'm not making the sphinx update in #34789 a priority now, since that's needs more review and testing. Instead I'll try to see if we can build sagemath without it (I think so). The other four tickets mentioned above will be needed for sure; they should be an easy merge as they are all well tested new packages (so don't affect anyone else). Merging them will save us 30-40 minutes on the CI so it'd be really useful and they are probably the last packages needed before merging |
Rebased to master and squashed.
I kept the full commit history at https://github.com/tornaria/void-packages/tree/sagemath-v1. I've only tested the CLI. I'm sure the notebook/jupyter interface will need fixing. At this point it's probably convenient to switch the installation method so that the sagelib to the main site-packages. Also the |
Excellent, I will build the new version soon.
Do you mean we could now switch to |
Everything seems to work fine.
|
Note that If you need it, it should be possible to run it as
which instructs python to search for packages in the venv. If you use the notebook and notice anything is missing, please report (I mostly only use the CLI). Some standard packages are just force-disabled (e.g. jmol, mathjax, threejs) and thist may or may not break the notebook or reduce its functionality. If setting PYTHONPATH doesn't work properly and you want to try the shebang hack, apply the following commit and rebuild: commit 4430467ee2e19479a09961e902e89881efad358a
Author: Gonzalo Tornaría <[email protected]>
Date: Thu Nov 11 09:39:20 2021 -0300
sagemath: don't rewrite python shebangs
diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
index 07162ad2c6..c0f2198e44 100644
--- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
+++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
@@ -4,6 +4,10 @@
hook() {
local pyver= shebang= off=
+ if [ -n "$_no_python_shebang" ]; then
+ return 0
+ fi
+
if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then
pyver="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]\+$')"
fi
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index de9fe51777..f01fff3eea 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -72,6 +72,9 @@ nostrip=yes
# don't shlib_provide anything
noshlibprovides=yes
+# don't rewrite python shebang as sage uses its own python (for now)
+_no_python_shebang=yes
+
# compile python code in sage venv
pycompile_dirs="$_SAGE_ROOT/venv/"
I expect this will fix itself once we start installing sagemath in |
Thank you. What seems to work for me:
with no further changes to sage. Note that the |
Are you sure you wanna remove documentation? Will it break |
That's introspection and it still works. It should be using either the function docstring or the actual source as-installed in |
d45a20c
to
d63f5f0
Compare
sage 9.5 is released, so I've updated this branch. However, now that all dependencies are already available in void, I've been working on a new template which will install sagelib as a python module, in the system site-packages. I'm not sure about all the binary scripts, I lean towards installing all of them in |
Great. What are the obstacles to cross compile it, besides |
Just a note to self: use
|
I updated this branch to the new "sage-as-a-python-module" version from #35339 which seems to work very well. The previous approach with its full history is at https://github.com/tornaria/void-packages/tree/sagemath-v1, rebased to current master. I won't be updating or rebasing it further. Assuming CI passes (should take about 2h to finish), this PR is done and ready to merge. Any problems we find later we can follow up in individual issues, please @ me so I'm notified. We have:
|
Note that #35367 should be merged before this so that the binary package of sagemath runs ok on older cpus (e.g. nehalem). |
BTW, doctesting with |
Huge thank you @tornaria! This is amazing and really appreciated! All working fine on my end. |
This is WIP, so I can get feedback.
Supported architectures: x86_64, x86_64-musl, i686. We also try to make sure it works with musl-1.2.
The testsuite can be run normal (-Q) or long (-K). For CI it runs normal (~ 1/2 time) and it uses a fixed random seed 0 to avoid random failures. When running locally, the random seed is random so one may get occasional test failures that depend on a particular value of the random seed.
The package
sagemath-test
is a dummy package whose purpose is to run the testsuite with sage installed as a package and without the build directory. For this to make sense, the masterdir has to be clean (without traces of the sagemath build, this should be ok after running "pkg" or "pkg -Q").