sagemath/sage

ci-cygwin.yml: Multi-stage build

mkoeppe opened this issue · 63 comments

The GitHub workflow for cygwin does not fit into the 6-hour time limit.
We do a multi-stage build, saving and loading local/ to/from build artifacts.

Depends on #29417
Depends on #29392

CC: @dimpase @embray @slel @jpflori @tscrim @vbraun @kcrisman

Component: porting: Cygwin

Author: Matthias Koeppe

Branch/Commit: 27ddea3

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/29403

Branch pushed to git repo; I updated commit sha1. New commits:

79bee2fci-cygwin.yml: Remove sage-spkg -y -o

Changed commit from 79bee2f to cef0d73

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

cd0a0echandle symlinks
5a387d0Use winsymlinks:native
122f972Full targets
424d86eprepare the final logs artifact
f646274store local/var/tmp/sage/build in logs artifact
6924328stage 1
97d3f86touch installation records to get same mtime
5939bc7Upload log artifact first
59d20e0stage 4
cef0d73more stages

Dependencies: #29397

comment:6

Something is still triggering rebuilds of targets that have been built in a previous stage.

comment:7

I'd suspect it's the toolchain crud.

Changed dependencies from #29397 to none

comment:9

I'm running one test with MAKE="make --debug=verbose" to see what's happening there

Changed commit from cef0d73 to de50cf8

Branch pushed to git repo; I updated commit sha1. New commits:

de50cf8better touch

Author: Matthias Koeppe

comment:13

This works pretty well now.

Branch pushed to git repo; I updated commit sha1. New commits:

9db2311.github/workflows/ci-cygwin.yml: Edit targets
9f38852cygwin: Add minimal and standard-python2 builds

Changed commit from de50cf8 to 9f38852

comment:15

New failure mode: https://github.com/mkoeppe/sage/runs/560884908

"/cygdrive/d/a/sage/sage/local/lib/python3.7/subprocess.py", line 775, in __init__
  [backports_abc-0.5]       restore_signals, start_new_session)
  [backports_abc-0.5]     File "/cygdrive/d/a/sage/sage/local/lib/python3.7/subprocess.py", line 1453, in _execute_child
  [backports_abc-0.5]       restore_signals, start_new_session, preexec_fn)
  [backports_abc-0.5]   BlockingIOError: [Errno 11] Resource temporarily unavailable
  [backports_abc-0.5]   Cleaning up...
comment:16

https://github.com/mkoeppe/sage/runs/560884917

Installing backports_abc-0.5
      0 [main] python3.7 16471 child_info_fork::abort: address space needed by 'cyglzma-5.dll' (0x400000) is already occupied
Installing package backports_abc using pip3
      0 [main] python3.7 16554 child_info_fork::abort: address space needed by 'cyglzma-5.dll' (0x400000) is already occupied
Ignoring indexes: https://pypi.org/simple
comment:17

https://github.com/mkoeppe/sage/runs/560884917

 [r-3.6.2.p0]   gcc -I../../src/extra -I../../src/extra/xdr -I. -I../../src/include -I../../src/include -I/cygdrive/d/a/sage/sage/local/include  -I../../src/nmath -DHAVE_CONFIG_H   -fopenmp   -g -O2  -fPIC  -c version.c -o version.o
  [r-3.6.2.p0]   sysutils.c:554:10: fatal error: iconv.h: No such file or directory
  [r-3.6.2.p0]     554 | #include <iconv.h>
  [r-3.6.2.p0]         |          ^~~~~~~~~
  [r-3.6.2.p0]   compilation terminated.
comment:18

Replying to @mkoeppe:

New failure mode: https://github.com/mkoeppe/sage/runs/560884908

"/cygdrive/d/a/sage/sage/local/lib/python3.7/subprocess.py", line 775, in __init__
  [backports_abc-0.5]       restore_signals, start_new_session)
  [backports_abc-0.5]     File "/cygdrive/d/a/sage/sage/local/lib/python3.7/subprocess.py", line 1453, in _execute_child
  [backports_abc-0.5]       restore_signals, start_new_session, preexec_fn)
  [backports_abc-0.5]   BlockingIOError: [Errno 11] Resource temporarily unavailable
  [backports_abc-0.5]   Cleaning up...

welcome to Cygwin rebase Hell.
One might need to call one of these src/bin/sage-rebase* (sacrificing a black chicken might be a pre-req).

Branch pushed to git repo; I updated commit sha1. New commits:

62f4aa5build/pkgs/cygwin.txt: Add libiconv-devel
0a53429.github/workflows/ci-cygwin.yml: Call rebaseall after extracting SAGE_LOCAL archive

Changed commit from 9f38852 to 0a53429

comment:21

In https://github.com/mkoeppe/sage/runs/572730280 (cygwin-stage-ii-a (minimal)), despite rebasing in the "Extract sage-local artifact" step, I am still getting _fork::abort: address space needed by 'cyglzma-5.dll' (0x400000) is already occupied when building packages

comment:23

#29486 cygwin-standard: rpy2 fails to build

comment:24

cygwin-stage-ii-b (minimal) times out - https://github.com/mkoeppe/sage/runs/572730298 - may need to rebalance stages

comment:25

In https://github.com/mkoeppe/sage/runs/572730287 (cygwin-stage-ii-a (standard)): matplotlib fails to build - numpy-related

     File "/cygdrive/d/a/sage/sage/local/lib/python3.7/site-packages/numpy/matrixlib/__init__.py", line 6, in <module>
        from .defmatrix import *
      File "/cygdrive/d/a/sage/sage/local/lib/python3.7/site-packages/numpy/matrixlib/defmatrix.py", line 13, in <module>
        from numpy.linalg import matrix_power
      File "/cygdrive/d/a/sage/sage/local/lib/python3.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
        from .linalg import *
      File "/cygdrive/d/a/sage/sage/local/lib/python3.7/site-packages/numpy/linalg/linalg.py", line 35, in <module>
        from numpy.linalg import lapack_lite, _umath_linalg
    ImportError: No such file or directory
comment:27

Anyone out there who is interested in cygwin?

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

4d2366btox fixup
828394b.github/workflows/scan-logs.sh: Fixup regex
a39ca99.github/workflows/scan-logs.sh: Rewording for better display
0a02589tox.ini: Store successfully built docker tags in {toxenv}/Dockertags
d209e8etox.yml: Retrieve logs from successful builds via {toxenv}/Dockertags
f1858e7.github/workflows/tox.yml: Pass TARGETS to tox so that errors in doc-html count as failures
f9aca59.github/workflows/scan-logs.sh: Fixup regexp for scanning ptest.log
b32e1bf.github/workflows/scan-logs.sh: Also catch errors of the form ImportError
d94969ctox.ini: Quoting fix
c08176eMerge branch 't/29417/tox-ci-minor-fixes' into t/29403/ci_cygwin_yml__multi_stage_build

Changed commit from 0a53429 to c08176e

comment:29

Merged in #29417 to resolve merge conflicts

Dependencies: #29417

comment:30

As far as I can tell, this is okay, but I am not enough of an expert to say definitively. I would appreciate a second opinion from someone who is more well-versed in the Sage build system to double-check.

comment:31

The issue of comment 21 is not resolved yet

comment:34

well, yes, it was not clear whether rebasing must be done from outside of Cygwin shell, or not.

I gather that we rebase within Cygwin.

By the way, it would be interesting to do testing in Windows WSL...

comment:35

I'll give it another shot, doing exactly what is also done in sage-spkg

Changed commit from c08176e to ffdc97e

Branch pushed to git repo; I updated commit sha1. New commits:

faf0ed6tox.ini: Another quoting fix
aed3fb8src/doc/en/developer/portability_testing.rst: Explain how to read [GitHub](../wiki/GitHub) Actions page
d39d627tox.yml [python3_xcode]: Install the package
ba0c266fixup
9060d23fixup
b7bb418tox.yml [macos-python3_pythonorg]: Use sudo with installer
4b19fddMerge branch 't/29417/tox-ci-minor-fixes' into t/29403/ci_cygwin_yml__multi_stage_build
55c8a48tox.yml: Use rebase.sh
ffdc97efixup merge
comment:37

with these multi-stage builds, where *.so get built at one place, and moved then somewhere esle, it could be that more rebasing is needed. In particular, I recall seeing and fixing rebase locations for Python modules being built.
(Basically it was the issue that totally broke building Sage on Cygwin32, simply due to insufficient address space).

comment:39

Yes, I'm rebasing after unpacking local from the previous stages.

comment:40

I think it's working now, and we can see the real build errors again in cygwin-standard: matplotlib, rpy2, scipy (likely BLAS-related) https://github.com/mkoeppe/sage/runs/596536457

Changed commit from ffdc97e to fc61002

Branch pushed to git repo; I updated commit sha1. New commits:

fc61002ci-cygwin.yml: Package up SAGE_LOCAL/var/tmp/sage/build to avoid error with actions/upload-artifact
comment:44

I cannot reproduce the matplotlib build error locally - even when I download and unpack stage-i-a and stage-i-b (standard) and configure against that.

Branch pushed to git repo; I updated commit sha1. New commits:

59ec460./configure --enable-experimental-packages --enable-download-from-upstream-url
c9cf3ccMerge branch 't/29392/__configure___enable_experimental_packages___enable_download_from_upstream_url' into t/29403/ci_cygwin_yml__multi_stage_build
037f508tox.yml: Pass CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url

Changed commit from fc61002 to 037f508

Changed dependencies from #29417 to #29417, #29392

Changed commit from 037f508 to 998f02d

Branch pushed to git repo; I updated commit sha1. New commits:

998f02dci-cygwin.yml: Fixup for: Package up SAGE_LOCAL/var/tmp/sage/build

Changed commit from 998f02d to d6bf4b1

Branch pushed to git repo; I updated commit sha1. New commits:

d6bf4b1ci-cygwin.yml: Install standard system packages also for 'stndard-python2'
comment:49

how does one need to modify ~/.github/ to make GH Actions only run cygwin tests?

comment:50

Replying to @dimpase:

how does one need to modify ~/.github/ to make GH Actions only run cygwin tests?

Just delete the file tox.yml

Branch pushed to git repo; I updated commit sha1. New commits:

2779e24ci-cygwin.yml: Another fixup for: Package up SAGE_LOCAL/var/tmp/sage/build

Changed commit from d6bf4b1 to 2779e24

Changed commit from 2779e24 to 27ddea3

Branch pushed to git repo; I updated commit sha1. New commits:

27ddea3build/bin/sage-logger: Back out an experimental change

Reviewer: Dima Pasechnik

comment:54

Thanks!