[Zope-CVS] CVS: Packages/WinBuilders/mk - common.mk:1.3.2.2 python.mk:1.7.2.1 zeo.mk:1.4.2.1

Tim Peters tim.one at comcast.net
Sun Feb 1 00:33:50 EST 2004


Update of /cvs-repository/Packages/WinBuilders/mk
In directory cvs.zope.org:/tmp/cvs-serv10965/mk

Modified Files:
      Tag: tim-zrs-branch
	common.mk python.mk zeo.mk 
Log Message:
Total overhaul of the way Python gets built:  we just extract precompiled
code out of the python.org Windows installer now.  Building Python from
scratch on Windows has gotten ever more complex since 2.1, and much more
so than on Linux because the Windows distro has to supply a large and
growing number of external packages too (from Sleepycat bsddb to
OpenSLL and zlib).

So you need to grab the Windows installer from python.org now, but no
longer need to get (or try to build) a dozen other non-Python packages.
Indeed, "building Python" doesn't even require a compiler now.

Also removed the test_python target, in large part because it didn't
test the Python we *install*, it tested the Python build tree, and
they're not the same thing.  The python.org Python has been tested
already, and the way we install Python is still too incomplete for many
tests to have any chance of passing from the build/ directory (basically
because the test directory and its subdirectories contain lots of
non-.py files needed to run and check the tests, and we don't install
any of those).

Changed the ZEO build process to use the Python in the build/ directory
instead of the one in the src/ directory.  Two reasons:  (1) at least
that gives *some* exercise to the Python setup in the build/ directory
(we previously didn't use it for anything, except as input to Inno
Setup); and, (2) since we're not compiling anything in the src/
directory anymore, we can't run a Python from there anymore even if
we wanted to.

The Zope build process on this branch is probably broken in that respect
now.


=== Packages/WinBuilders/mk/common.mk 1.3.2.1 => 1.3.2.2 ===
--- Packages/WinBuilders/mk/common.mk:1.3.2.1	Sat Jan 31 21:29:49 2004
+++ Packages/WinBuilders/mk/common.mk	Sun Feb  1 00:33:49 2004
@@ -37,19 +37,10 @@
 PRODUCTS_DIR=build/instance/Products
 
 PYLIBDIR=build/instance/lib/python
-
-CUSTOM_REPO_TAIL=korak.zope.com:/cvs-customer/TurboIntranet
-
-CUSTOM_CVS_REPOSITORY=:ext:${CUSTOM_REPO_TAIL}
-
-SHARED_REPO_TAIL=korak.zope.com:/cvs-customer/Shared
-
-SHARED_CUSTOMER_REPOSITORY=:ext:${SHARED_REPO_TAIL}
-
+ 
 ZOPE_CVS_REPOSITORY=:pserver:anonymous at cvs.zope.org:/cvs-repository
 
 CVS=/usr/bin/cvs -z7 -q
 CVS_UPDATE=${CVS} update -dP
 
 CVSROOT=:ext:korak.zope.com:/cvs-turbointranet
-


=== Packages/WinBuilders/mk/python.mk 1.7 => 1.7.2.1 ===
--- Packages/WinBuilders/mk/python.mk:1.7	Wed Jan 28 11:35:55 2004
+++ Packages/WinBuilders/mk/python.mk	Sun Feb  1 00:33:49 2004
@@ -1,209 +1,127 @@
-# Operation notes:
-
-# During the Python build, the bsddb and _tkinter modules
-# build failures are expected.  No other build failures should occur.
-
-# test_python tests for largefile support; this requires over 2GB of
-# free space on windws because windows has no notion of sparse files.
-
-# No test_python tests are expected to fail on windows, but some tests
-# will be skipped.  Here are the tests for Python 2.2.3 that are expected
-# to be skipped:
-
-#   test_bsddb
-#   test_cd
-#   test_cl
-#   test_commands
-#   test_crypt
-#   test_curses
-#   test_dbm
-#   test_dl
-#   test_email_codecs
-#   test_fcntl
-#   test_fork1
-#   test_gdbm
-#   test_gl
-#   test_grp
-#   test_imgfile
-#   test_linuxaudiodev
-#   test_mhlib
-#   test_nis
-#   test_optnpty
-#   test_poll
-#   test_pty
-#   test_pwd
-#   test_signal
-#   test_socket_ssl
-#   test_sunaudiodev
-#   test_timing
-
-# some deprecation warnings about :complex divmod(), // and % are deprecated"
-# are expected during the test run as well
-
-PYTHON_REQUIRED_FILES=tmp/$(ZLIBDIRNAME).tar.gz \
-               tmp/expat_win32bin_$(EXPATVERSION).exe \
-               tmp/$(W32ALLDIRNAME).exe \
-               tmp/$(PYDIRNAME).tgz \
-
-PYPROJECTS=pythoncore python pythonw parser _socket _sre \
-           _symtable _testcapi mmap select unicodedata w9xpopen winreg \
-           winsound datetime _bsddb pyexpat zlib \
+# The Python and win32all versions.  For Python, both the source tarball
+# and the Windows installer must be in tmp/.  For win32all, the Windows
+# installer must be in tmp/.  Nothing beyond those is required to
+# build Python, and you don't even need a compiler for this part.
+PYVERSION=2.3.3
+W32ALLVERSION=163
 
