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

Feature request: add target platform info in repository_ctx #4636

Closed
k1nkreet opened this issue Feb 14, 2018 · 5 comments
Closed

Feature request: add target platform info in repository_ctx #4636

k1nkreet opened this issue Feb 14, 2018 · 5 comments

Comments

@k1nkreet
Copy link

k1nkreet commented Feb 14, 2018

Description of the problem / feature request:

We are using libzmq in our project, I created repository_rule to compile it, because there is some platform-dependent headers generated by autoconf or cmake. To cross-compile it, I should add some flags to "./configure" call to generate headers for target platform. But I didn't find any possibilities to provide information about target platform in repository_rule. I couldn't use "select" in rules invoked from WORKSPACE and repository_ctx contains information about host platform only.

Feature requests: what underlying problem are you trying to solve with this feature?

To cross-compile external library sometimes you need to provide target platform information to configure/code-generation stage

Have you found anything relevant by searching the web?

Nothing

@k1nkreet k1nkreet changed the title Add target platform info in repository_ctx Feature request: add target platform info in repository_ctx Feb 14, 2018
@davido
Copy link
Contributor

davido commented Feb 15, 2018

Duplicate of: #2045.

@k1nkreet
Copy link
Author

k1nkreet commented Feb 15, 2018

@davido, I'm not sure about it. AFAIU there is a talk about host system configuration in that issue. I'm talking about target platform, which is build parameter like --cpu and --crosstool_top. Did I misunderstood something?

@dslomov
Copy link
Contributor

dslomov commented Feb 15, 2018

Repository rules do not have access to target platfrom. They execute very early, before the loading phase.
You should call ./configure && make in the build rule that the repository rule emits instead. Cf. https://blog.envoyproxy.io/external-c-dependency-management-in-bazel-dd37477422f5

@philwo
Copy link
Member

philwo commented Feb 15, 2018

@dslomov Marking this as "type: support" as I understand that this is working as intended. Please recategorize as feature request if you instead want to change this in the future.

@hlopko
Copy link
Member

hlopko commented Mar 21, 2018

I'm closing since there's nothing we plan to do on this front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants