-
Notifications
You must be signed in to change notification settings - Fork 990
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
[bug] VirtualBuildEnv + VirtualRunEnv with scope=build, deactivate_conanbuild.bat does not properly restore the PATH #13693
Comments
Thanks for your detailed report. In any case, this is what we have in the code: def deactivates(filenames):
# FIXME: Probably the order needs to be reversed
result = []
for s in filenames: This should be relatively straightforward to fix, lets try for next 2.0.5. |
Did PR #13707 to fix it. Regarding your other comment:
This is not the best approach. It will fail in any cross-build scenario. If you are doing native build with same host and build profile, they will use the same |
Closed by #13707, will be released next 2.0.5. Please see my other comment above to discuss about the |
Thank you @memsharded for your reply and fix! Nice that it will be fixed in 2.0.5. I guess that it will be not fixed in 1.60? I am asking as I am still using Conan 1 (with the back-ported Conan 2 features) as many 3rd parties I need do not have their recipes ported to Conan 2 yet. |
At the moment, this kind of fix that is not severe (there are workarounds, you can keep using 1.X for a while, this bug could be inconvenient but not a big blocker) and are not regressions are difficult to prioritize for 1.X releases, too many things to do (for example, a large part of the team is working hard to keep porting ConanCenter recipes to be 2.0 ready). If it is a big blocker, please let us know. Thanks! |
I understand. No, this is not blocking at all. Thank you for all your work in the Conan project. |
Thanks to you for the report and the feedback! 😃 |
Hi @memsharded . Sorry about the long delay to reply to you about this. So I tried to set Qt as a regular requirement and also as a tool requirement. As I used the same profile for the I disabled the custom remote I used, removed all the Qt packages I had on my machine and retried. Eventually, Conan used the same Qt package for both contexts. Not sure what was wrong with the Qt package from the remote I used. Anyway, now it works fine. Thanks for your help. |
Environment details
conanfile.py
:Host and build profile (the same),
conanprofile.txt
:Steps to reproduce
conanfile.py
andconanprofile.txt
.conan install . --lockfile="" --profile:host=conanprofile.txt --profile:build=conanprofile.txt --install-folder=build --output-folder=build --build=missing
doxygen.exe
andmoc.exe
are not available (not in thePATH
)build\conan\conanbuild.bat
doxygen.exe
andmoc.exe
are available (in thePATH
)build\conan\deactivate_conanbuild.bat
doxygen.exe
is still available in thePATH
(moc.exe
is not as expected).doxygen.exe
should not be available.Logs
Content of
conanbuild.bat
:Content of
deactivate_conanbuild.bat
:In order to restore the
PATH
properly, the call order indeactivate_conanbuild.bat
should be the reverse of the call order inconanbuild.bat
. The content ofconanbuild.bat
should not change, but the content ofdeactivate_conanbuild.bat
should be:I did not try but maybe there is a similar issue when using
VirtualBuildEnv
withscope=run
+VirtualRunEnv
.This is some context about why I needed this. My application depends on Qt, so I needed it as a requirement. In addition, at build time, some Qt tools are needed:
moc.exe
,rcc.exe
,lupdate.exe
, andlrelease.exe
. Unfortunately, the Qt binary path is not added to thePATH
when I use theVirtualBuildEnv
generator (it does with theVirtualRunEnv
generator). I could just use theVirtualRunEnv
generator, but I also use doxygen to generate my code documentation. I set it as atool_requires
. Doxygen binary path is put in thePATH
with theVirtualBuildEnv
generator but not with theVirtualRunEnv
generator. To generate a.qch
documentation, a Qt binary is necessary:qhelpgenerator.exe
. My problem is that the doxygen binary directory was only set in thePATH
with theVirtualBuildEnv
generator, and the Qt binary path only with theVirtualRunEnv
generator. I need both in thePATH
.An option I tried was to define Qt as a tool requirement (
tool_requires
) as the same time as a regular requirement. It worked but that installed 2 different Qt packages. My understanding is that one is for the build context and the other one for the host context. In my case, the build context and the host context are the same (same conan profile) so I would like to avoid the use of 2 different packages. That is why I set thescope
tobuild
when I used theVirtualRunEnv
generator. Let me know if there is a better approach.Thank you for your help.
The text was updated successfully, but these errors were encountered: