Opened 13 months ago

Closed 11 days ago

#28513 closed defect (duplicate)

Make sure sage starts before building packages that depend on sagelib

Reported by: embray Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords:
Cc: Merged in:
Authors: Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

A problem that is occurring frequently in reports of build problems is failures during building sagenb, like

[sagenb-1.1.2] reading sources... [ 15%] misc/misc
[sagenb-1.1.2]
[sagenb-1.1.2] Exception occurred:
[sagenb-1.1.2]   File "sage/misc/lazy_import.pyx", line 218, in sage.misc.lazy_import.LazyImport._get_object (build/cythonized/sage/misc/lazy_import.c:2502)
[sagenb-1.1.2]     raise RuntimeError(f"resolving lazy import {self._name} during startup")
[sagenb-1.1.2] RuntimeError: resolving lazy import dumps during startup
[sagenb-1.1.2] The full traceback has been saved in /var/folders/qf/wr6_n5s56m780kv130nznmlc0000gn/T/sphinx-err-MzyE1A.log, if you want to report the issue to the developers.
[sagenb-1.1.2] Please also report this if it was a user error, so that a better error message can be provided next time.

However, the problem has nothing to do with sagenb--rather it's because sagenb's own build process uses sagelib, and if there was a problem building sagelib properly (such that the build succeeded without failure, but still has runtime problems) it means the build will fail for any packages that depend on sagelib.

We should somehow update the Makefile so that after building sagelib it is tested immediately, and the build is failed before building any further packages, if sage fails to start (and also it would be helpful to display any actual errors to the install log / stdout).

(Currently sagenb is the only standard package that depends on sagelib being built, and it is being slowly phased out. However, there are optional packages that depend on sage, and may be more standard packages in the future.)

Change History (8)

comment:1 Changed 13 months ago by dimpase

Do you know how reliably break Sage so that ./sage -f sagenb will break as above?

comment:2 Changed 13 months ago by embray

You could do almost anything really--e.g. remove a module that's imported at startup. The last two times I saw this come up it's because the sqlite3 module for Python didn't build (something which should also be checked; that's #27705).

comment:3 Changed 13 months ago by dimpase

Thanks,

mv local/lib/python2.7/lib-dynload/_sqlite3.so local/lib/python2.7/lib-dynload/_sqlite3.so.bak

does the "job" :-)

comment:4 Changed 13 months ago by dimpase

The following makes ./sage -f sagenb fail with a meaningful error if Sage is broken

  • build/pkgs/sagenb/dependencies

    a b  
    1 $(PYTHON) | $(SAGERUNTIME) pip babel flask flask_autoindex flask_babel flask_oldsessions flask_openid mathjax twisted sphinx
     1$(PYTHON) $(STARTED) | $(SAGERUNTIME) pip babel flask flask_autoindex flask_babel flask_oldsessions flask_openid mathjax twisted sphinx
    22
    33----------
    44All lines of this file are ignored except the first.

(and works if Sage is OK) This obviously may be simplified to

  • build/pkgs/sagenb/dependencies

    a b  
    1 $(PYTHON) | $(SAGERUNTIME) pip babel flask flask_autoindex flask_babel flask_oldsessions flask_openid mathjax twisted sphinx
     1$(STARTED) | pip babel flask flask_autoindex flask_babel flask_oldsessions flask_openid mathjax twisted sphinx
    22
    33----------
    44All lines of this file are ignored except the first.

and possibly even more. What's a bit worrying me here is why this is not a circular dependency.

Last edited 13 months ago by dimpase (previous) (diff)

comment:5 Changed 12 months ago by dimpase

I have added the change in comment:4 to the branch in #28710.

comment:6 Changed 4 weeks ago by mkoeppe

  • Milestone changed from sage-wishlist to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

The package used as an example in the description has been removed. Should this same problem surface for any other packages, its dependencies should be changed as discussed here. Let's close this.

comment:7 Changed 4 weeks ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

ok

comment:8 Changed 11 days ago by slelievre

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.