This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients dmalcolm, eric.araujo, ncoghlan, pitrou, python-dev, rosslagerwall, tarek
Date 2012-05-30.02:43:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338345800.41.0.595074613747.issue14443@psf.upfronthosting.co.za>
In-reply-to
Content
Now I'm wondering if the problem will also manifest itself on EL rebuilds like CentOS or Scientific Linux, since that will affect how specific we can get when it comes to implementing a workaround.

That is, overriding __os_install_post should definitely work, but the question then becomes how we decide that overriding it is *necessary*, such that:
- we don't bypass vendor hooks when they aren't broken (e.g. Fedora, hopefully a future version of RHEL)
- we *do* bypass them when we know they don't work properly for Python 3 projects (e.g. RHEL6, probably EL6 rebuilds)

I'm currently thinking of something like this:

# At the top of the bdist_rpm command file
try:
    # Support workaround for #14443 which affects some RPM based systems
    # such as RHEL6 (and probably derivatives)
    from rpm import expandMacro as _expand_rpm_macro
except ImportError:
    _expand_rpm_macro = None

# When generating the spec file
    if _expand_rpm_macro is not None:
        # We're on a system with a vendor installed rpm library
        # and at least RHEL6 tries to bytecompile Python modules
        # with the system Python instead of the running one
        problem = "brp-python-bytecompile  \\"
        fixed = "brp-python-bytecompile  %{__python} \\"
        vendor_hook = _expand_rpm_macro("%{__os_install_post}")
        fixed_hook = vendor_hook.replace(problem, fixed)
        if fixed_hook != vendor_hook:
            # Add fixed_hook to spec file template

Thoughts?
History
Date User Action Args
2012-05-30 02:43:20ncoghlansetrecipients: + ncoghlan, pitrou, tarek, eric.araujo, dmalcolm, rosslagerwall, python-dev
2012-05-30 02:43:20ncoghlansetmessageid: <1338345800.41.0.595074613747.issue14443@psf.upfronthosting.co.za>
2012-05-30 02:43:19ncoghlanlinkissue14443 messages
2012-05-30 02:43:19ncoghlancreate