-
Notifications
You must be signed in to change notification settings - Fork 71
Fix incompatibility with Python Toolchains #99
Conversation
Regarding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff could be pared down a bit to just the relevant parts.
I wouldn't worry about it. This is a bespoke hack to make subpar work with a particular toolchain, so I think it's ok to assume some implementation details about that toolchain.
Cool!
It was an obsolete bug asking for imports to be accessible from PyInfo, which it has been for some time now.
I won't block the PR on this, but for reference the buildkite pipeline is defined here, and it looks like it can take custom flags. |
Alright, that's the way it is now. We can have a separate issue to track the desire to change the way the interpreter is found, which can resolve if PyRuntimeInfo becomes available.
Ok, I'll take a look |
The postsubmit is probably a better place but I changed the travisci config to run with the toolchains flag here: f0c9ec7 Line 42 in 07ff5fe
I had started a minimal diff here with the flag in each state but I'll close in favor of this diff: #100 |
Thanks, changes made 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will try to merge tomorrow and see what else breaks due to the toolchains flag. Thanks for the PR!
Fixes #98 by detecting the default toolchain wrappers and replacing with env versions. I'm perhaps not totally happy with how it's done, as any change in the path to these wrappers would break things again, so open to suggestions. Also, for Python 2 should we use
/usr/bin/python
or/usr/bin/python2
, I prefer the latter but don't know how this behaves on all systems?Also, now that we have PyInfo provider, the import paths are passed directly from Starlark to the compiler, removing a bit of fragility in parsing the stub file for those. However, I can't see a way to pass the interpreter directly, as this doesn't appear to be available to Starlark. This removed a TODO with reference
b/29227737
, if that means anything internally?Tested with both the default toolchain and a custom one to ensure the correct shebang ends up at the top of the par file. It might be worth adding a test that excercises this, but until the toolchains flag is flipped in CI the test will always fail.