Opened 3 years ago
Last modified 2 years ago
#25391 closed defect
SageMath fails to build on on Fedora 28 with gcc 8.1 — at Version 15
Reported by: | Vaush | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | build | Keywords: | gcc8.1 python3 fedora28 compilation build |
Cc: | dimpase | Merged in: | |
Authors: | Dario Asprone | Reviewers: | |
Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |
Branch: | u/Vaush/sagemath_fails_to_build_on_on_fedora_28_with_gcc_8_1 (Commits) | Commit: | 5be7adc8c90d54d53c77fa8a20a8df1a223ea577 |
Dependencies: | #25204,#25353 | Stopgaps: |
Description (last modified by )
SageMath building produces 3 different errors when run on Fedora 28 64bit with gcc 8.1, specifically when building the packages:
- python 3.6.1
- python 2.7.14
- linbox 1.5.2
The following errors are respectively reported:
- Failure to import the crypt module
- Failure to generate posix vars
-
../../linbox/matrix/densematrix/blas-transposed-matrix.h:74:8: error: too many template-parameter-lists class TransposedBlasMatrix< TransposedBlasMatrix< Matrix > > : public Matrix{ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first error is due to an unspecified issue with Fedora 28 implementation of crypt(), which as reported in https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt is not the standard glibc implementation. Since I couldn't find a way to fix the crypt implementation in a reliable manner, I opted to implement the patch reported here https://bugs.python.org/issue28503 to allow python to use r_crypt(), which works.
The errors in the last two packages, instead, are due to more general issues with the new 8.1 version of gcc. Python 2.7.14 fails to build because the way structs are aligned in C was changed in gcc 8.1, as described in https://bugs.python.org/issue33374#msg315857 .
Linbox fails to build because it uses a construct previously accepted in gcc 7 that instead produces an error in gcc 8, specifically a templated template specialization done in the following way:
template<> template<typename T> class Class1<Type1<T>>{ ... }
For specifics on how the errors are solved, see the sage-devel discussion at https://groups.google.com/forum/#!msg/sage-devel/NgzlZknrizg/o-_Exw8jCAAJ
N.B: while originally this ticket fixed all 3 bugs, since the last two were solved separately in two different tickets, now the current ticket only fixes the python 3 bug, while mergin the tickets listed as dependencies to fix the others.
Change History (19)
Changed 3 years ago by
comment:1 Changed 3 years ago by
- Dependencies set to #25204,#25353
comment:2 Changed 3 years ago by
comment:3 Changed 3 years ago by
- Branch set to u/Vaush/sagemath_fails_to_build_on_on_fedora_28_with_gcc_8_1
comment:4 Changed 3 years ago by
- Commit set to 473f2149a035a87b0941ecab426f3b32bcd20472
- Status changed from new to needs_review
New commits:
4c1223e | Fixed python 3.6.1 crypt issue on Fedora 28
|
cb566ea | fixing gcc-8.1 compilation errors.
|
b20fd48 | Merge remote-tracking branch 'trac/u/cpernet/fflas_and_linbox_broken_with_gcc_8_1_0' into t/25391/sagemath_fails_to_build_on_on_fedora_28_with_gcc_8_1
|
d14acae | Upgrade to Python 2.7.15
|
473f214 | Merge remote-tracking branch 'trac/u/jdemeyer/upgrade_to_python_2_7_15' into t/25391/sagemath_fails_to_build_on_on_fedora_28_with_gcc_8_1
|
comment:5 Changed 3 years ago by
- Cc dimpase added
comment:6 Changed 3 years ago by
I'll be checking that this does not break on other systems.
comment:7 Changed 3 years ago by
Have you run tests on your branch?: make ptest
(or make ptestlong
for more tests)
This is something the ticket's author should do in such cases. (It would not be surprising if something unrelated to your changes fails, as gcc 8 is pretty much untested, but good to know anyway).
comment:8 Changed 3 years ago by
I haven't, but will do
comment:9 Changed 3 years ago by
- Commit changed from 473f2149a035a87b0941ecab426f3b32bcd20472 to 5be7adc8c90d54d53c77fa8a20a8df1a223ea577
Branch pushed to git repo; I updated commit sha1. New commits:
5be7adc | Merge branch 'master' into t/25391/sagemath_fails_to_build_on_on_fedora_28_with_gcc_8_1
|
comment:10 Changed 3 years ago by
What is happening with this on the current 8.3.beta6? Note that python2 has been updated.
comment:11 Changed 3 years ago by
For Python3, it's apparently https://github.com/python/cpython/pull/4691 which is still under review.
comment:12 Changed 3 years ago by
- Status changed from needs_review to needs_info
I am missing some context and documentation. The current branch only fixes Python 3. That is not consistent with the ticket description which mentions several packages and doesn't even mention the actual failure that the Python 3 patch is trying to fix.
comment:13 Changed 3 years ago by
The patch files should also contain some description, at a minimum a link to the upstream issue.
And if you add a patch to a package, you should bump the package version.
comment:14 Changed 3 years ago by
Ok, I'm sorry if the description or the execution aren't up to par, this is my first ticket, so I'm getting used to it.
The ticket was originally opened to describe the bug. After that, I succeeded in manually fixing all the bugs listed in the description, but it was brought to my attention that two of my bugs were solved in separate tickets at the same time (see the dependencies field), so I merged those tickets and added my own fix for python3, thus fixing all the issues and solving the problem stated in the ticket title, that is SageMath not compiling on Fedora 28 with gcc 8.1.
Since the commits include the fixes for the other 2 bugs, even if by merging, I thought this counted as having a fix for all 3 of them in the branch, is this wrong?
There is a description for the python 3 bug, since the bug is literally "Python tries to call crypt instead of crypt_r on Fedora, and this for some reason breaks things, so let's allow it to call crypt_r", and the reason why it breaks things is, as pointed out by dimpase, apparently that fedora has a completely different crypt implementation, as can be seen here https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt.
I'll expand on the description a bit, anyway, to make this clearer, and also to reflect the fact that this ticket only directly fixes the python3 bug, since it's only reported in the comments.
I'll also quickly add a description and a link to the patch
comment:15 Changed 3 years ago by
- Description modified (diff)
Linbox patch