-
Notifications
You must be signed in to change notification settings - Fork 991
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] Build env scripts generated with virtualenv:powershell are incomplete #15267
Comments
Hi @EricHouet! |
Thanks! According to the CMakeToolchain documentation, generating However, nothing is mentionned regarding an eventual |
I confirmed there's currently no support for It seems that the implementation is not trivial. I'll bring it to the team. For now, I'd suggest to use a different terminal. |
Indeed, that is not as trivial as I first though... Crazy that they did not create a PowerShell equivalent to I found this thread: Base on that, this looks like it works: PS C:\Users\eh> $env:INCLUDE
PS C:\Users\eh> Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
PS C:\Users\eh> Enter-VsDevShell
cmdlet Enter-VsDevShell at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
VsInstallPath: C:\Program Files\Microsoft Visual Studio\2022\Professional
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.8.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS C:\Users\eh\source\repos> $env:INCLUDE
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
PS C:\Users\eh\source\repos> Maybe this could be used ? |
Even better, according to this, the following should do the trick
|
Yes! We confirmed that it should work. |
Changelog: (Feature): Add support for use of vcvars env variables when calling from powershell. Docs: https://github.com/conan-io/docs/pull/XXXX Trying to activate the generated `conanbuild.ps1` file to set the environment from a Powershell console was not working. To fix this there's now a new `conanvcvars.ps1` file that saves the environment from calling `conanvcvars.bat` to be used in the Powershell. Fixes: #15267
Environment details
Steps to reproduce
conanfile.py
with a dependency. For example:conan install . -c tools.env.virtualenv:powershell=True
Expected Result:
conanbuild.bat
andconanbuild.ps1
basically does the same.Result:
conanbuild.bat
activate the Visual Studio 17 environment whileconanbuild.ps1
does not.My understanding of the
conanbuild
scripts was that the visual studio environment would be activated when running them. So I was expecting theconanbuild.ps1
script to do so.Maybe my understanding is incorrect but I feel like both version should do the same.
Logs
The text was updated successfully, but these errors were encountered: