Opened 11 years ago

Closed 2 years ago

#12400 closed defect (invalid)

Get Python to build all needed stuff on FreeBSD

Reported by: Karl-Dieter Crisman Owned by: Peter Jeremy
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: porting: BSD Keywords:
Cc: Peter Jeremy, Jean-Pierre Flori, Dima Pasechnik Merged in:
Authors: Stephen Montgomery-Smith Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Frédéric Chapoton)

On newer versions of FreeBSD, apparently there are some slight changes we need. This is as reported by Stephen Montgomery-Smith on sage-devel, however with Python 2.6, not 2.7 as now used in Sage.

--- python-2.6.4.p13/src/setup.py-orig 2012-01-21 21:42:43.000000000 +0000
+++ python-2.6.4.p13/src/setup.py 2012-01-21 21:45:11.000000000 +0000
@@ -1273,16 +1273,24 @@
                 )
             libraries = []
 
-        elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
+        elif platform in ('freebsd4', 'freebsd5', 'freebsd6'):
             # FreeBSD's P1003.1b semaphore support is very experimental
             # and has many known problems. (as of June 2008)
-            macros = dict(                  # FreeBSD
+            macros = dict(                  # FreeBSD 4-6
                 HAVE_SEM_OPEN=0,
                 HAVE_SEM_TIMEDWAIT=0,
                 HAVE_FD_TRANSFER=1,
                 )
             libraries = []
 
+        elif platform in ('freebsd7', 'freebsd8', 'freebsd9', 'freebsd10'):
+            macros = dict(                  # FreeBSD 7+
+                HAVE_SEM_OPEN=1,
+                HAVE_SEM_TIMEDWAIT=1,
+                HAVE_FD_TRANSFER=1,
+               )
+            libraries = []
+
         elif platform.startswith('openbsd'):
             macros = dict(                  # OpenBSD
                 HAVE_SEM_OPEN=0,            # Not implemented

Attachments (10)

spkg-patch-python-2.7.2.p4_-_src_Doc_library_fcntl.rst (642 bytes) - added by Stephen Montgomery-Smith 11 years ago.
spkg-patch-python-2.7.2.p4_-_src_Modules__ctypes_libffi_configure (742 bytes) - added by Stephen Montgomery-Smith 11 years ago.
spkg-patch-python-2.7.2.p4_-_src_Modules_fcntlmodule.c (2.1 KB) - added by Stephen Montgomery-Smith 11 years ago.
spkg-patch-python-2.7.2.p4_-_src_Python_thread_pthread.h (1.8 KB) - added by Stephen Montgomery-Smith 11 years ago.
spkg-patch-python-2.7.2.p4_-_src_setup.py (1.2 KB) - added by Stephen Montgomery-Smith 11 years ago.
spkg-patch-python_-_src_Doc_library_fcntl.rst (642 bytes) - added by Stephen Montgomery-Smith 10 years ago.
spkg-patch-python_-_src_Modules__ctypes_libffi_configure (742 bytes) - added by Stephen Montgomery-Smith 10 years ago.
spkg-patch-python_-_src_Modules_fcntlmodule.c (2.1 KB) - added by Stephen Montgomery-Smith 10 years ago.
spkg-patch-python_-_src_setup.py (4.6 KB) - added by Stephen Montgomery-Smith 10 years ago.
spkg-patch-python_-_src_Python_thread_pthread.h (1.8 KB) - added by Stephen Montgomery-Smith 10 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 Changed 11 years ago by Stephen Montgomery-Smith

With sage 5.0.beta12, there are now no problems building python under FreeBSD. This ticket can be closed.

Changed 11 years ago by Stephen Montgomery-Smith

Changed 11 years ago by Stephen Montgomery-Smith

Changed 11 years ago by Stephen Montgomery-Smith

Changed 11 years ago by Stephen Montgomery-Smith

Changed 11 years ago by Stephen Montgomery-Smith

comment:2 Changed 11 years ago by Stephen Montgomery-Smith

It turns out that patches are necessary to python-2.7. Otherwise

sage -t  -force_lib "devel/sage/sage/parallel/decorate.py"

fails. All of the needed patches may be taken more or less directly from the FreeBSD port of python-2.7 http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/python27/files/ I have added the necessary patches to this trac ticket.

comment:3 Changed 10 years ago by Karl-Dieter Crisman

Authors: Stephen Montgomery-Smith

Great, so we just need to make an spkg for this.

comment:4 Changed 10 years ago by Jean-Pierre Flori

I'm currently testing 5.9.beta3 with Python 2.7.3 on different FreeBSd releases, I'll report here later when I get to the point of testing decorate.py.

comment:5 Changed 10 years ago by Jean-Pierre Flori

(Note that I had no problems building Python and running it.)

comment:6 Changed 10 years ago by Jean-Pierre Flori

Cc: Jean-Pierre Flori added

comment:7 Changed 10 years ago by Jean-Pierre Flori

These patches are indeed still needed. Let's wait for 2.7.5 to get in at #14600 to include them.

Changed 10 years ago by Stephen Montgomery-Smith

Changed 10 years ago by Stephen Montgomery-Smith

Changed 10 years ago by Stephen Montgomery-Smith

Changed 10 years ago by Stephen Montgomery-Smith

Changed 10 years ago by Stephen Montgomery-Smith

comment:8 Changed 10 years ago by Stephen Montgomery-Smith

I have upgraded the patches a little, to include all the patches from the python27 port in FreeBSD. The extra stuff isn't needed to make python on sage build and pass all the internal tests. But maybe it fixes some other problems for sage python on FreeBSD that we don't know about. (Looking at the file sizes, I think it is only the setup.py patch that is different.)

comment:9 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:10 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:11 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:12 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:13 Changed 7 years ago by Frédéric Chapoton

Description: modified (diff)

comment:14 Changed 2 years ago by Matthias Köppe

Cc: Dima Pasechnik added
Milestone: sage-6.4sage-duplicate/invalid/wontfix
Status: newneeds_review

Outdated spkg or build system ticket, should be closed

comment:15 Changed 2 years ago by Frédéric Chapoton

Resolution: invalid
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.