Hi, Just to let you know that if you use a temporary build directory to build Zope 2.10, the setup.py script fails. I know, I am using python 2.5 (making some tests) but this issue is unrelated. Below, "build" is an empty directory and "src" is the untared Zope source. STEP 1 cd build/Zope-2.10.0-b2 && /opt/pperegri/F2BUILDS/F2.15/src/Zope-2.10.0-b2/configure --prefix=/opt/pperegri/F2BUILDS/F2.15/opt/Zope-2.10.0-b2 --optimize --with-python=/opt/pperegri/F2BUILDS/F2.15/opt/Python-2.5/bin/python Using Python interpreter at /opt/pperegri/F2BUILDS/F2.15/opt/Python-2.5/bin/python Configuring Zope installation - Zope top-level binary directory will be /opt/pperegri/F2BUILDS/F2.15/opt/Zope-2.10.0-b2. - Distutils install flags will be "--optimize=1 --no-compile" - Makefile written. Next, run make. => OK (generates makefile in the build directory) STEP 2 "/opt/pperegri/F2BUILDS/F2.15/opt/Python-2.5/bin/python" "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.10.0-b2/setup.py" \ build --build-base="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.10.0-b2/build-base/p ython-2.5" --build-lib="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.10.0-b2/build-base/py thon-2.5/build-lib" --build-scripts="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.10.0-b2/build-bas e/python-2.5/build-scripts" --build-temp="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.10.0-b2/build-base/p ython-2.5/build-temp" => FAILURE: Traceback (most recent call last): File "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.10.0-b2/setup.py", line 53, in <module> import versions ImportError: No module named versions make: *** [build] Error 1 CAUSE: The problem comes from this code in setup.py (which did not exist in Zope 2.8): sys.path.insert(0, 'inst') import versions del sys.path[0] ZOPE_VERSION = '%s%s-%s' % (versions.ZOPE_MAJOR_VERSION, versions.ZOPE_MINOR_VERSION, versions.VERSION_RELEASE_TAG) If I change it to: try: MAKEFILEDIR = os.path.dirname(os.path.abspath(__file__)) except: MAKEFILEDIR = os.path.dirname(os.path.abspath(sys.argv[0])) sys.path.insert(0, '%s/inst'%MAKEFILEDIR) import versions del sys.path[0] ZOPE_VERSION = '%s%s-%s' % (versions.ZOPE_MAJOR_VERSION, versions.ZOPE_MINOR_VERSION, versions.VERSION_RELEASE_TAG) Everything works fine. Thanks for reading up to this point :) Pascal ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
--On 21. September 2006 11:06:36 +0200 Pascal Peregrina <Pperegrina@Lastminute.com> wrote:
Hi,
Just to let you know that if you use a temporary build directory to build Zope 2.10, the setup.py script fails.
I know, I am using python 2.5 (making some tests) but this issue is unrelated.
Below, "build" is an empty directory and "src" is the untared Zope source.
STEP 1
cd build/Zope-2.10.0-b2 && /opt/pperegri/F2BUILDS/F2.15/src/Zope-2.10.0-b2/configure --prefix=/opt/pperegri/F2BUILDS/F2.15/opt/Zope-2.10.0-b2 --optimize --with-python=/opt/pperegri/F2BUILDS/F2.15/opt/Python-2.5/bin/python
The documentation states *clearly* that Python 2.4.X is required. -aj
Ok, next time please trust me when I say that this is unrelated to python version... I get the exact same issue with: + Zope 2.9.4 + Python 2.4.3 make "/opt/pperegri/F2BUILDS/F2.15/opt/Python-2.4.3/bin/python" "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.9.4-final/setup.py" \ build --build-base="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.9.4-final/build-base /python-2.4" --build-lib="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.9.4-final/build-base/ python-2.4/build-lib" --build-scripts="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.9.4-final/build-b ase/python-2.4/build-scripts" --build-temp="/opt/pperegri/F2BUILDS/F2.15/build/Zope-2.9.4-final/build-base /python-2.4/build-temp" Traceback (most recent call last): File "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.9.4-final/setup.py", line 53, in ? import versions ImportError: No module named versions make: *** [build] Error 1 And my exact same hack as initially described works there too. The faulty code does not look very "clean" anyway (playing with the sys.path just to import the versions module) Thanks. Pascal
De : Andreas Jung <lists@zopyx.com> Répondre à : Andreas Jung <lists@zopyx.com> Date : Thu, 21 Sep 2006 11:20:16 +0200 À : Pascal Peregrina <Pperegrina@Lastminute.com>, <zope@zope.org> Objet : Re: [Zope] Zope 2.10b2 build issue
--On 21. September 2006 11:06:36 +0200 Pascal Peregrina <Pperegrina@Lastminute.com> wrote:
Hi,
Just to let you know that if you use a temporary build directory to build Zope 2.10, the setup.py script fails.
I know, I am using python 2.5 (making some tests) but this issue is unrelated.
Below, "build" is an empty directory and "src" is the untared Zope source.
STEP 1
cd build/Zope-2.10.0-b2 && /opt/pperegri/F2BUILDS/F2.15/src/Zope-2.10.0-b2/configure --prefix=/opt/pperegri/F2BUILDS/F2.15/opt/Zope-2.10.0-b2 --optimize --with-python=/opt/pperegri/F2BUILDS/F2.15/opt/Python-2.5/bin/python
The documentation states *clearly* that Python 2.4.X is required.
-aj
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
--On 21. September 2006 11:58:29 +0200 Pascal Peregrina <Pperegrina@Lastminute.com> wrote: -final/build-b
ase /python-2.4/build-temp" Traceback (most recent call last): File "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.9.4-final/setup.py", line 53, in ? import versions ImportError: No module named versions make: *** [build] Error 1
And my exact same hack as initially described works there too. The faulty code does not look very "clean" anyway (playing with the sys.path just to import the versions module)
Check if you have "inst/versions.py". If not then you're archive is broken or you have a problem with extracting the archive. Ensure you're using a *very* recent version of GNU TAR. -aj
Again, if you read my hack in my initial mail, you'll see that the issue is with the python path (I run make in a temporary "build" directory and the untared Zope source is elsewhere)... So no, my source file is NOT corrupted... Let me explain again. In setup.py there is this (nasty) code: sys.path.insert(0, 'inst') import versions del sys.path[0] In my case, this fails because the "inst" directory is not a subdirectory of my temporary "build" directory. So if I fix the path to "inst" with this in setup.py (I copy/pasted this code from one of my own python scripts): try: MAKEFILEDIR = os.path.dirname(os.path.abspath(__file__)) except: MAKEFILEDIR = os.path.dirname(os.path.abspath(sys.argv[0])) sys.path.insert(0, '%s/inst'%MAKEFILEDIR) import versions del sys.path[0] ...it works fine. Does it make sense now? This (nasty) code in setup.py does not exist in Zope 2.8.4 Pascal
De : Andreas Jung <lists@zopyx.com> Répondre à : Andreas Jung <lists@zopyx.com> Date : Thu, 21 Sep 2006 12:02:00 +0200 À : Pascal Peregrina <Pperegrina@Lastminute.com>, Andreas Jung <lists@zopyx.com>, <zope@zope.org> Objet : Re: [Zope] Zope 2.10b2 build issue
--On 21. September 2006 11:58:29 +0200 Pascal Peregrina <Pperegrina@Lastminute.com> wrote: -final/build-b
ase /python-2.4/build-temp" Traceback (most recent call last): File "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.9.4-final/setup.py", line 53, in ? import versions ImportError: No module named versions make: *** [build] Error 1
And my exact same hack as initially described works there too. The faulty code does not look very "clean" anyway (playing with the sys.path just to import the versions module)
Check if you have "inst/versions.py". If not then you're archive is broken or you have a problem with extracting the archive. Ensure you're using a *very* recent version of GNU TAR.
-aj
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pascal Peregrina wrote:
Again, if you read my hack in my initial mail, you'll see that the issue is with the python path (I run make in a temporary "build" directory and the untared Zope source is elsewhere)... So no, my source file is NOT corrupted...
Let me explain again. In setup.py there is this (nasty) code: sys.path.insert(0, 'inst') import versions del sys.path[0]
In my case, this fails because the "inst" directory is not a subdirectory of my temporary "build" directory.
So if I fix the path to "inst" with this in setup.py (I copy/pasted this code from one of my own python scripts):
try: MAKEFILEDIR = os.path.dirname(os.path.abspath(__file__)) except: MAKEFILEDIR = os.path.dirname(os.path.abspath(sys.argv[0])) sys.path.insert(0, '%s/inst'%MAKEFILEDIR) import versions del sys.path[0]
...it works fine.
Does it make sense now?
This (nasty) code in setup.py does not exist in Zope 2.8.4
I fixed out-of-tree builds recently (I can reproduce your error on a 2.9.4 tarball, but not with the 2.9 branch): http://svn.zope.org/Zope/branches/2.9/setup.py?rev=69978&r1=69111&r2=69978 http://svn.zope.org/Zope/branches/2.10/setup.py?rev=69979&r1=69113&r2=69979 It looks as though I forgot to port that fix to the trunk, however. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFEozV+gerLs4ltQ4RAhYIAJkBFc8ixYwFkWTL2sorShmSSx4VqwCfcgva 5ApsUtRT6pSMG7J5i+dWkiM= =+j94 -----END PGP SIGNATURE-----
participants (3)
-
Andreas Jung -
Pascal Peregrina -
Tres Seaver