Skip to content

sage_wraps should only read the sources of wrapped functions when needed. #11734

@simon-king-jena

Description

@simon-king-jena

According to private conversation with Francois Bissey, #9976 has introduced a problem that makes it impossible start sage-4.7.1 on Gentoo. That's pretty serious, and so this ticket is a blocker.

The problem is that sage_wraps reads the sources of to-be-wrapped functions and methods. The sources are stored as an attribute to the wrapper, which, on the one hand, is a waste of memory. Worse: Reading the Cython sources is impossible for sage-on-gentoo. Therefore, sage can't start.

My patch introduces some lightweight classes, that simply store a reference to an object (e.g., the to-be-wrapped function) and return the sources or source lines or the argument list only when called.


Apply only attachment: trac11734_sage_wraps_no_sourceread_lambda.proper.patch to the Sage library.

CC: @kiwifb

Component: misc

Keywords: sage_wraps sources gentoo startuptime sd32

Author: Julian Rueth

Reviewer: Simon King

Merged: sage-4.7.2.alpha3

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions