-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Rust/Cargo v1.75 and simplify Windows Conda setup (#9935)
* Split Conda into Unix/Windows variants, update to rust 1.75 * Add some helpers to get toolchain from conda env * Remove MSM/MergeModules from Wix installer * Bump to Clang/llvm 16.0.6 for better Windows SDK detection * Simplify windows conda activation * Install xwin and set winsysroot args to clang when present * Install conda-pack into the environment too * Write a wrapper script for lld-link instead * Generate a rust cargo.config to use the CMake toolchain on Windows * Bump minimum Cargo to 1.75 for Linux packaging * Remove Android tooling from env-windows.yml * Bump to Clang 16.0.6 for UNIX too * Add script to fetch addition Visual Studio components * Download VS Redist merge modules into xwin SDK too * Put the VCRedist MergeModule back
- Loading branch information
Showing
22 changed files
with
331 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: vpn | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- clang=16.0.6 | ||
- clang-tools=16.0.6 | ||
- clangxx=16.0.6 | ||
- llvm=16.0.6 | ||
- llvmdev=16.0.6 | ||
- lld=16.0.6 | ||
- python=3.9 | ||
- nodejs=18.16.* | ||
- pip=22.3.1 | ||
- rust=1.75 | ||
- compiler-rt | ||
- cmake=3.26.3 | ||
- ninja=1.11.0 | ||
- conda-pack=0.8.0 | ||
- vswhere=3.1.7 | ||
- pip: | ||
- -r requirements.txt | ||
- -r taskcluster/scripts/requirements.txt | ||
variables: | ||
QT_VERSION: 6.6.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Auto generated by: ${CMAKE_CURRENT_LIST_FILE} | ||
[target.x86_64-pc-windows-msvc] | ||
linker="${CMAKE_LINKER}" | ||
|
||
[env] | ||
CC_x86_64-pc-windows-msvc="${CMAKE_C_COMPILER}" | ||
CXX_x86_64-pc-windows-msvc="${CMAKE_CXX_COMPILER}" | ||
AR_x86_64-pc-windows-msvc="${CMAKE_AR}" | ||
CFLAGS_x86_64-pc-windows-msvc="${CMAKE_C_FLAGS}" | ||
CXXFLAGS_x86_64-pc-windows-msvc="${CMAKE_CXX_FLAGS}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
|
||
$X_WIN_VERSION = "0.6.5" | ||
|
||
$conda_env = conda info --json | ConvertFrom-Json | ||
|
||
if( $conda_env.active_prefix_name -eq "base"){ | ||
Write-Output("Not in an active conda env. abort") | ||
return -1 | ||
} | ||
$conda_folder = $conda_env.active_prefix | ||
Write-Output("Downloading x-win") | ||
# Small X-Win appretiation comment. | ||
# It's really great, | ||
# it can process windows store manifests, request files from MS-servers and unpack it. | ||
# we can use it to get the offical SDK files from microsoft. | ||
# We can't cargo-install it because to use the clang-msvc compat mode, | ||
# | ||
Invoke-WebRequest -Uri "https://github.com/Jake-Shadle/xwin/releases/download/$X_WIN_VERSION/xwin-$X_WIN_VERSION-x86_64-pc-windows-msvc.tar.gz" -OutFile "$conda_folder\xwin.tar.gz" | ||
$ProgressPreference = 'Continue' | ||
Write-Output("Unpack x-win") | ||
Start-Process -WorkingDirectory "$conda_folder" -Wait tar -ArgumentList @('-xf', "xwin.tar.gz") | ||
|
||
# Splat the CRT and SDK file to /xwin/crt and /xwin/sdk respectively | ||
Write-Output("Downloading the windows SDK") | ||
$env:PATH ="$conda_folder\xwin-$X_WIN_VERSION-x86_64-pc-windows-msvc;$env:PATH" | ||
xwin --accept-license --manifest-version 16 splat --include-debug-symbols --include-debug-libs --use-winsysroot-style --preserve-ms-arch-notation --disable-symlinks --output "$conda_folder\xwin" | ||
|
||
Write-Output("Downloading Microsoft.VisualStudio.Component.VC.Redist.MSM") | ||
python "$PSScriptRoot\fetch-vsix-package.py" --manifest-version 16 --output "$conda_folder\xwin" Microsoft.VisualStudio.Component.VC.Redist.MSM | ||
|
||
Write-Output("Cleaning Up") | ||
Remove-Item "$conda_folder\xwin-$X_WIN_VERSION-x86_64-pc-windows-msvc" -ErrorAction SilentlyContinue -Force -Recurse | ||
Remove-Item ".xwin-cache" -ErrorAction SilentlyContinue -Force -Recurse | ||
Remove-Item "xwin.tar.gz" -ErrorAction SilentlyContinue -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# This file is intended to be used as a CMake toolchain file, and selects the | ||
# clang-cl (MSVC compatible) compiler from the current conda prefix for use in | ||
# building the application. | ||
# | ||
# To use this, set the CMAKE_TOOLCHAIN_FILE argument when setting up the Cmake | ||
# project. For example: | ||
# cmake .. -DCMAKE_TOOLCHAIN_FILE=scripts/windows/conda-toolchain.cmake | ||
if(NOT DEFINED ENV{CONDA_PREFIX}) | ||
message(WARNING "Conda toolchain specified, but not in a Conda environment") | ||
return() | ||
endif() | ||
|
||
# Set the C++ compiler and tools. | ||
if(NOT CMAKE_C_COMPILER) | ||
find_program(CMAKE_C_COMPILER NAMES clang-cl REQUIRED DOC "Clang C Compiler (MSVC Compatible)") | ||
endif() | ||
if(NOT CMAKE_CXX_COMPILER) | ||
find_program(CMAKE_CXX_COMPILER NAMES clang-cl REQUIRED DOC "Clang C++ Compiler (MSVC Compatible)") | ||
endif() | ||
if(NOT CMAKE_RC_COMPILER) | ||
find_program(CMAKE_RC_COMPILER NAMES llvm-rc REQUIRED DOC "LLVM Resource Compiler") | ||
endif() | ||
if(NOT CMAKE_MT) | ||
find_program(CMAKE_MT NAMES llvm-mt REQUIRED DOC "LLVM Manifest Tool") | ||
endif() | ||
if(NOT PYTHON_EXECUTABLE) | ||
find_program(PYTHON_EXECUTABLE PATHS "$ENV{CONDA_PREFIX}" NAMES python REQUIRED DOC "Python Interpreter (Conda)") | ||
endif() | ||
|
||
if(EXISTS $ENV{CONDA_PREFIX}/xwin) | ||
cmake_path(CONVERT "$ENV{CONDA_PREFIX}\\xwin" TO_CMAKE_PATH_LIST XWIN_PREFIX) | ||
|
||
set(CMAKE_C_FLAGS_INIT "/winsysroot ${XWIN_PREFIX} -fuse-ld=lld-link") | ||
set(CMAKE_CXX_FLAGS_INIT "/winsysroot ${XWIN_PREFIX} -fuse-ld=lld-link") | ||
set(CMAKE_RC_FLAGS_INIT "/winsysroot ${XWIN_PREFIX} -fuse-ld=lld-link") | ||
set(CMAKE_LINKER ${CMAKE_CURRENT_LIST_DIR}/xwin-link.bat CACHE FILEPATH "LLD Linker for the Xwin SDK") | ||
elseif(NOT CMAKE_LINKER) | ||
find_program(CMAKE_LINKER NAMES lld-link REQUIRED DOC "LLD Linker (MSVC Compatible)") | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.