Skip to content
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

CFEP-13 implementation mega-thread #993

Closed
26 tasks done
beckermr opened this issue Mar 11, 2020 · 13 comments
Closed
26 tasks done

CFEP-13 implementation mega-thread #993

beckermr opened this issue Mar 11, 2020 · 13 comments
Assignees

Comments

@beckermr
Copy link
Member

beckermr commented Mar 11, 2020

Output Validation, Registration and Copies

Key Generation, Registration and Validation

Deprecations, Migrations and Token Rotations

UX Items

@beckermr beckermr pinned this issue Mar 11, 2020
@beckermr beckermr self-assigned this Mar 11, 2020
@beckermr
Copy link
Member Author

One of our wonderful libusb maintainers, @ryanvolz, used this code snippet to find msbuild on our azure images. Should we / can we port this to other feedstocks that need msbuild?

set "MSBUILD_CMD=%VSINSTALLDIR%MSBuild\%VS_VERSION%\Bin\MSBuild.exe"
if not exist "%MSBUILD_CMD%" (
  :: Azure has at least VS 2017
  :: find VS 2017+ installations using vswhere tool
  echo Searching for MSBuild using vswhere...
  set "VSWHERE_CMD=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
  if not exist "!VSWHERE_CMD!" (
    set "VSWHERE_CMD=vswhere"
  )
  echo vswhere path: !VSWHERE_CMD!
  for /f "usebackq tokens=*" %%i in (`"!VSWHERE_CMD!" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
    set "MSBUILD_CMD=%%i"
  )
  if not exist "!MSBUILD_CMD!" (
    :: try just finding the VS 2017 installation path
    for /f "usebackq tokens=*" %%i in (`"!VSWHERE_CMD!" -latest -products * -requires Microsoft.Component.MSBuild -version ^[15.0^,16.0^) -property installationPath`) do (
      set "vsdir=%%i"
    )
    set "MSBUILD_CMD=!vsdir!\MSBuild\15.0\Bin\MSBuild.exe"
    if not exist "!MSBUILD_CMD!" (
      :: try a sensible default
      set "MSBUILD_CMD=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
      if not exist "!MSBUILD_CMD!" (
        echo Could not find MSBuild.exe
        exit 1
      )
    )
  )
  echo MSBuild path: !MSBUILD_CMD!
)

@beckermr
Copy link
Member Author

cc @isuruf @jakirkham @ocefpaf

@isuruf
Copy link
Member

isuruf commented Mar 20, 2020

It's not enough to find msbuild.exe. If the msbuild.exe is found from VS2017, it'll use cl.exe from VS2017. I tried setting some variables to make it find VS2015, but didn't work.

@isuruf
Copy link
Member

isuruf commented Mar 20, 2020

Finding msbuild.exe like that is equivalent to using vs2017_win-64 package with the disadvantage that the dependency vc>=14 is added instead of vc>=14.1

@beckermr
Copy link
Member Author

I don't fully follow @isuruf but do we need to mark those builds of libusb broken?

@jakirkham
Copy link
Member

cc @ryanvolz (in case you have thoughts on msbuild usage on Azure 🙂)

@ryanvolz
Copy link
Contributor

ryanvolz commented Mar 20, 2020 via email

@isuruf
Copy link
Member

isuruf commented Mar 20, 2020

Can you post the link for the logs?

@ryanvolz
Copy link
Contributor

@isuruf
Copy link
Member

isuruf commented Mar 20, 2020

Ah, so libusb has a solution file specifically for vs2015. This is not the case for most packages.

@jakirkham
Copy link
Member

How are other packages you have seen using msbuild?

@isuruf
Copy link
Member

isuruf commented Mar 20, 2020

How are other packages you have seen using msbuild?

They have one solution file for all versions

@ryanvolz
Copy link
Contributor

Ah, so libusb has a solution file specifically for vs2015. This is not the case for most packages.

Ok, that makes sense. I wasn't sure how exactly the toolchain was getting selected. I did just try a build of libusb locally that forced using the VS2017 solution file even with the VS2015 package and setup, and it did fail because it couldn't find the right Windows SDK.

Until just now, the libusb recipe had the following code snippet to upgrade VS2005 vcproj files to get VS2008 files that weren't otherwise provided:

if "%VS_YEAR%" == "2008" (
  call vcbuild /upgrade msvc\libusb_dll_2005.vcproj
  if errorlevel 1 exit 1
  call vcbuild /upgrade msvc\libusb_static_2005.vcproj
  if errorlevel 1 exit 1
  call vcbuild /upgrade msvc\listdevs_2005.vcproj
  if errorlevel 1 exit 1
  call vcbuild /upgrade msvc\stress_2005.vcproj
  if errorlevel 1 exit 1
  call vcbuild /upgrade msvc\xusb_2005.vcproj
  if errorlevel 1 exit 1
  set SLN_FILE="msvc\libusb_2005.sln"
  set TOOLSVERSION=3.5
)

Maybe that's helpful for some other packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants