-
Notifications
You must be signed in to change notification settings - Fork 981
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][xbuild] Access environment variables from --profile:build and --profile:host simultaneously #7091
Comments
Hi! Environment variables that are declared in the profiles for each context are intended to affect packages on that context only, the only ones that are propagated from build context to host are the ones declared by packages and the ones related to runtime. I think that this feature request is tightly coupled to the Meson integration in Conan, probably it is better if we work together in that integration and then, when we know what is needed (maybe at that point we have a working branch in Conan) we can see if this is actually needed. I'm not very familiar with Meson (I've never used it in a professional environment), but from your comment "To implement the full xbuild support for build systems, information about build compiler is required (which is usually passed via env variables in profile)." I would say that the compiler information about the compiler to use to build packages in the host context has to be declared in the env_vars inside the If that compiler is a Conan package, declared as Let's see how we can work together on this, I can be wrong, and probably the documentation about cross-building with the new model in Conan is not very clear. And I need to understand better how Meson works. Maybe this is needed. |
@jgsogo , I have a branch I'm working on, but it's still very early work in progress (it won't probably even compile at this point of time): develop...TheQwertiest:feature/meson_toolchain Things of note: this would be a separate meson integration from the current one, since it will work very differently in regards of handling env vars and cross builds and it will require too much hacks to make it work with the current meson integration (and all that will be deprecated in conan 2.0 anyway). Thus I have cleaned up the interface and removed some legacy things. So, regarding meson: Meson allows to specify what target is targeting (pun not intended). E.g. a target might be a build tool (code generation for example), so it should be built in the native context only. Or a target might be a final shared library, so it should be built with the current host compiler (whether cross-compiler or native if it's not a cross build). Docs about machine files: https://mesonbuild.com/Machine-files.html The basic idea is that the build environment in meson is defined via machine files, so that all relevant build options are saved and it does not rely on the presence of environment variables. There are two types of machine files: The new conan two-profile concept maps one-to-one to these machine files. PS: I've joined the conan's slack, so we can continue there if you want to have a real-time conversation =) |
Meson now uses the |
@Ericson2314 , I'm actually using this in my PR =) |
Blocks #7026
Feature description:
Ability to access env variables from both --profile:build and --profile:host during
build
/test
/etc steps.Reasoning:
It seems that currently the only thing that is available from
--profile:build
duringbuild
/test
/etc steps issettings_build
, which contains only[settings]
section of the profile. Env variables from host profile are appended to current environment and env vars from build profile are lost\not accessible.To implement the full xbuild support for build systems, information about
build
compiler is required (which is usually passed via env variables in profile).E.g. meson uses
--native-file
and--cross-file
for xbuild configuration (which maps to conan's--profile:build
and--profile:host
respectively). The native file is used as a base profile during native compilation (when no cross file is supplied) and during xbuild it's used for things like code generation or compilation of build-time utils.The text was updated successfully, but these errors were encountered: