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

Repair unhandled AttributeError during pex bootstrapping. #599

Merged
merged 2 commits into from
Nov 15, 2018

Conversation

kwlzn
Copy link
Contributor

@kwlzn kwlzn commented Oct 12, 2018

A quick, surface level fix for #598.

try:
module.__path__.insert(0, module_dir)
except AttributeError:
TRACER.log(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it ok to log and not?:
# Force subsequent imports to come from the .pex directory rather than the .pex file.

This begs the question as to whether the enclosing update_module_paths function is needed at all.

Copy link
Contributor Author

@kwlzn kwlzn Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the aim is purely to queue a quick bandaid in the pex->pants->internal release lifecycle to unblock our use of pex here, tbh. I think implicitly allowing breakage of the ~2/100+ affected modules w/ logging beats a hard crash preventing any use until a deeper fix can be made (and subsequently released etc).

this may or may not be reasonable, but just citing my current tack. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stance is reasonable, the state the code is left in does not read as reasonable. Can you call the shot in a comment with the real fix issue pointed to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, of course.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW - I think I sussed what's going on here. Details added to #598. I may be able to get a real fix in here. I'll stare at this code in light of PEP-420 and report an estimate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it will take a few hours to fix the underlying issue with a test coverging the implicit namespace package case.

Copy link
Contributor Author

@kwlzn kwlzn Oct 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm - thank you! added a concrete minimal repro there.

@jsirois jsirois mentioned this pull request Oct 15, 2018
@jsirois
Copy link
Member

jsirois commented Oct 15, 2018

@kwlzn I've created a 1.5.2 release ticket in #602 and included this change. I assume you want to merge this and get a release for Pants to consume?

@cosmicexplorer
Copy link
Contributor

cosmicexplorer commented Oct 15, 2018

@jsirois yes, this addresses an issue showing up internally that we haven't been able to nail down yet. I was going to handle the internal release part, and maybe the pants part, whatever makes sense.

@kwlzn
Copy link
Contributor Author

kwlzn commented Oct 20, 2018

@jsirois propped this up purely as a quick drive-by bandaid to help expedite internal unblocking (and ticketed/discussed internally) - but no strong preference on course of action here.

@cosmicexplorer
Copy link
Contributor

I dropped the ball on making sure this made it into a pex release, and this is an active blocker for an internal use case -- are there any blockers to merging this as of now? @kwlzn @jsirois I would be willing to do whatever is necessary to make the pex release work, or I could just handle the pants part.

@kwlzn kwlzn merged commit a74f63a into pex-tool:master Nov 15, 2018
@kwlzn kwlzn mentioned this pull request Nov 15, 2018
cosmicexplorer added a commit to pantsbuild/pants that referenced this pull request Nov 16, 2018
### Problem

See pex-tool/pex#623 for the pex release ticket. This release incorporates two changes, one of which (pex-tool/pex#599) was necessary to fix the issue in pex-tool/pex#598.

### Solution

Bump the pex version to `1.5.3`.
cosmicexplorer added a commit to pantsbuild/pants that referenced this pull request Nov 16, 2018
See pex-tool/pex#623 for the pex release ticket. This release incorporates two changes, one of which (pex-tool/pex#599) was necessary to fix the issue in pex-tool/pex#598.

Bump the pex version to `1.5.3`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants