Skip to content

Conversation

mkoeppe
Copy link

@mkoeppe mkoeppe commented Jun 28, 2022

Motivated by the SageMath / passagemath distributions, which include FriCAS as an optional package (using ECL and targeting Linux and macOS), this PR adds a continuous integration workflow.

Test runs: https://github.com/passagemath/fricas/actions/workflows/ci-sage.yml

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

Currently make dist is failing:

2022-06-28T19:43:52.4519851Z test -f /Integer.help \
2022-06-28T19:43:52.4520225Z || (echo "helpfiles are missing"; \
2022-06-28T19:43:52.4520899Z     echo "use 'make dist helpsrcdir=/path/to/spadhelp'"; \
2022-06-28T19:43:52.4521241Z     exit 1)
2022-06-28T19:43:52.4536747Z helpfiles are missing
2022-06-28T19:43:52.4537345Z use 'make dist helpsrcdir=/path/to/spadhelp'
2022-06-28T19:43:52.4541354Z make: *** [Makefile:417: help-sanity-check] Error 1
2022-06-28T19:43:52.4562986Z ##[error]Process completed with exit code 2.

Any hints how to fix this?

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

I also ran the build locally (on macOS), and no *.help files are generated in any directory. Is make dist actually being used for making fricas source distributions?

@mkoeppe mkoeppe mentioned this pull request Jun 28, 2022
@hebisch
Copy link
Collaborator

hebisch commented Jun 28, 2022 via email

@hebisch
Copy link
Collaborator

hebisch commented Jun 28, 2022 via email

@hemmecke
Copy link
Collaborator

Help files duplicate data from other documentation files. In principle they could be made automatically from other files, but nobody implemented this.

What about
https://github.com/fricas/fricas/blob/master/src/doc/Makefile.in#L528
? I am sure I automated this.
If "make stamp-ug16helpfiles" does not work, you can simply run the awk script by hand.

awk -f src/doc/syscmd.awk src/doc/htex/ug16.htex 

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

I ran make stamp-ug16helpfiles in build/src/doc manually, and it did generate some *.help files, but it did not generate Integer.help, which make help-sanity-check is looking for

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

I make releases using 'src/scripts/mkdist.sh'.

How does one use src/scripts/mkdist.sh?

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

In particular, src/scripts/mkdist.sh does not work in an out-of-tree configured source tree:

cp: /Users/mkoeppe/s/sage/fricas/build/../build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist/build/dist: File name too long

@mkoeppe
Copy link
Author

mkoeppe commented Jun 28, 2022

Also does not work in an in-tree configured source tree:

$ src/scripts/mkdist.sh
SRCDIR=/Users/mkoeppe/s/sage/fricas
copy_lisp=""
copy_gphts=""
copy_phts=""
GCL_DIST=""
HELP_DIR=""
cp: /Users/mkoeppe/s/sage/fricas/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/dist/license/LICENSE.AXIOM: File name too long

@mkoeppe mkoeppe force-pushed the ci_sage branch 2 times, most recently from b5e0345 to 78d9f95 Compare June 29, 2022 00:15
@hebisch
Copy link
Collaborator

hebisch commented Jun 29, 2022 via email

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

I did 1 & 2 but then called src/scripts/mkdist.sh without arguments. I'll try again with these arguments

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

Given that make dist is no longer used and appears to be broken, would you accept a pull request that replaces it by a clear error message pointing to the mkdist.sh script?

@hebisch
Copy link
Collaborator

hebisch commented Jun 29, 2022 via email

@oldk1331
Copy link
Collaborator

Can you tell me the purpose of this PR? Looks like it builds on 135 different systems. Could take hours if not days to finish.

On the other hand, FriCAS has very few dependencies and extremely portable among different distros.

Also this only tests ECL. I think the added value is minor compared to the effort.

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

There's no need to worry about the effort that I'm putting in it.

@oldk1331
Copy link
Collaborator

The effort I meant is in Eco-friendly sense. So this is 135x40minutes tests compared with current 3x10minutes. Compared with 180 times more time/energy, the gained value seems small.

Also, would this fits more in sage repo?

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

would this fit more in sage repo?

We already run this portability suite in the Sage repo. However, when we prepare a package upgrade, such as fricas to 1.3.8 in https://trac.sagemath.org/ticket/34051, we often discover that packages break one or several platforms. The purpose of contributing ci-sage.yml to an upstream project is to assist upstream projects in discovering portability breakage before they cut a new release.

