From 298effbfccb4f53c52379df79b87d83269ea8d19 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Fri, 22 Oct 2021 09:54:00 -0500 Subject: [PATCH] Workaround for F# smoke-tests. --- src/SourceBuild/tarball/content/smoke-test.sh | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/SourceBuild/tarball/content/smoke-test.sh b/src/SourceBuild/tarball/content/smoke-test.sh index 5adebbe2f..e6b6e5ae6 100755 --- a/src/SourceBuild/tarball/content/smoke-test.sh +++ b/src/SourceBuild/tarball/content/smoke-test.sh @@ -247,21 +247,39 @@ function doCommand() { wait $! echo " terminated with exit code $?" | tee -a "$logFile" elif [ "$1" == "multi-rid-publish" ]; then - runPublishScenarios() { - "${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog" - "${dotnetCmd}" publish --self-contained true -r "$targetRid" /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog" - "${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog" - } + if [ "$lang" == "F#" ]; then + # F# tries to use a truncated version number unless we pass it this flag. see https://github.com/dotnet/source-build/issues/2554 + runPublishScenarios() { + "${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog" /p:_NETCoreSdkIsPreview=true + "${dotnetCmd}" publish --self-contained true -r "$targetRid" /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog" /p:_NETCoreSdkIsPreview=true + "${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog" /p:_NETCoreSdkIsPreview=true + } + else + runPublishScenarios() { + "${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog" + "${dotnetCmd}" publish --self-contained true -r "$targetRid" /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog" + "${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog" + } + fi if [ "$projectOutput" == "true" ]; then runPublishScenarios | tee -a "$logFile" else runPublishScenarios >> "$logFile" 2>&1 fi else - if [ "$projectOutput" == "true" ]; then - "${dotnetCmd}" $1 /bl:"$binlog" | tee -a "$logFile" + if [ "$lang" == "F#" ]; then + # F# tries to use a truncated version number unless we pass it this flag. see https://github.com/dotnet/source-build/issues/2554 + if [ "$projectOutput" == "true" ]; then + "${dotnetCmd}" $1 /bl:"$binlog" /p:_NETCoreSdkIsPreview=true | tee -a "$logFile" + else + "${dotnetCmd}" $1 /bl:"$binlog" /p:_NETCoreSdkIsPreview=true >> "$logFile" 2>&1 + fi else - "${dotnetCmd}" $1 /bl:"$binlog" >> "$logFile" 2>&1 + if [ "$projectOutput" == "true" ]; then + "${dotnetCmd}" $1 /bl:"$binlog" | tee -a "$logFile" + else + "${dotnetCmd}" $1 /bl:"$binlog" >> "$logFile" 2>&1 + fi fi fi if [ $? -eq 0 ]; then @@ -305,7 +323,8 @@ function runAllTests() { doCommand VB xunit new restore test doCommand VB mstest new restore test - doCommand F# console new restore build run multi-rid-publish + # "run" was removed from the list below. see https://github.com/dotnet/source-build/issues/2554 + doCommand F# console new restore build multi-rid-publish doCommand F# classlib new restore build multi-rid-publish doCommand F# xunit new restore test doCommand F# mstest new restore test @@ -334,10 +353,12 @@ function runWebTests() { # doCommand C# blazorwasm "$@" new restore build run publish doCommand C# blazorserver "$@" new restore build run publish - doCommand F# web "$@" new restore build run multi-rid-publish + # "run" was removed from the list below. see https://github.com/dotnet/source-build/issues/2554 + doCommand F# web "$@" new restore build multi-rid-publish # Requires prereqs (non-source-built packages) - re-enable with https://github.com/dotnet/source-build/issues/2550 # doCommand F# mvc "$@" new restore build run multi-rid-publish - doCommand F# webapi "$@" new restore build run multi-rid-publish + # "run" was also removed from this set, same issue: https://github.com/dotnet/source-build/issues/2554 + doCommand F# webapi "$@" new restore build multi-rid-publish } function runXmlDocTests() {