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

Move PlatformConstraint to a param. #8375

Closed

Conversation

hrfuller
Copy link
Member

@hrfuller hrfuller commented Oct 1, 2019

Problem

Currently the target platform constraint is hardcoded to be the platform pants is executed on. Before we can build rules that cross compile targets we need to let users and rules specify the value of a target platform from the CLI and for sub-graph respectively.

Solution

Make a CLI option called --target-platform whose default value is the current platform. Seed the rule graph with this value as a root at execution time.

Result

The user can select the desired target platform for binaries and artifacts created by pants. This will only effect current and future rules which have platform dependent behavior. Cross platform rules are not effected.

@hrfuller hrfuller force-pushed the hfuller/optionable-platform-param branch from bcf21e3 to 463d5eb Compare October 1, 2019 21:49
) -> Pex:
"""Returns a PEX with the given requirements, optional entry point, and optional
interpreter constraints."""

# ignore none constraint if some rule pushes a constraint down as none.
Copy link
Member

Choose a reason for hiding this comment

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

This is related to the NB below, I think? Because otherwise "unconstrained" would be ok. Should move it nearer the comment probably.

@stuhood
Copy link
Member

stuhood commented Oct 2, 2019

A general question: do we have need to actually expose the option right now? Injecting this via a RootRule is a good idea, and we should do that here, but whether to expose it as an option is a separate question that we might want to answer on a goal-by-goal basis rather than globally like this.

@hrfuller
Copy link
Member Author

hrfuller commented Oct 4, 2019

Fair point. I wanted to have a way to set it so I could test it, but perhaps it should just be static for now. I'll defer to you.

@hrfuller hrfuller force-pushed the hfuller/optionable-platform-param branch from f0b9e87 to b0263ce Compare October 8, 2019 19:17
@Eric-Arellano
Copy link
Contributor

Superseded by Stu's recent changes to platforms, e.g. #9527.

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