Skip to content

Commit

Permalink
Windows CI: Make sure building compiler/druntime/Phobos does NOT need…
Browse files Browse the repository at this point in the history
… an MSVC env anymore

After dlang#16248.
  • Loading branch information
kinke committed Mar 3, 2024
1 parent 02d6d07 commit 51c1f93
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .azure-pipelines/windows-msbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ setlocal
:: put bash and GNU tools in front of PATH
set PATH=C:\Program Files\Git\usr\bin;%PATH%

:: now set up MSVC environment (=> first link.exe etc. in PATH is MSVC's, not GNU's)
call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
@echo on

set DMD_DIR=%cd%
if "%CONFIGURATION%" == "" set CONFIGURATION=RelWithAsserts
set PLATFORM=Win32
Expand Down Expand Up @@ -85,6 +81,10 @@ if not "%C_RUNTIME%" == "mingw" goto not_mingw
set DRUNTIME_TESTS_TARGET=unittest-debug
:not_mingw

:: set up MSVC environment (some tests need cl.exe etc. in PATH)
call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
@echo on

echo [STEP]: Building and running druntime tests
cd "%DMD_DIR%\druntime"
make -j%N% MODEL=%MODEL% "DMD=%DMD%" %DRUNTIME_TESTS_TARGET% || exit /B 5
Expand Down
3 changes: 0 additions & 3 deletions .azure-pipelines/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,10 @@ clone_repos
################################################################################

if [ "$MODEL" == "64" ] ; then
MAKE_FILE="win64.mak"
LIBNAME=phobos64.lib
elif [ "$MODEL" == "32" ] ; then
MAKE_FILE="win64.mak"
LIBNAME=phobos32mscoff.lib
else # 32omf
MAKE_FILE="win32.mak"
LIBNAME=phobos.lib
fi

Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ jobs:
- name: 'Posix: Install prerequisites'
if: runner.os != 'Windows'
run: ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }}
- name: 'Windows: Set up MSVC environment'
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-vsdevenv@v4
with:
arch: ${{ env.MODEL == '64' && 'x64' || 'x86' }}

# NOTE: Linker ICEs with Xcode 15.0.1 (default version on macos-13)
# * https://issues.dlang.org/show_bug.cgi?id=24407
Expand Down Expand Up @@ -143,12 +138,14 @@ jobs:
env:
# on Windows, `ci/run.sh build` expects the DMD env var to be set to the DMD-CLI-compatible host compiler
DMD: ${{ runner.os == 'Windows' && (startsWith(matrix.host_dmd, 'ldc') && 'ldmd2' || 'dmd') || '' }}
# work around the LDC host compiler on Windows assuming the first link.exe in PATH is the MSVC one
# (VSINSTALLDIR is set, but GHA uses Git's bin\bash.exe for `shell: bash`, which prepends Git's usr\bin to PATH, with GNU link.exe)
LDC_VSDIR_FORCE: ${{ runner.os == 'Windows' && startsWith(matrix.host_dmd, 'ldc') && '1' || '' }}
- name: Rebuild dmd (with enabled coverage)
if: matrix.coverage
run: ENABLE_RELEASE=0 ENABLE_DEBUG=1 ENABLE_COVERAGE=1 ci/run.sh rebuild
- name: 'Windows: Set up MSVC environment' # some tests need cl.exe etc. in PATH
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-vsdevenv@v4
with:
arch: ${{ env.MODEL == '64' && 'x64' || 'x86' }}
- name: Test dmd
run: ci/run.sh test_dmd
- name: Test druntime
Expand Down
4 changes: 0 additions & 4 deletions druntime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,6 @@ $(abspath ../generated/$(OS)/$(BUILD)/$(MODEL)/dmd$(DOTEXE)): ../generated/$(OS)

################### C/ASM Targets ############################

# Although dmd is compiling the .c files, the preprocessor used on Windows is cl.exe.
# Until https://issues.dlang.org/show_bug.cgi?id=24111 is fixed, the INCLUDE
# enviroment variable needs to be set with the path to the VC system include files.

OBJS:=$(ROOT)/errno_c$(DOTOBJ)
ifeq (32omf,$(MODEL))
# minit.asm is only used for -m32omf on Windows; there's a pre-built minit.obj
Expand Down

0 comments on commit 51c1f93

Please sign in to comment.