Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sagelib sdist (src/setup.py sdist) #21516

Closed
mkoeppe opened this issue Sep 17, 2016 · 41 comments
Closed

Fix sagelib sdist (src/setup.py sdist) #21516

mkoeppe opened this issue Sep 17, 2016 · 41 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 17, 2016

This ticket adds some targets to src/Makefile.in: sdist and sdistcheck.
The latter, after building an sdist (using distutils), unpacks it into a subdirectory, and builds and installs (into SAGE_LOCAL) from there.

(cd src && make sdist) gives the following warnings. They need fixing.

warning: sdist: standard file not found: should have one of README, README.txt

(this one is #21565)

reading manifest template 'MANIFEST.in'
warning: sdist: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...

warning: no previously-included files matching '*.h' found under directory 'sage/ext/interpreters'
warning: no previously-included files found matching 'sage/libs/pari/gen.h'
warning: no previously-included files found matching 'sage/modular/arithgroup/farey_symbol.h'
warning: no previously-included files found matching 'sage/rings/real_mpfi.h'
warning: no previously-included files found matching 'sage/symbolic/pynac.h'
warning: no directories found matching 'doc/common/static'
warning: no files found matching 'doc/en/bordeaux_2008/birch.png'
warning: no files found matching 'doc/en/bordeaux_2008/modpcurve.png'
no previously-included directories found matching 'doc/output'

There is something more seriously wrong with the sdist. The sage that is built from there (using (cd src && make sdistcheck)) crashes as follows.

/Users/mkoeppe/s/sage/sage-rebasing/src/sage/ext/interpreters/wrapper_rdf.pxd in init sage.plot.plot3d.parametric_surface (build/cythonized/sage/plot/plot3d/parametric_surface.c:11409)()
      1 # Automatically generated by sage_setup/autogen/interpreters.pyc.  Do not edit!
      2 
      3 from cpython cimport PyObject
      4 
      5 from sage.ext.fast_callable cimport Wrapper
      6 
----> 7 cdef class Wrapper_rdf(Wrapper):
        global cdef = undefined
        global Wrapper_rdf = undefined
        global Wrapper = undefined
      8     cdef int _n_args
      9     cdef double* _args
     10     cdef int _n_constants
     11     cdef double* _constants
     12     cdef object _list_py_constants
     13     cdef int _n_py_constants
     14     cdef PyObject** _py_constants
     15     cdef int _n_stack
     16     cdef double* _stack
     17     cdef int _n_code
     18     cdef int* _code
     19     cdef object _domain
     20     cdef bint call_c(self,
     21                      double* args,
     22                      double* result) except 0

ImportError: No module named wrapper_rdf

This needs fixing.

The branch is on top of #21480.


References:

Other technologies:

See also: #29845 - PEP 517 buildapi for sage_setup

Depends on #13190

CC: @jdemeyer @vbraun @embray @nexttime @kiwifb @dimpase @orlitzky @fchapoton

Component: build

Reviewer: Dima Pasechnik

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

@mkoeppe mkoeppe added this to the sage-7.4 milestone Sep 17, 2016
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

Branch: u/mkoeppe/sagelib_sdist

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

Dependencies: #21480

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

Commit: c7964a0

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

Last 10 new commits:

bd670afIgnore generated files
751bd0fReword TODO item
3a8cc0eFix typo in comment
0dd9c50Respect environment variable MAKE
17f90d8beautification
e5f9065More comments
7791cd9Remove --buildbase code
74169e7Pass SAGE_SRC to generate_py_source.mk
0394333Add new file to MANIFEST.in
c7964a0sdist* Makefile targets

@mkoeppe

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Sep 17, 2016

comment:3

Obviously you are missing an include that would point where to find sage/ext/fast_callable.*. I will have a deeper look.

@kiwifb
Copy link
Member

kiwifb commented Sep 17, 2016

comment:4

So this fails after you built and you try to run ./sage? There may be some points in sage that sets where to find the hierarchy of include files under SAGE_SRC when, once you have installed sage properly you should point to SAGE_LIB (usually SAGE_LOCAL/lib/python2.7/site-package).

If that's the case that may recoup with some concerns I expressed in one of the earlier tickets. sage's internal should be fixed before you do something like that to the build system. Off course I could be wrong :)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

comment:5

Replying to @kiwifb:

So this fails after you built and you try to run ./sage?

Yes.

There may be some points in sage that sets where to find the hierarchy of include files under SAGE_SRC when, once you have installed sage properly you should point to SAGE_LIB (usually SAGE_LOCAL/lib/python2.7/site-package).

I don't understand, could you explain more?

@kiwifb
Copy link
Member

kiwifb commented Sep 17, 2016

comment:6

Is SAGE_SRC pointing to anything or is it blank? From the little bit I see, I am guessing some piece of code is autogenerated at runtime to be compiled and executed. And to work, it needs to have an include (-I$SOMEPATH) that points to the top of the sage python install (SAGE_LIB) or as it is usually wrongly done in sage, where the source is in SAGE_SRC. You would find this in sage/misc/cython.py.

Have to prepare dinner for my family. Be back in about 2-3 hours.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 17, 2016

Changed commit from c7964a0 to 4fe9088

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 17, 2016

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

4fe9088New target: sdistcheck-compare-trees

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 17, 2016

comment:8

I added another debugging helper make sdistcheck-compare-trees, which shows the differences between the source tree and the sdist tree.

There are various differences (for example, all README files are missing); I won't have time to take a closer look before tomorrow.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 30, 2016

Changed dependencies from #21480 to #21480, #21565

@mkoeppe

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 23, 2016

Changed commit from 4fe9088 to 286adb0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 23, 2016

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f93a6a2sdist* Makefile targets
286adb0New target: sdistcheck-compare-trees

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 23, 2016

Changed commit from 286adb0 to 6a314d7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 23, 2016

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

4c6efbdreconfigure if src/Makefile.in changed
be24c34New target 'make sagelib-sdistcheck'
376bf1aRefactor sdistcheck targets and fix dependencies
6a314d7More work on sdistcheck-compare-trees

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 23, 2016

comment:12

This ticket needs some help from the distutils experts

@mkoeppe mkoeppe modified the milestones: sage-7.4, sage-7.5 Oct 23, 2016
@embray
Copy link
Contributor

embray commented Nov 7, 2016

comment:13

What can I help with?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 10, 2016

comment:14

Replying to @embray:

What can I help with?

I'd need help in figuring out why some files are missing in the sdist and what is the idiomatic way (or the most appropriate way for Sage) of adding them.

@embray
Copy link
Contributor

embray commented Nov 10, 2016

comment:15

I think this calls for a cleaning up of the MANIFEST.in. I'll play around with it.

@embray
Copy link
Contributor

embray commented Nov 10, 2016

comment:16

I think that #21682 might help with this issue as well. As I've repeatedly suggested, it's best to include Cythonized sources in the sdist (taking the onus off the user to create the files with the correct version of Cython--especially important since we currently use a patched Cython for Sage...). This would also ensure that generated modules like the pari interfaces are included (on possible problem with this is if we want to be able to target different versions of pari--that's a problem to be pushed down the line though...)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 6, 2020

comment:17

@embray This is the ticket that I mentioned in #26964.

@mkoeppe mkoeppe modified the milestones: sage-7.5, sage-9.1 Feb 6, 2020
@Shlokatadistance
Copy link
Mannequin

Shlokatadistance mannequin commented Mar 30, 2020

comment:19

Can you tell me how did that error go from no previously-included files to. no directories found, the time I recreated this error, this happened after I had quit the command of ./sage

@Shlokatadistance
Copy link
Mannequin

Shlokatadistance mannequin commented Apr 4, 2020

comment:20

Also I had obtained such an error after a direct installation of SageMath as an application, did you do it the same way? or was it through the tar file and unpacking?

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 9, 2020
@dimpase
Copy link
Member

dimpase commented May 16, 2020

comment:22

Is this still relevant? Has the world converged onto distributing via pip?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 16, 2020

comment:23

Yes, still need to fix this.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 17, 2020

Changed commit from 6a314d7 to 086fc86

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 17, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8ce279csdist* Makefile targets
3abffd8New target: sdistcheck-compare-trees
9c7ecbeNew target 'make sagelib-sdistcheck'
4d8b72cRefactor sdistcheck targets and fix dependencies
086fc86More work on sdistcheck-compare-trees

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 17, 2020

Changed commit from 086fc86 to 51c4da6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 17, 2020

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

51c4da6src/MANIFEST.in: prune .tox

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 11, 2020

Changed dependencies from #21480, #21565 to #13190

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 25, 2020

comment:29

Development continues on #29950 (Build sagelib using the installed sage_setup, add spkg-src). This ticket can be closed.

@mkoeppe mkoeppe removed this from the sage-9.2 milestone Jun 25, 2020
@dimpase
Copy link
Member

dimpase commented Jul 16, 2020

Reviewer: Dima Pasechnik

@slel
Copy link
Member

slel commented Oct 11, 2020

Changed branch from u/mkoeppe/sagelib_sdist to none

@slel
Copy link
Member

slel commented Oct 11, 2020

Changed author from Matthias Koeppe to none

@slel
Copy link
Member

slel commented Oct 11, 2020

Changed commit from 51c4da6 to none

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

No branches or pull requests

5 participants