Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frozen programs require the original build directory in order to run. #57220

Closed
malcolmp mannequin opened this issue Sep 20, 2011 · 4 comments
Closed

Frozen programs require the original build directory in order to run. #57220

malcolmp mannequin opened this issue Sep 20, 2011 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@malcolmp
Copy link
Mannequin

malcolmp mannequin commented Sep 20, 2011

BPO 13011
Nosy @merwok, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2022-03-23.10:10:40.353>
created_at = <Date 2011-09-20.01:44:50.742>
labels = ['type-bug']
title = 'Frozen programs require the original build directory in order to run.'
updated_at = <Date 2022-03-23.10:10:40.353>
user = 'https://bugs.python.org/malcolmp'

bugs.python.org fields:

activity = <Date 2022-03-23.10:10:40.353>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2022-03-23.10:10:40.353>
closer = 'iritkatriel'
components = ['Demos and Tools']
creation = <Date 2011-09-20.01:44:50.742>
creator = 'malcolmp'
dependencies = []
files = []
hgrepos = []
issue_num = 13011
keywords = []
message_count = 4.0
messages = ['144315', '145718', '411532', '415862']
nosy_count = 3.0
nosy_names = ['eric.araujo', 'malcolmp', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue13011'
versions = ['Python 2.7']

@malcolmp
Copy link
Mannequin Author

malcolmp mannequin commented Sep 20, 2011

In Python 2.7.2, Linux executables built with freeze.py will only run on the machine that contains the original build directory. This defeats the purpose of having frozen programs. This problem did not exist in Python 2.5.

The following steps reproduce the problem:

  1. Build a copy of python:
$ tar -xf Python-2.7.2.tar.bz2
$ cd Python-2.7.2
$ ./configure --prefix=`pwd`/install
$ make
$ make install
  1. In another directory, build a frozen program:
$ echo 'print "Hello World"' >hello.py
$ ~/src/Python-2.7.2/python ~/src/Python-2.7.2/Tools/freeze/freeze.py hello.py
$ make
$  ./hello 
Hello World

Copy the binary to another machine:

$ $ ./hello 
Traceback (most recent call last):
  File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 563, in <module>
  File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 545, in main
  File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 278, in addusersitepackages
  File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 253, in getusersitepackages
  File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 243, in getuserbase
  File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 520, in get_config_var
  File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 419, in get_config_vars
  File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 287, in _init_posix
IOError: invalid Python installation: unable to open /home/malcolmp/src/Python-2.7.2/install/lib/python2.7/config/Makefile (No such file or directory)

@malcolmp malcolmp mannequin added the type-bug An unexpected behavior, bug, or error label Sep 20, 2011
@merwok
Copy link
Member

merwok commented Oct 17, 2011

Thanks for the report. In 2.7 and 3.2, Python initialization was changed to use the new sysconfig module, which depends on the sysconfig.cfg file. freeze needs to special-case the sysconfig module in its detection code to include the cfg file.

Do you want to work on a patch?

@iritkatriel
Copy link
Member

This seems very outdated, can we close it?

@iritkatriel
Copy link
Member

Closing, please reopen or create a new issue if this is still a problem after all these years.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants