conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] Override env var for only one requirement

Open rollebolle opened this issue 7 months ago • 1 comments

What is your question?

I have a requirement that misuses a specific env var (CROSS_COMPILE). For this specific package I need to keep that variable empty. On the other hand, it needs to be set for the rest of the dependency chain. This package is down in a long chain of requirements and I do not feel like overriding all recipes of my own just to modify this problem or patch the package, but would like to use the one from conan.io

Is there a way to set an env var to a specific depedant pacakge only, or in some other way modify it?

Have you read the CONTRIBUTING guide?

  • [x] I've read the CONTRIBUTING guide

rollebolle avatar Jun 15 '25 21:06 rollebolle

Hi @rollebolle

Thanks for your question

Is there a way to set an env var to a specific depedant pacakge only, or in some other way modify it?

yes, the [buildenv] section in the profile also admits per-package patterns:

[buildenv]
mypkg/*:SOME_VAR=SOME_VALUE

Defines the env-var only for packages mypkg/*, but not for others.

memsharded avatar Jun 15 '25 21:06 memsharded

Hi @rollebolle

Did the above help? Any further question or issue? If not, maybe this ticket can be closed as solved. Thanks for the feedback

memsharded avatar Jul 14 '25 11:07 memsharded

No problem solved thanks

Vänliga hälsningar,

Roland Waltersson

On Mon, 14 Jul 2025 at 13:35, James @.***> wrote:

memsharded left a comment (conan-io/conan#18469) https://github.com/conan-io/conan/issues/18469#issuecomment-3069153170

Hi @rollebolle https://github.com/rollebolle

Did the above help? Any further question or issue? If not, maybe this ticket can be closed as solved. Thanks for the feedback

— Reply to this email directly, view it on GitHub https://github.com/conan-io/conan/issues/18469#issuecomment-3069153170, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAHEDEMPZQGFZIHRHS64K33IOIZ7AVCNFSM6AAAAAB7LXDP56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANRZGE2TGMJXGA . You are receiving this because you were mentioned.Message ID: @.***>

rollebolle avatar Jul 14 '25 12:07 rollebolle