-PYPROJECTS_BUILDFLAGS=$(PYPROJECTS:%=$(PYPCBUILDDIR)/%.builtflag)
+# CAUTION:  Extracting files from Wise installers doesn't really do what
+# you expect.  While a Wise installer is a zip file, the zip file
+# structure is flat (Wise reconstructs the intended directory structure
+# from metadata stored in proprietary FILEnnnn.DAT files also in the
+# zip file).  Consequently, the package structure of Python packages is
+# lost, and if there's more than one file with the same name, you only
+# get "the last one" to be extracted (all files are extracted to the
+# same directory).
+#
+# For Python, this doesn't matter, because we're only sucking out the
+# precompiled .pyd and .exe files from the Python installer -- there
+# are no name clashes in that set, and it's a pretty safe bet there never
+# will be (else Python wouldn't be able to decide which to use!).  We
+# use the Python source tarball to get all the non-executable parts we
+# need.
+#
+# For win32all, I'm not sure what all the consequences are.  Zope has
+# gotten away with it so far.  Favoring it, Zope makes little use of
+# win32all.  Against it, there's (as of the time of this writing) little
+# field experience with Windows Zope after Python 2.1.  Python and
+# win32all have both gotten hairier since then, and win32all has
+# significant package structure with many instances of files with the
+# same name in different subtrees.  For now it's poke-and-hope.
 
-PYVERSION=2.3.3
 PYDIRNAME=Python-$(PYVERSION)
-PYSRCDIR=$(BASE_DIR)/src/$(PYDIRNAME)
-WIN_PYSRCDIR=$(shell cygpath -w $(PYSRCDIR))
-PYPCBUILDDIR=$(PYSRCDIR)/PCbuild
-WIN_PYPCBUILDDIR=$(shell cygpath -w $(PYPCBUILDDIR))
-SETPATH=import sys; \
-       sys.path=['$(WIN_PYSRCDIR)\\Lib\\test','$(WIN_PYPCBUILDDIR)','$(WIN_PYSRCDIR)\\Lib']
-PYTESTCMD=$(SETPATH); from test import regrtest; \
-          regrtest.main(use_resources=['largefile','network'])
-
-W32ALLVERSION=163
 W32ALLDIRNAME=win32all-$(W32ALLVERSION)
 
-EXPATVERSION=1_95_6
+# The Python tarball is extracted to PYSRCDIR.
+# The contents of the Python installer get extracted to PYEXTRACTDIR.
+# The    "      "  "  win32all   "      "     "       " W32EXTRACTDIR.
+PYSRCDIR=$(BASE_DIR)/src/$(PYDIRNAME)
+PYEXTRACTDIR=$(BASE_DIR)/src/$(PYDIRNAME)-extract
+W32EXTRACTDIR=$(BASE_DIR)/src/$(W32ALLDIRNAME)
 
-ZLIBVERSION=1.1.4
-ZLIBDIRNAME=zlib-$(ZLIBVERSION)
+WIN_PYSRCDIR=$(shell cygpath -w $(PYSRCDIR))
+WIN_PYEXTRACTDIR=$(shell cygpath -w $(PYEXTRACTDIR))
+WIN_W32EXTRACTDIR=$(shell cygpath -w $(W32EXTRACTDIR))
 
-VC=msdev
+PYTHON_REQUIRED_FILES=tmp/$(W32ALLDIRNAME).exe \
+                      tmp/$(PYDIRNAME).tgz \
+                      tmp/$(PYDIRNAME).exe
+
+# Arbitrary files from each of the installers and tarballs, to use as
+# targets to force them to get unpacked.
+ARB_PYSRCDIR=$(PYSRCDIR)/PCbuild/pcbuild.dsw
+ARB_PYEXTRACTDIR=$(PYEXTRACTDIR)/zlib.pyd
+ARB_W32EXTRACTDIR=$(W32EXTRACTDIR)/readme.txt
 
-.PHONY: $(PYPROJECTS)
+# Building Python just consists of extracting files.
+build_python: $(ARB_PYSRCDIR) $(ARB_PYEXTRACTDIR) $(ARB_W32EXTRACTDIR)
 
-# run the standard python test suite (including largefile and network tests)
-test_python:
-	"$(PYPCBUILDDIR)/python.exe" -c "$(PYTESTCMD)"
-
-# build python from source
-# also copy files around to allow the generated python to compile extensions
-# in-place
-build_python: $(PYPCBUILDDIR)/pcbuild.dsw \
-              $(PYPCBUILDDIR)/libexpat.dll \
-              patch_pyexpat \
-              src/expat/Source/expat.dsw \
-              src/$(ZLIBDIRNAME)/zlib.h \
-              src/$(W32ALLDIRNAME)/readme.txt \
-              $(PYPROJECTS_BUILDFLAGS) \
-              $(PYSRCDIR)/Include/pyconfig.h \
-              $(PYSRCDIR)/libs/python23.lib
-
-$(PYSRCDIR)/Include/pyconfig.h:
-	$(MKDIR) "$(PYSRCDIR)/Include"
-	$(CP) "$(PYSRCDIR)/PC/pyconfig.h" "$(PYSRCDIR)/Include"
-
-
-$(PYSRCDIR)/libs/python23.lib:
-	$(MKDIR) "$(PYSRCDIR)/libs"
-	$(CP) "$(PYPCBUILDDIR)/python23.lib" "$(PYSRCDIR)/libs"
-
-$(PYPROJECTS_BUILDFLAGS):
-	$(CD) $(PYPCBUILDDIR); \
-           MAKEFLAGS=; export MAKEFLAGS;\
-           $(VC) pcbuild.dsw /MAKE "$(@F:%.builtflag=%) - Win32 Release" /OUT \
-           $(@F:%.builtflag=%.buildlog)
-	$(TOUCH) "$@"
-
-patch_pyexpat: $(PYPCBUILDDIR)/pyexpat.org
-
-# patch pyexpat.dsp (Python VC++ project file) as it has an improper
-# declaration
-$(PYPCBUILDDIR)/pyexpat.org: EXPAT_SED="s@\\\\expat.lib@\\\\libexpat.lib at g"
-$(PYPCBUILDDIR)/pyexpat.org:
-	$(CP) "$(PYPCBUILDDIR)/pyexpat.dsp" "$(PYPCBUILDDIR)/pyexpat.org"
-	$(SED) $(EXPAT_SED)  < "$(PYPCBUILDDIR)/pyexpat.dsp" | unix2dos  > "$(PYPCBUILDDIR)/pyexpat.new"
-	$(CP) "$(PYPCBUILDDIR)/pyexpat.new" "$(PYPCBUILDDIR)/pyexpat.dsp"
-	$(TOUCH) "$(PYPCBUILDDIR)/pyexpat.org"
-
-$(PYPCBUILDDIR)/libexpat.dll: src/expat/Source/expat.dsw \
-                              $(PYPCBUILDDIR)/pcbuild.dsw
-	$(CP) "$(SRC_DIR)/expat/Libs/libexpat.dll" "$(PYPCBUILDDIR)"
-	$(TOUCH) "$(PYPCBUILDDIR)/libexpat.dll"
+# Installing Python consists of copying oodles of files into
+# $(BUILD_DIR).
+install_python: $(BUILD_DIR)/bin/python.exe
 
 clean_python:
-	$(RMRF) src/$(PYDIRNAME)
+	$(RMRF) $(PYSRCDIR)
+	$(RMRF) $(PYEXTRACTDIR)
 
 clean_libs:
-	$(RMRF) src/expat
-	$(RMRF) src/$(ZLIBDIRNAME)
-	$(RMRF) src/$(W32ALLDIRNAME)
+	$(RMRF) $(W32EXTRACTDIR)
 
-install_python: $(BUILD_DIR)/bin/python.exe
+$(ARB_PYSRCDIR): tmp/$(PYDIRNAME).tgz
+	$(MKDIR) "$(SRC_DIR)"
+	$(CD) "$(SRC_DIR)" && $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz
+	$(TOUCH) "$(ARB_PYSRCDIR)"
+
+$(ARB_PYEXTRACTDIR): tmp/$(PYDIRNAME).exe
+	$(MKDIR) "$(PYEXTRACTDIR)"
+	"tmp/$(PYDIRNAME).exe" /S /X "$(WIN_PYEXTRACTDIR)"
+	$(TOUCH) "$(ARB_PYEXTRACTDIR)"
+
+$(ARB_W32EXTRACTDIR): tmp/$(W32ALLDIRNAME).exe
+	$(MKDIR) "$(W32EXTRACTDIR)"
+	"tmp/$(W32ALLDIRNAME).exe" /S /X "$(WIN_W32EXTRACTDIR)"
+	$(TOUCH) "$(ARB_W32EXTRACTDIR)"
 
 $(BUILD_DIR)/bin/python.exe:
 	$(MKDIR) "$(BUILD_DIR)"
 
 	$(MKDIR) "$(BUILD_DIR)/doc"
-	$(CP) "$(MAKEFILEDIR)/doc/ZC_PY_DIST_README.txt" \
-             "$(BUILD_DIR)/doc"
+	$(CP) "$(MAKEFILEDIR)/doc/ZC_PY_DIST_README.txt" "$(BUILD_DIR)/doc"
 	$(CP) "$(PYSRCDIR)/LICENSE" "$(BUILD_DIR)/doc/PYTHON_LICENSE.txt"
 	$(CP) "$(SRC_DIR)/$(W32ALLDIRNAME)/License.txt" \
-            "$(BUILD_DIR)/doc/WIN32ALL_LICENSE.txt"
-	$(CP) "$(SRC_DIR)/expat/COPYING.txt" \
-            "$(BUILD_DIR)/doc/EXPAT_LICENSE.txt"
-	$(CP) "$(SRC_DIR)/$(ZLIBDIRNAME)/README" \
-            "$(BUILD_DIR)/doc/ZLIB_LICENSE.txt"
-
-	$(MKDIR) "$(BUILD_DIR)/bin"
-	$(CP) "$(PYPCBUILDDIR)/python.exe" "$(BUILD_DIR)/bin"
-	$(CP) "$(PYPCBUILDDIR)/pythonw.exe" "$(BUILD_DIR)/bin"
-	$(CP) "$(PYPCBUILDDIR)/w9xpopen.exe" "$(BUILD_DIR)/bin"
-	$(CP) "$(PYPCBUILDDIR)/python23.dll" "$(BUILD_DIR)/bin"
+	      "$(BUILD_DIR)/doc/WIN32ALL_LICENSE.txt"
 
 	$(MKDIR) "$(BUILD_DIR)/bin/DLLs"
-	$(XCOPY) "$(WIN_PYPCBUILDDIR)\*.pyd" "$(WIN_BUILD_DIR)\bin\DLLs"
-	$(CP) "$(PYPCBUILDDIR)/libexpat.dll" "$(BUILD_DIR)/bin/DLLs"
+	$(XCOPY) "$(WIN_PYEXTRACTDIR)\*.pyd" "$(WIN_BUILD_DIR)\bin\DLLs"
 
 	$(MKDIR) "$(BUILD_DIR)/bin/Lib"
 	$(XCOPY) "$(WIN_PYSRCDIR)\Lib\*.py" "$(WIN_BUILD_DIR)\bin\Lib"
 	$(MKDIR) "$(BUILD_DIR)/bin/Lib/site-packages"
 	$(CP) "$(PYSRCDIR)/Lib/site-packages/README" \
-             "$(BUILD_DIR)/bin/Lib/site-packages"
-	$(XCOPY) "$(WIN_SRC_DIR)\$(W32ALLDIRNAME)\*.pyd" \
-             "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
-	$(XCOPY) "$(WIN_SRC_DIR)\$(W32ALLDIRNAME)\*.dll" \
-             "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
-	$(XCOPY) "$(WIN_SRC_DIR)\$(W32ALLDIRNAME)\*.exe" \
-             "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
-	$(XCOPY) "$(WIN_SRC_DIR)\$(W32ALLDIRNAME)\*.py" \
-             "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
+	      "$(BUILD_DIR)/bin/Lib/site-packages"
+	$(XCOPY) "$(WIN_W32EXTRACTDIR)\*.pyd" \
+	         "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
+	$(XCOPY) "$(WIN_W32EXTRACTDIR)\*.dll" \
+		 "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
+	$(XCOPY) "$(WIN_W32EXTRACTDIR)\*.exe" \
+		 "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
+	$(XCOPY) "$(WIN_W32EXTRACTDIR)\*.py" \
+		 "$(WIN_BUILD_DIR)\bin\Lib\site-packages"
+
 	$(CP) "$(MAKEFILEDIR)/etc/sitecustomize.py" \
