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

Pass platform for SourceTranslator #386

Merged
merged 1 commit into from
May 6, 2017
Merged

Conversation

thesamet
Copy link
Contributor

@thesamet thesamet commented May 6, 2017

Similarly to WheelTranslator and EggTranslator, pass the platform to SourceTranslator. Without it, SourceTranslator takes the current platform.

Similarly to WheelTranslator and EggTranslator, pass the platform to SourceTranslator. Without it, SourceTranslator takes the current platform.
@kwlzn
Copy link
Contributor

kwlzn commented May 6, 2017

@thesamet what's the point of passing this? afaik, sdists are compatible with all platforms - so the compatibility check is moot. and since there's no inherent cross-compilation ability, specifying a platform that isn't the current platform for SourceTranslator strikes me as odd.

@thesamet
Copy link
Contributor Author

thesamet commented May 6, 2017

I am actually implementing cross compilation: I created a shell script that runs Python 2 inside a docker container and providing that as an interpreter to pants (and hence to pex). So for me, current platform is "macosx-10.11-intel" but the target platform is "linux-x86_64". The source translator is invoking bdist on the source targets and creates a linux-specific wheel. Then, the compatibility check here https://github.com/pantsbuild/pex/blob/master/pex/translator.py#L114 fails without this PR, since self._platform would be OS X and not Linux.

@kwlzn kwlzn merged commit 9466903 into pex-tool:master May 6, 2017
@kwlzn
Copy link
Contributor

kwlzn commented May 7, 2017

@thesamet ah, gotcha.

@kwlzn kwlzn mentioned this pull request May 7, 2017
@thesamet thesamet deleted the patch-1 branch May 7, 2017 02:33
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