Windows: fix 64-bit mzdyn.exp
Also, make the `raco exe` tests more accommodating to uncooperative Windows configurations.
This commit is contained in:
parent
e9cd1e5595
commit
f8aeed279b
|
@ -44,10 +44,23 @@
|
|||
[else "bin"])
|
||||
(mk-dest-bin #t)))
|
||||
|
||||
(define (call-with-retries thunk)
|
||||
(let loop ([sleep-time 0.01])
|
||||
(with-handlers ([exn:fail:filesystem? (lambda (exn)
|
||||
;; Accommodate Windows background tasks,
|
||||
;; like anti-virus software and indexing,
|
||||
;; that can prevent an ".exe" from being deleted
|
||||
(if (= sleep-time 1.0)
|
||||
(raise exn)
|
||||
(begin
|
||||
(sleep sleep-time)
|
||||
(loop (* 2 sleep-time)))))])
|
||||
(thunk))))
|
||||
|
||||
(define (prepare exe src)
|
||||
(printf "Making ~a with ~a...\n" exe src)
|
||||
(when (file-exists? exe)
|
||||
(delete-file exe)))
|
||||
(call-with-retries (lambda () (delete-file exe)))))
|
||||
|
||||
(define (try-one-exe exe expect mred?)
|
||||
(printf "Running ~a\n" exe)
|
||||
|
@ -76,8 +89,10 @@
|
|||
(test #t
|
||||
path
|
||||
(parameterize ([current-output-port out])
|
||||
(system* path))))))
|
||||
(delete-directory/files temp-home-dir)
|
||||
(system* path))))))
|
||||
(call-with-retries
|
||||
(lambda ()
|
||||
(delete-directory/files temp-home-dir)))
|
||||
(let ([stdout-file (build-path (find-system-path 'temp-dir) "stdout")])
|
||||
(if (file-exists? stdout-file)
|
||||
(test expect with-input-from-file stdout-file
|
||||
|
@ -90,7 +105,9 @@
|
|||
;; Build a distribution directory, and try that, too:
|
||||
(printf " ... from distribution ...\n")
|
||||
(when (directory-exists? dist-dir)
|
||||
(delete-directory/files dist-dir))
|
||||
(call-with-retries
|
||||
(lambda ()
|
||||
(delete-directory/files dist-dir))))
|
||||
(assemble-distribution dist-dir (list exe) #:copy-collects collects)
|
||||
(dist-hook)
|
||||
(try-one-exe (build-path dist-dir
|
||||
|
@ -98,7 +115,10 @@
|
|||
dist-mred-exe
|
||||
dist-mz-exe))
|
||||
expect mred?)
|
||||
(delete-directory/files dist-dir)))
|
||||
(when (directory-exists? dist-dir)
|
||||
(call-with-retries
|
||||
(lambda ()
|
||||
(delete-directory/files dist-dir))))))
|
||||
|
||||
(define (base-compile e)
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
set BUILD_CONFIG=%1
|
||||
set PLATFORM_CONFIG=%2
|
||||
|
||||
if "%BUILD_CONFIG%"=="SDebug" goto asdebug
|
||||
if "%BUILD_CONFIG%"=="BDebug" goto asdebug
|
||||
|
@ -11,7 +12,12 @@ cl /Od /D"_DEBUG" /RTC1 /MTd /GS /W3 -I../include -I../../worksp /c mzdyn.c
|
|||
|
||||
:finish
|
||||
|
||||
lib -def:mzdyn.def -out:mzdyn.lib
|
||||
set MACHTYPE=x64
|
||||
if "%PLATFORM_CONFIG%"=="Win32" goto machready
|
||||
set MACHTYPE=X86
|
||||
:machready
|
||||
|
||||
lib -MACHINE:%MACHTYPE% -def:mzdyn.def -out:mzdyn.lib
|
||||
|
||||
mkdir ..\..\..\lib
|
||||
mkdir ..\..\..\lib\msvc
|
||||
|
|
|
@ -401,7 +401,8 @@
|
|||
|
||||
(system- (format "~a /MT /O2 /DMZ_PRECISE_GC /I../../racket/include /I.. /c ../../racket/dynsrc/mzdyn.c /Fomzdyn3m.obj"
|
||||
cl.exe))
|
||||
(system- "lib.exe -def:../../racket/dynsrc/mzdyn.def -out:mzdyn3m.lib")
|
||||
(system- (format "lib.exe -machine:~a -def:../../racket/dynsrc/mzdyn.def -out:mzdyn3m.lib"
|
||||
(if win64? "x64" "X86")))
|
||||
|
||||
(define (copy-file/diff src dest)
|
||||
(unless (and (file-exists? dest)
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
if errorlevel 1 exit 1
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
if errorlevel 1 exit 1
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -131,7 +131,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -181,7 +181,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -233,7 +233,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -279,7 +279,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -350,7 +350,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -400,7 +400,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -451,7 +451,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
CommandLine="
if exist "$(TargetPath)" goto :MzOK
echo Error: did not find $(TargetPath)
exit 1
:MzOK
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
if errorlevel 1 exit 1
"$(TargetPath)" -cu ..\..\racket\mksystem.rkt "$(TargetDir)/lib/system.rktd"
cd ..\..\racket\dynsrc
call mkmzdyn.bat $(ConfigurationName) $(PlatformName)
cd ..\..\worksp\racket
addman.bat

"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
|
|
|
@ -95,7 +95,7 @@ exit 1
|
|||
"$(TargetPath)" -cu ..\..\racket\mkincludes.rkt "$(TargetDir)/include/" ..\..\racket ..
|
||||
if errorlevel 1 exit 1
|
||||
cd ..\..\racket\dynsrc
|
||||
call mkmzdyn.bat $(Configuration)
|
||||
call mkmzdyn.bat $(Configuration) $(Platform)
|
||||
cd ..\..\worksp\racket
|
||||
addman.bat
|
||||
</Command>
|
||||
|
|
Loading…
Reference in New Issue
Block a user