[Python-bugs-list] [ python-Bugs-410541 ] bdist builds bogus .zips

noreply@sourceforge.net noreply@sourceforge.net
Tue, 05 Nov 2002 12:02:21 -0800


Bugs item #410541, was opened at 2001-03-22 16:31
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=410541&group_id=5470

Category: Distutils
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: A.M. Kuchling (akuchling)
Assigned to: Nobody/Anonymous (nobody)
Summary: bdist builds bogus .zips

Initial Comment:
According to Thomas Heller: "... the resulting zip-file
from
'bdist --formats=zip' is unusable because it contains
filenames relative to
the root directory)"

Such paths may be OK for Unix (cd / and unzip it,
perhaps?), 
but isn't much good for Windows, where Python might be
installed anywhere.  


----------------------------------------------------------------------

>Comment By: Gustavo Niemeyer (niemeyer)
Date: 2002-11-05 20:02

Message:
Logged In: YES 
user_id=7887

I don't think we should remove that command. It does no harm
being there,  and it already allows one to install in any
directory. For example, the following command allows one to
build a zip file relative to "site-packages/".

python setup.py bdist_dumb --format=zip install
--install-lib /site-packages

OTOH, there are some issues here:

- what should be done about script files, which would
usually be included in /usr/bin on a unix system? binaries
can be moved as well, using the same mechanism explained
above, but currently there's no standard place to but them;
- a binary distribution could include machine specific binaries;

I think the original author had this issues in mind when
created the bdist_dumb command, and that's why it even
includes the platform name in the generated file.

About not being able to use it in different python major
versions, that's a binary distrubtion. Other binary
distributions, like rpm, behave in the same way. Also,
binary compatibility between major versions is not
guaranteed, AFAIK.

Having in mind these issues, my suggestion is to close that
bug and leave the command as is.


----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2002-03-26 15:29

Message:
Logged In: YES 
user_id=11105

Yes. We would have to remove everything except 'rpm' 
and 'wininst' from bdist's available formats lists. But it 
seems the right way to do.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2002-03-26 14:52

Message:
Logged In: YES 
user_id=11375

Why not just remove bdist_dumb, then?


----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2002-03-26 14:07

Message:
Logged In: YES 
user_id=11105

IMO it is impossible to create a dumb binary distribution 
which can be used to install a package - even on the same 
platform for different Python versions. So it seems the 
only possibility is document dumb binary distros as broken.

The DISTUTILS TODO list is mainly just a list of thoughts 
from the previous maintainer, nobody (so far) is caring too 
much about it currently.

Assigning to AMK: Andrew, if you think this is ok, let us 
close this bug.

----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2002-03-06 20:33

Message:
Logged In: YES 
user_id=149084

I'm not sure what is meant by "everyone should install from
source or the native binary for his platform."  My
understanding is that Distutils was created to provide a
uniform way to install third party packages.

It seems that bdist_dumb has problems building a package
distribution which will install properly.  What about
non-Linux or Windows systems? It rather looks like the code
is unfinished....

To quote the TODO (DISTUTILS 1.1 PLANS):

"* bdist_dumb should grow a little intelligence: let
packager choose 
whether to make archive relative to prefix or the root
(prefix is essential for proper Windows support )"

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2002-03-05 21:08

Message:
Logged In: YES 
user_id=11105

I expect nobody will install from a zip-file on windows, 
either.

I suggest making bdist_wininst the default bdist format on 
windows and forget this one: Everyone should (will?) 
install either from source, or from the native binary 
distribution for his platform.


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-03-01 22:54

Message:
Logged In: YES 
user_id=31392

Can you look at this one, Thomas?


----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2001-05-27 22:33

Message:
Logged In: YES 
user_id=149084

gztar, ztar, tar, and zip appear to create the same install tree rooted at / . Only the compression differs. (I guess wininst is the intended way to create a Windows distribution.)

The Unix tree contains PythonX.X in its paths, so not only is the full tree NG for Windows, but if someone prepares a bdist package on a Unix system running 2.2, it appears that it is not going to install correctly on a Unix system running 2.1. It is impractical to ask developers to update their Tools distributions for each version of Python, so what to do?

It may be that the bdist paths should be rooted at site-packages, with script installation to prefix/bin. If there are extensions to go into lib-dynload, the path is ../lib-dynload from site-packages.

Then the user would unpack the file in the site-package directory. Note that right now the file names for source and 'binary' distribution are very similar, but the method of installation is different, and this has to be made clear to the user.

GvR seems to be interested in making the install trees the same on Linux and Windows, that would help.

Incidently, the distutils docs say the default is to install relative to prefix, but it appears that that has not been implemented, the default is / . Also, though the docs mention Windows installers, rpms, etc., they don't say anything about install files prepared with bdist. Maybe no one uses bdist?

If there is something I can do here, let me know. It seems it may take some discussion on python-dev first, though.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2001-05-21 20:39

Message:
Logged In: YES 
user_id=11375

I expect no one will install from a .zip file on Unix.

Options:

1) Make both the .tgz and .zip relative to sys.prefix or 
something.
2) Make only the .zip relative.
3) Document this as being broken and forget about it.




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=410541&group_id=5470