Skip to content

🍒/python changes #1585

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

Merged
merged 2 commits into from
Aug 3, 2020
Merged

🍒/python changes #1585

merged 2 commits into from
Aug 3, 2020

Conversation

JDevlieghere
Copy link

No description provided.

The Python used to run lit can be different from the Python LLDB was
build with. One scenario where this happens is when LLVM can find the
Python 3 interpreter, but not the Python 3 libraries, in which case LLDB
build and links against Python 3. Without this change, you end up with
an ModuleNotFoundError because of the mismatch.

Instead of looking at the Python interpreter that's used to run lit,
lldbtest should use the interpreter that matches the Python version LLDB
was build against.

Differential revision: https://reviews.llvm.org/D79519

(cherry picked from commit 7c6420e)
The Python 3 interpreter in Xcode has a relative RPATH and dyld fails to
load it when we copy it into the build directory.

This patch adds an additional check that the copied binary can be
executed. If it doesn't, we assume we're dealing with the Xcode python
interpreter and return the path to the real executable. That is
sufficient for the sanitizers because only system binaries need to be
copied to work around SIP.

This patch also moves all that logic out of LLDBTest and into the lit
configuration so that it's executed only once per test run, instead of
once for every test. Although I didn't benchmark the difference this
should result in a mild speedup.

Differential revision: https://reviews.llvm.org/D81696

(cherry picked from commit 526e0c8)
@JDevlieghere
Copy link
Author

@JDevlieghere
Copy link
Author

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Aug 3, 2020

Im fine with these being cherry-picked, but the question is should it be on stable/20200108 instead (as @adrian-prantl kindly reminded me). Seems that both already made the cutoff for stable/20200714, so that branch should be fine.

@JDevlieghere
Copy link
Author

JDevlieghere commented Aug 3, 2020

No, these changes should go to master. Adrian's statement is correct: all cherrypick form llvm.org should go to the apple/stable branch and only swift specific changes should go to the swift/ branches. However there's an exception: when we've reached the point in the release that we don't want to take any more changes. This has to do with the layout of the auto-merger:

apple/stable/20200108 -> swift/release/5.3 -> swift/master. 

The changes in this PR should not go to swift 5.3 so that's why I'm cherry-picking them to swift/master. They're just here to work with the Python changes you're doing on Swift's master branch.

PS: I already cleared this up with @adrian-prantl offline.

@JDevlieghere JDevlieghere merged commit af97c4b into swiftlang:swift/master Aug 3, 2020
@JDevlieghere JDevlieghere deleted the 🍒/python-changes branch August 3, 2020 22:03
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.

2 participants