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

Add Visual Studio conf packages (conf-msvc32.1, conf-msvc64.1, msvs-detect.0.7.0) #25440

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Mar 8, 2024

These packages are used as part of my proposal for packaging the MSVC port of OCaml in opam-repository, but the packages themselves are entirely independent.

msvs-detect packages two scripts from metastack/msvs-tools which are then used by conf-msvc32.1 and conf-msvc64.1.

The two conf- packages can be simultaneously installed. They provide environment settings which can then be used by other packages, either in build-env or setenv:

C:\Devel>opam config list conf-msvc64
...
conf-msvc64:package   Visual Studio Community 2022 (17.9.34511.98)
conf-msvc64:script    "C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64
conf-msvc64:ml        ml64
conf-msvc64:msvs-bin  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33428\bin\HostX64\x64;C:\Program
                      Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual
                      Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual
                      Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program
                      Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual
                      Studio\Shared\Common\VSPerfCollectionTools\vs2019\x64;C:\Program Files (x86)\Microsoft Visual
                      Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft
                      SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files\Microsoft Visual Studio\2022\Preview\Team
                      Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files
                      (x86)\Windows Kits\10\bin\x64;C:\Program Files\Microsoft Visual
                      Studio\2022\Preview\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program
                      Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\;C:\Program Files\Microsoft Visual
                      Studio\2022\Preview\Common7\Tools\
conf-msvc64:msvs-inc  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33428\include;C:\Program
                      Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows
                      Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um;C:\Program
                      Files (x86)\Windows Kits\10\include\10.0.22621.0\shared;C:\Program Files (x86)\Windows
                      Kits\10\include\10.0.22621.0\winrt;C:\Program Files (x86)\Windows
                      Kits\10\include\10.0.22621.0\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
conf-msvc64:msvs-lib  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33428\lib\x64;C:\Program Files
                      (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows
                      Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64

dra27 added 2 commits March 8, 2024 17:33
msvs-detect is taken from the msvs-tools project. This package simply
installs two scripts to the share directory to be used by other
packages.
These packages can only be installed if a suitable Visual Studio
installation containing the Microsoft C compiler and macro assembler can
be found.

The two packages use msvs-detect to construct a .config file containing
the required environment variable changes necessary to make this
compiler available. These variables can then be used in the build-env or
setenv fields of dependent packages.

Both packages can be installed simultaneously; dependent packages are
required to ensure that only one toolchain is actually in the
environment at any given time.

The packages fail to install if a compiler cannot be found - opam
presently lacks an expressive enough depext system to be able to do
anything further.
@dra27
Copy link
Member Author

dra27 commented Mar 9, 2024

opam-ci — Failed - Everything was skipped

This is wonderfully appropriate for a Windows PR, coming straight from the Windows API school of ERROR_SUCCESS 🙂

@mseri mseri merged commit d83a62a into ocaml:master Mar 12, 2024
1 of 2 checks passed
@dra27 dra27 deleted the release-msvs-detect-0.7.0 branch March 12, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants