-
Notifications
You must be signed in to change notification settings - Fork 80
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
Platform autodetection #109
Comments
You can add the following to
or
to configure this without having to manually set these flags all the time.
Unfortunately, that doesn't work for all required use-cases. An example is
I.e. the first toolchain fitting all constraints wins. Consider the following order of toolchain definitions:
If we didn't have the
I don't follow, could you point to the relevant part of the docs? The platforms documentation explicitly mentions the use-case of different system configurations and tool versions.
Sadly, this is not possible. Toolchains are only available in regular
Thanks for pointing that out. They are, the docs need to be fixed. |
This approach actually don't scale at all since we may have another toolchain that requires specific constraint which leads to another platform that can't be combined easily, also it's a bit uncomfortable to manually set platform (which includes not only nix, but whole environment). Probably it would be better to define config_setting and try to work it out that way (at least it scales well).
Is it possible to check if environment contains
Probably it's just me, but as I could understand the purpose of that is to define capabilities of system for toolchain to work correctly, i.e. if python requires glibc version 2.26 to run that would be constraint - in my brain it is about runtime, not configuration/installation time. In nix this concept is missing, but if you ever encountered |
Related: bazelbuild/platforms#10. |
Yes, if you need to combine platforms then you will have to define a custom platform yourself. Bazel platform definitions support inheritance which may reduce the required boilerplate a bit. Unfortunately, the docs point out the following
So, this doesn't allow you to compose platforms, only to adorn a platform with additional constraints. However, for
I don't know if there are any plans to lift that single value limitation on the
Could you clarify what you have in mind here? Config settings are consumed by
It is possible to check if
As the documentation points out
If I understand the Sticking to the Python example: A |
Closing for inactivity and as there doesn't seem to be an actionable outcome. |
Since there is currently no support for custom platform/constraint autodetection/autodiscovery (see bazelbuild/bazel#8766) there is no way sane way to use neither
nixpkgs_python_configure
nornixpkgs_sh_posix_configure
and they just being autodetected by bazel itself from existing environment and not from nixpkgs (at least until no--platforms
andhost_platform
equal to@io_tweag_rules_nixpkgs//constraints:linux_x86_64_nixpkgs
specified manually)So should we just drop that constraints from toolchains?
Pros:
Cons:
_configure
ultimately does nothing, so we may break something with that change (do we really care? especially if it is called directly and MEANT to do so?)_configure
are public api of this rules or not, so probably this issue is for nothing (we should write some doc probably)The text was updated successfully, but these errors were encountered: