Opened 15 years ago

Closed 15 years ago

#24545 closed defect (fixed)

python27 @2.7b1 patch of Makefile.pre.in fails on 10.6.3

Reported by: macports-trac@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: jschwab@…, ryandesign (Ryan Carsten Schmidt), lists.pascal.juergens@…, Themanwithoutaplan, gale@…
Port: python27

Description

This is verified with a total uninstall/clean --all/install of python27.

Problem: the patch file patch-Makefile.pre.in.diff fails on the first hunk because the diff isn't based on the same Makefile.pre.in that ships with the port.

Patch file says:

@@ -394,8 +394,8 @@
 # Build the shared modules
 sharedmods: $(BUILDPYTHON)
 	@case $$MAKEFLAGS in \
-	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
-	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q --no-user-cfg build;; \
+	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py --no-user-cfg build;; \
 	esac
 
 # Build static library

But Makefile.pre.in from the port starts at line 394 with:

# Build the interpreter
$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
			Modules/python.o \
			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

platform: $(BUILDPYTHON)
	$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform


# Build the shared modules
sharedmods: $(BUILDPYTHON)
	@case $$MAKEFLAGS in \
	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
	esac

# Build static library

Output snippet showing the failure:

& /usr/bin/patch -p0'
patching file Makefile.pre.in
Hunk #1 FAILED at 394.
Hunk #2 succeeded at 1043 (offset 50 lines).
Hunk #3 succeeded at 1116 (offset 43 lines).
1 out of 3 hunks FAILED -- saving rejects to file Makefile.pre.in.rej
Error: Target org.macports.patch returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python27/work/Python-2.7b1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/python27/files/patch-Makefile.pre.in.diff'" returned error 1
DEBUG: Backtrace: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python27/work/Python-2.7b1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/python27/files/patch-Makefile.pre.in.diff'" returned error 1
    while executing
"command_exec patch "" "< '$patch'""
    (procedure "portpatch::patch_main" line 33)
    invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for python27): org.macports.destroot org.macports.patch org.macports.configure org.macports.build

Workaround:

  1. Edit portfile to remove patch-Makefile.pre.in.diff from the list of patchfiles.
  1. Edit Makefile.pre.in to look like what the patch is trying to do.

Attachments (1)

patch-Makefile.pre.in.diff (1.5 KB) - added by Themanwithoutaplan 15 years ago.
Updated patchfile

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to jwa@…

comment:2 Changed 15 years ago by jschwab@…

Cc: jschwab@… added

Cc Me!

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Cc Me!

comment:4 Changed 15 years ago by lists.pascal.juergens@…

Cc: lists.pascal.juergens@… added

Cc Me!

Changed 15 years ago by Themanwithoutaplan

Attachment: patch-Makefile.pre.in.diff added

Updated patchfile

comment:5 Changed 15 years ago by Themanwithoutaplan

I copied the two lines to be replaced from the Makefile-in

Put my patch in /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/python27/files.

I think the diff headers may need correcting but Python 2.7 builds and runs.

comment:6 Changed 15 years ago by Themanwithoutaplan

Cc: charlie.clark@… added

Cc Me!

comment:7 Changed 15 years ago by gale@…

Cc: gale@… added

Cc Me!

comment:8 Changed 15 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: newclosed

Fixed patchfile in r67469. Maintainer timeout.

Note: See TracTickets for help on using tickets.