-             "$(BUILD_DIR)/bin/Lib/site-packages"
+	      "$(BUILD_DIR)/bin/Lib/site-packages"
 
 	$(MKDIR) "$(BUILD_DIR)/bin/Include"
 	$(XCOPY) "$(WIN_PYSRCDIR)\Include\*.h" "$(WIN_BUILD_DIR)\bin\Include"
 	$(XCOPY) "$(WIN_PYSRCDIR)\PC\*.h" "$(WIN_BUILD_DIR)\bin\Include"
 
 	$(MKDIR) "$(BUILD_DIR)/bin/libs"
-	$(CP) "$(PYPCBUILDDIR)/python23.lib" "$(BUILD_DIR)/bin/libs"
-
-	$(CD) "$(BASE_DIR)"
+	$(CP) "$(PYEXTRACTDIR)/python23.lib" "$(BUILD_DIR)/bin/libs"
 
+	$(MKDIR) "$(BUILD_DIR)/bin"
+	$(CP) "$(PYEXTRACTDIR)/pythonw.exe" "$(BUILD_DIR)/bin"
+	$(CP) "$(PYEXTRACTDIR)/w9xpopen.exe" "$(BUILD_DIR)/bin"
+	$(CP) "$(PYEXTRACTDIR)/python23.dll" "$(BUILD_DIR)/bin"
+	$(CP) "$(PYEXTRACTDIR)/python.exe" "$(BUILD_DIR)/bin"
 	$(TOUCH) "$(BUILD_DIR)/bin/python.exe"
-
-src/expat/Source/expat.dsw: tmp/expat_win32bin_$(EXPATVERSION).exe
-	$(MKDIR) "$(SRC_DIR)"
-	tmp/expat_win32bin_$(EXPATVERSION).exe \
-               /SP /VERYSILENT /NOCANCEL /NORESTART \
-               /DIR="$(WIN_BASE_DIR)\src\expat" /NOICONS
-	$(TOUCH) "src/expat/Source/expat.dsw"
-
-$(PYPCBUILDDIR)/pcbuild.dsw: tmp/$(PYDIRNAME).tgz
-	$(MKDIR) "$(SRC_DIR)"
-	$(CD) "$(SRC_DIR)" && $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz && \
-            $(TOUCH) "$(PYPCBUILDDIR)/pcbuild.dsw"
-
-src/$(ZLIBDIRNAME)/zlib.h: tmp/$(ZLIBDIRNAME).tar.gz
-	$(MKDIR) "$(SRC_DIR)"
-	$(CD) "$(SRC_DIR)"; $(TAR) xvzf ../tmp/$(ZLIBDIRNAME).tar.gz; \
-            $(TOUCH) "$(ZLIBDIRNAME)/zlib.h"
-
-src/$(W32ALLDIRNAME)/readme.txt: tmp/$(W32ALLDIRNAME).exe
-	$(MKDIR) "$(SRC_DIR)/$(W32ALLDIRNAME)"
-	"$(BASE_DIR)/tmp/$(W32ALLDIRNAME).exe" \
-            /S /X "$(WIN_SRC_DIR)\$(W32ALLDIRNAME)"
-	$(TOUCH) "src/$(W32ALLDIRNAME)/readme.txt"
 


=== Packages/WinBuilders/mk/zeo.mk 1.4 => 1.4.2.1 ===
--- Packages/WinBuilders/mk/zeo.mk:1.4	Fri Jan 30 01:18:12 2004
+++ Packages/WinBuilders/mk/zeo.mk	Sun Feb  1 00:33:49 2004
@@ -25,7 +25,7 @@
 $(BUILD_DIR)/lib/python/ExtensionClass.pyd: install_python
 	$(MKDIR) $(WIN_TMPDIR)
 	$(CD) $(SRC_DIR)/$(ZODBDIRNAME); \
-            $(PYPCBUILDDIR)/python.exe setup.py install \
+            $(BUILD_DIR)/bin/python.exe setup.py install \
             --prefix="$(WIN_BASE_DIR)\$(WIN_TMPDIR)" --no-compile
 	$(MKDIR) $(@D)
 	$(XCOPY) "$(WIN_TMPDIR)\Lib\site-packages\*.py" "$(shell cygpath -w $(@D))"




More information about the Zope-CVS mailing list