Our ci-sage.yml is already in use with various mathematical software (see https://trac.sagemath.org/ticket/33338) for this purpose.

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

FriCAS has very few dependencies and extremely portable among different distros.

Well, Sage has carried patches for FriCAS because it does not compile out of the box on all of our supported platforms. https://github.com/sagemath/sage/tree/develop/build/pkgs/fricas/patches

And it appears that FriCAS currently does not have any CI coverage for builds with ECL. As they say, untested, hence broken

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

The effort I meant is in Eco-friendly sense. So this is 135x40minutes tests

It's easy to configure it so it only runs on tags, etc., if so desired; or to reduce the number of platform tested.

@oldk1331
Copy link
Collaborator

We already run this portability suite in the Sage repo. However, when we prepare a package upgrade, such as fricas to 1.3.8 in https://trac.sagemath.org/ticket/34051, we often discover that packages break one or several platforms.

So for 1.3.8, specifically, what are the problems?

From the ticket#34051, see the problems happen if you remove the patch?

Well, if you remove https://github.com/sagemath/sage/blob/develop/build/pkgs/fricas/patches/remove_case_insensitive_test.patch , it is fine on released tarball, but will fail on git version.

About macOS failure, I wonder if it is the same as #59 , fixed in ECL upstream but not released?

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

Ticket https://trac.sagemath.org/ticket/34051 removes some of the patches. https://trac.sagemath.org/ticket/34051#comment:14 proposes to add a reduced version of one of the patches back.

You can see the macOS failure for example in https://github.com/mkoeppe/fricas/runs/7104014683?check_suite_focus=true

My hope would be that versions of our patches can be upstreamed so that we don't have to carry and update them any more.
If these portability fixes are something that FriCAS developers are interested in, then the CI in this PR may be a valuable tool.

@oldk1331
Copy link
Collaborator

You can see the macOS failure for example in https://github.com/mkoeppe/fricas/runs/7104014683?check_suite_focus=true

Where can I get the FriCAS build log in this link?

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

Open the section "Print out logs for immediate inspection" in the log output

@oldk1331
Copy link
Collaborator

OK, confirmed, same problem as #59 .

Re implicit declarations there are two ways around this problem:

    1. use dynamic ffi (a bonus point is that it will work when ecl is compiled only with the bytecodes compiler, downside is a big performance penalty - around 40x slower function call)
    2. expand your macro to add a declaration (that's what cffi does for static calls) or include the appropriate header

We didn't move forward after this suggestion from ECL developer.

@oldk1331
Copy link
Collaborator

New error from Fedora-34,35,36,37 standard:

2022-06-29T08:47:01.7064176Z ;;; Internal error:
2022-06-29T08:47:01.7064263Z ;;;   ** Error code 1 when executing
2022-06-29T08:47:01.7065551Z ;;; (EXT:RUN-PROGRAM "gcc" ("-o" "ARR2CAT-.NRLIB/ARR2CAT-.fas" "-L/usr/lib64/" "/sage/local/var/tmp/sage/build/fricas-git/src/src/algebra/ARR2CAT-.NRLIB/ARR2CAT-.o" "-shared" "-Wl,-z,relro" "-Wl,--as-needed" "-Wl,-z,now" "-specs=/usr/lib/rpm/redhat/redhat-hardened-ld" "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" "-Wl,--build-id=sha1" "-Wl,-z,relro" "-Wl,--as-needed" "-Wl,-z,now" "-specs=/usr/lib/rpm/redhat/redhat-hardened-ld" "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" "-Wl,--build-id=sha1" "-lecl" "-lgmp" "-lgc" "-lffi" "-lgc" "-lgc" "-lgc" "-lpthread" "-ldl" "-lm")):
2022-06-29T08:47:01.7065702Z ;;; make[8]: *** write jobserver: Bad file descriptor.  Stop.
2022-06-29T08:47:01.7065828Z ;;; make[8]: *** Waiting for unfinished jobs....
2022-06-29T08:47:01.7065970Z ;;; make[8]: *** write jobserver: Bad file descriptor.  Stop.
2022-06-29T08:47:01.7066394Z ;;; lto-wrapper: fatal error: make returned 2 exit status
2022-06-29T08:47:01.7066497Z ;;; compilation terminated.
2022-06-29T08:47:01.7066681Z ;;; /usr/bin/ld: error: lto-wrapper failed
2022-06-29T08:47:01.7066805Z ;;; collect2: error: ld returned 1 exit status

Seems like lto link error?

Also this failure to compile should lead to later interpsys crash: Detected access to an invalid or protected memory address. No such file or directory

@hebisch
Copy link
Collaborator

hebisch commented Jun 29, 2022 via email

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

More generally about CI: CI is good at detecting that there are problems, but IME of limited help in fixing them.

Yes, developers still got to develop.

@mkoeppe
Copy link
Author

mkoeppe commented Jun 29, 2022

New error from Fedora-34,35,36,37 standard:

By the way, to investigate these failures more, you can pull the failing builds as Docker images.
For example docker run -it docker.pkg.github.com/mkoeppe/fricas/sage-docker-fedora-36-standard-with-targets:4e12f4003a-dirty-failed bash

@dimpase
Copy link
Contributor

dimpase commented Mar 25, 2023

So for 1.3.8, specifically, what are the problems?

for instance, it does not work on ECL macOS without our patches. Which were offered here in #59, considered, and apparently fixed, but it happened after 1.3.8 was released.

@hebisch
Copy link
Collaborator

hebisch commented Jun 16, 2023 via email

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

Successfully merging this pull request may close these issues.

5 participants