Mailing List Archive

[issue14928] Fix importlib bootstrapping issues
Antoine Pitrou <pitrou@free.fr> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Meador Inge <meadori@gmail.com> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Nick Coghlan <ncoghlan@gmail.com> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Martin v. Löwis <martin@v.loewis.de> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Antoine Pitrou <pitrou@free.fr> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Martin v. Löwis <martin@v.loewis.de> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

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

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

_______________________________________
Python tracker <report@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Georg Brandl <georg@python.org> added the comment:

Is this ready to go in before beta1?

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

_______________________________________
Python tracker <report@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Roundup Robot <devnull@psf.upfronthosting.co.za> 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@bugs.python.org>
<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
[issue14928] Fix importlib bootstrapping issues [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

Should be ok now.

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

_______________________________________
Python tracker <report@bugs.python.org>
<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