Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue14928] Fix importlib bootstrapping issues

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 16, 2012, 1:15 PM

Post #1 of 10 (139 views)
Permalink
[issue14928] Fix importlib bootstrapping issues

Antoine Pitrou <pitrou [at] free> added the comment:

Here is a patch for the "separate C executable" approach. There are a couple of small complications in order to avoid any circular dependency (either at the Makefile level, or at the _frozen_importlib / Py_Initialize level).

The proposed "-X" or BOOTSTRAP_PY approaches would be difficult, since there doesn't appear to be an easy way to generate a given file (the Python interpreter) twice in a Makefile dependency chain: the first time using the stale importlib, the second with the fresh importlib.

----------
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file26030/cfreeze.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 16, 2012, 8:50 PM

Post #2 of 10 (129 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Meador Inge <meadori [at] gmail> added the comment:

Nice patch Antoine! The method of partitioning the object sets into frozen and
non-frozen is nice.

> The proposed "-X" or BOOTSTRAP_PY approaches would be difficult, since there
> doesn't appear to be an easy way to generate a given file (the Python
> interpreter) twice in a Makefile dependency chain: the first time using the
> stale importlib, the second with the fresh importlib.

I experimented with the env var approach and came to the exact same conclusion
-- you would have to build the interpreter twice.

This patch looks good to me (I did have to rebase it against trunk, though;
it doesn't apply cleanly right now). I did some basic regression testing and ran
it through the original scenario from issue12370 that got us thinking this problem.
I saw no issues. Nice work.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 16, 2012, 9:02 PM

Post #3 of 10 (129 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Looks like a solid improvement to me.

One minor naming quibble is that "FROZENLESS_LIBRARY_OBJS" hurts my brain - would you mind switching it to something like "LIBRARY_OBJS_OMIT_FROZEN"?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 17, 2012, 12:47 AM

Post #4 of 10 (129 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

IIUC, this patch will cause importlib.h to always be built when building from source, since _freeze_importlib will be built.

Is it then the plan to drop importlib.h from version control? If so, the Windows build process would need to be adjusted as well (with a separate project that is a prerequisite for pythoncore).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 17, 2012, 2:49 AM

Post #5 of 10 (128 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> IIUC, this patch will cause importlib.h to always be built when
> building from source, since _freeze_importlib will be built.

Yes indeed. That's not deliberate, but because of how Makefile
dependencies are specified (importlib.h needs the _freeze_importlib
executable to be rebuilt, but it should really depend on the
_freeze_importlib.c timestamp). Do you have an idea to avoid that?

> Is it then the plan to drop importlib.h from version control?

No.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 17, 2012, 2:56 AM

Post #6 of 10 (129 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

> Yes indeed. That's not deliberate, but because of how Makefile
> dependencies are specified (importlib.h needs the _freeze_importlib
> executable to be rebuilt, but it should really depend on the
> _freeze_importlib.c timestamp). Do you have an idea to avoid that?

Recursive make invocation may help. Before running _freeze_importlib,
add '$(MAKE) _freeze_importlib'.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 17, 2012, 9:07 AM

Post #7 of 10 (128 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

New patch incorporating Martin's and Nick's suggestions.

----------
Added file: http://bugs.python.org/file26039/cfreeze2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 19, 2012, 1:16 PM

Post #8 of 10 (122 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Georg Brandl <georg [at] python> added the comment:

Is this ready to go in before beta1?

----------
nosy: +georg.brandl

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 19, 2012, 1:33 PM

Post #9 of 10 (122 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Roundup Robot <devnull [at] psf> added the comment:

New changeset c3616595dada by Antoine Pitrou in branch 'default':
Issue #14928: Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
http://hg.python.org/cpython/rev/c3616595dada

----------
nosy: +python-dev

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 19, 2012, 2:19 PM

Post #10 of 10 (122 views)
Permalink
[issue14928] Fix importlib bootstrapping issues [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Should be ok now.

----------
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14928>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.