Skip to content

Commit 905e90a

Browse files
committed
Adding x64 for V2. Fixes #2909
1 parent 02f70ce commit 905e90a

File tree

5 files changed

+62
-18
lines changed

5 files changed

+62
-18
lines changed

build.ps1

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function CrossGen([string] $runtime, [string] $publishTarget, [string] $privateS
4444

4545
# Modify web.config for inproc
4646
dotnet tool install -g dotnet-xdt --version 2.1.0-rc.1
47-
dotnet-xdt -s "$privateSiteExtensionPath\web.config" -t "$privateSiteExtensionPath\web.InProcess.xdt" -o "$privateSiteExtensionPath\web.config"
47+
dotnet-xdt -s "$privateSiteExtensionPath\web.config" -t "$privateSiteExtensionPath\web.InProcess.$runtime.xdt" -o "$privateSiteExtensionPath\web.config"
4848

4949
$successfullDlls =@()
5050
$failedDlls = @()
@@ -87,8 +87,9 @@ function CrossGen([string] $runtime, [string] $publishTarget, [string] $privateS
8787
}
8888

8989

90-
# If not self-contained
91-
Copy-Item -Path $privateSiteExtensionPath\runtimes\win\native\* -Destination $privateSiteExtensionPath -Force
90+
if ($runtime -eq "win-x86") {
91+
Copy-Item -Path $privateSiteExtensionPath\runtimes\win\native\* -Destination $privateSiteExtensionPath -Force
92+
}
9293

9394
#read-host "Press ENTER to continue..."
9495
Remove-Item -Recurse -Force $selfContained -ErrorAction SilentlyContinue
@@ -116,7 +117,26 @@ function DownloadNupkg([string] $nupkgPath, [string[]]$from, [string[]]$to) {
116117
}
117118
}
118119

119-
function BuildPackages([string] $runtime<#, [bool] $isSelfContained#>) {
120+
function BuildPackages([bool] $isNoRuntime) {
121+
if($isNoRuntime) {
122+
BuildOutput ""
123+
CreateZips ".no-runtime"
124+
} else {
125+
BuildOutput "win-x86"
126+
BuildOutput "win-x64"
127+
128+
New-Item -Itemtype directory -path $buildOutput\publish.runtime\SiteExtensions\Functions
129+
Move-Item -Path $buildOutput\publish.win-x86\SiteExtensions\Functions -Destination $buildOutput\publish.runtime\SiteExtensions\Functions\32bit -Force
130+
Move-Item -Path $buildOutput\publish.win-x64\SiteExtensions\Functions -Destination $buildOutput\publish.runtime\SiteExtensions\Functions\64bit -Force
131+
Move-Item -Path $buildOutput\publish.runtime\SiteExtensions\Functions\32bit\applicationHost.xdt -Destination $buildOutput\publish.runtime\SiteExtensions\Functions -Force
132+
Remove-Item -Path $buildOutput\publish.runtime\SiteExtensions\Functions\64bit\applicationHost.xdt
133+
134+
CreateZips ".runtime"
135+
}
136+
}
137+
138+
139+
function BuildOutput([string] $runtime) {
120140
$runtimeSuffix = ""
121141
if (![string]::IsNullOrEmpty($runtime)) {
122142
$runtimeSuffix = ".$runtime"
@@ -128,17 +148,28 @@ function BuildPackages([string] $runtime<#, [bool] $isSelfContained#>) {
128148
$siteExtensionPath = "$publishTarget\SiteExtensions"
129149
$privateSiteExtensionPath = "$siteExtensionPath\Functions"
130150

131-
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
132-
#dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -r $runtime -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
151+
if ($runtime -eq "win-x86" -or $runtime -eq "") {
152+
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
153+
} else {
154+
# There are no preinstalled 'x64 .NET Core'/'x64 ASP.NET Core' on the stamp so we we need to build self-contained package for x64.
155+
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -r $runtime -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
156+
}
133157

134158
# replace IL dlls with crossgen dlls
135159
if (![string]::IsNullOrEmpty($runtime)) {
136160
CrossGen $runtime $publishTarget $privateSiteExtensionPath
137161
}
162+
}
138163

139-
# Do not put siffux to win-x86 zips names
140-
if ($runtime -eq "win-x86") {
141-
$runtimeSuffix = "";
164+
165+
function CreateZips([string] $runtimeSuffix) {
166+
$publishTarget = "$buildOutput\publish$runtimeSuffix"
167+
$siteExtensionPath = "$publishTarget\SiteExtensions"
168+
$privateSiteExtensionPath = "$siteExtensionPath\Functions"
169+
170+
# We do not want .runtime as suffix for zips
171+
if ($runtimeSuffix -eq ".runtime") {
172+
$runtimesuffix = "";
142173
}
143174

144175
ZipContent $privateSiteExtensionPath "$buildOutput\Functions.Binaries.$extensionVersion-alpha$runtimeSuffix.zip"
@@ -184,9 +215,9 @@ $bypassPackaging = $env:APPVEYOR_PULL_REQUEST_NUMBER -and -not $env:APPVEYOR_PUL
184215
if ($bypassPackaging){
185216
Write-Host "Bypassing artifact packaging and CrossGen for pull request." -ForegroundColor Yellow
186217
} else {
187-
# build IL extensions
188-
BuildPackages ""
218+
# build no-runntime extension
219+
BuildPackages 1
189220

190-
#build win-x86 extensions
191-
BuildPackages "win-x86"
221+
#build win-x86 and win-x64 extension
222+
BuildPackages 0
192223
}

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@
2424
<ItemGroup>
2525
<None Remove="applicationHost.xdt" />
2626
<None Remove="Resources\Functions\WarmUp\run.csx" />
27-
<None Remove="web.InProcess.xdt" />
27+
<None Remove="web.InProcess.win-x64.xdt" />
28+
<None Remove="web.InProcess.win-x86.xdt" />
2829
</ItemGroup>
2930
<ItemGroup>
3031
<Content Include="applicationHost.xdt">
3132
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3233
</Content>
33-
<Content Include="web.InProcess.xdt">
34+
<Content Include="web.InProcess.win-x64.xdt">
35+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
36+
</Content>
37+
<Content Include="web.InProcess.win-x86.xdt">
3438
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3539
</Content>
3640
</ItemGroup>

src/WebJobs.Script.WebHost/applicationHost.xdt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<site name="%XDT_SITENAME%" xdt:Locator="Match(name)">
66
<application path="/" xdt:Locator="Match(path)" xdt:Transform="Remove" />
77
<application path="/" applicationPool="%XDT_APPPOOLNAME%" xdt:Transform="Insert">
8-
<virtualDirectory path="/" physicalPath="%XDT_EXTENSIONPATH%" />
9-
</application>
8+
<virtualDirectory path="/" physicalPath="%XDT_EXTENSIONPATH%\%XDT_BITNESS%" />
9+
</application>
1010
</site>
1111
</sites>
1212
</system.applicationHost>
1313
<system.webServer>
1414
<globalModules>
1515
<add name="AspNetCoreModuleV2" xdt:Locator="Match(name)" xdt:Transform="Remove" />
16-
<add name="AspNetCoreModuleV2" image="%XDT_EXTENSIONPATH%\ancm\aspnetcoreV2.dll" xdt:Transform="Insert" />
16+
<add name="AspNetCoreModuleV2" image="%XDT_EXTENSIONPATH%\%XDT_BITNESS%\ancm\aspnetcoreV2.dll" xdt:Transform="Insert" />
1717
</globalModules>
1818
</system.webServer>
1919
<location path="%XDT_SITENAME%" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing">
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
<system.webServer>
4+
<handlers>
5+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" xdt:Transform="Replace" xdt:Locator="Match(name)" />
6+
</handlers>
7+
<aspNetCore processPath=".\Microsoft.Azure.WebJobs.Script.WebHost.exe" arguments="" stdoutLogEnabled="false" hostingModel="inprocess" xdt:Transform="Replace" />
8+
</system.webServer>
9+
</configuration>
File renamed without changes.

0 commit comments

Comments
 (0)