conan-io / conan-io/docs

[question] VirtualBuildEnv in packages that were not just built

Open
#3,649 9 comments 0 reactions 1 assignee Claimed by @memsharded View on GitHub
type: question
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

### What is your question?

Hello!
At least when using conan 1 `VirtualBuildEnv(self)` does not seem to contain definitions from tool(or build) dependencies if the package was not built in the conan invocation.
The use case here is that we are doing some stuff in the `deploy()` method like setting up RPATHs, signing binaries etc. that would need dependencies given in the build-profile as tool requirements. But when the package to be deployed was not built in the same conan invocation the tool requirements do not show up in `self.dependencies` and hence they do not propagate any settings in `VirtualBuildEnv`. The only things we get there are variables from the `[buildenv]` section of the profile.
Is this intended behaviour and is it still present in conan2? I get it is an optimization to not instantiate build-context dependencies if not necessary but the behviour right now seems strange... - like a bug to be honest.

### Have you read the CONTRIBUTING guide?

- [x] I've read the CONTRIBUTING guide

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.