Skip to content

Commit

Permalink
Merge branch 'main' into il_strip_net6
Browse files Browse the repository at this point in the history
  • Loading branch information
chamons authored Oct 4, 2021
2 parents ca0cab7 + ee14ab7 commit f5c2845
Show file tree
Hide file tree
Showing 119 changed files with 4,502 additions and 163 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Notify release branch change

on:
# trigger for main and release branches.
push:
branches:
- main
- release/*

jobs:
pingRemote:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: 'Ping remote repository'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.SERVICEACCOUNT_PAT }}
event-type: ping-mirror
repository: ${{ secrets.ORG }}/${{ secrets.REPO }}
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

49 changes: 49 additions & 0 deletions .github/workflows/pong.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Update local copy

on: repository_dispatch

# lock to ensure we do not step on each other
concurrency:
group: 'pong-mirror'
cancel-in-progress: false


jobs:
updateRemote:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: 'Debug context'
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: 'Add remotes'
run: |
git remote add public "http://$Env:GITHUB_TOKEN@github.com/xamarin/xamarin-macios.git"
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.access-token }}

- name: 'Fetch remote'
run: git fetch public

- name: 'Update local branch'
run: |
$branch = "$Env:BRANCH".Replace("refs/heads/","")
git checkout $branch
git pull public $branch
git push origin $branch
shell: pwsh
env:
BRANCH: ${{ github.event.client_payload.ref }}

- name: Merge public with private
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ github.event.client_payload.ref }}
target_branch: ${{ github.event.client_payload.ref }}-private
github_token: ${{ github.token }}
2 changes: 1 addition & 1 deletion builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ downloads/%: downloads/%.nupkg

downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME))): dotnet-install.sh
$(Q) echo "Downloading and installing .NET $(DOTNET6_VERSION) into $@..."
$(Q) ./dotnet-install.sh --install-dir "$@.tmp" --version "$(DOTNET6_VERSION)" --architecture x64 --no-path
$(Q) ./dotnet-install.sh --install-dir "$@.tmp" --version "$(DOTNET6_VERSION)" --architecture x64 --no-path $$DOTNET_INSTALL_EXTRA_ARGS
$(Q) rm -Rf "$@"
$(Q) mv "$@.tmp" "$@"
$(Q) echo "Downloaded and installed .NET $(DOTNET6_VERSION) into $@."
Expand Down
20 changes: 19 additions & 1 deletion dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@

<!-- outer build for multi-rid build -->
<BuildDependsOn Condition="'$(RuntimeIdentifiers)' != ''">
_CollectBundleResources;
_RunRidSpecificBuild;
_CompileEntitlements;
_DetectAppManifest;
_ReadAppManifest;
_WriteAppManifest;
_CopyResourcesToBundle;
_CreateMergedAppBundle;
Codesign;
CreateIpa;
Expand Down Expand Up @@ -295,11 +297,26 @@
<!-- Show an error if we're mixing simulator + device RIDs in a single build -->
<Error Condition="@(_RuntimeIdentifierDistinctPlatforms->Count()) > 1" Text="Building for all the runtime identifiers '$(RuntimeIdentifiers)' at the same time isn't possible, because they represent different platform variations." />

<PropertyGroup>
<_RidSpecificProperties>
_IsMultiRidBuild=true;
RuntimeIdentifiers=;
_ProcessedBundleResourcesPath=$(_ProcessedBundleResourcesPath);
_ProcessedContentPath=$(_ProcessedContentPath);
_ProcessedImageAssetsPath=$(_ProcessedImageAssetsPath);
_ProcessedInterfaceDefinitionsPath=$(_ProcessedInterfaceDefinitionsPath);
_ProcessedSceneKitAssetsPath=$(_ProcessedSceneKitAssetsPath);
_ProcessedColladaAssetsPath=$(_ProcessedColladaAssetsPath);
_ProcessedTextureAtlasesPath=$(_ProcessedTextureAtlasesPath);
_ProcessedCoreMLModelsPath=$(_ProcessedCoreMLModelsPath);
</_RidSpecificProperties>
</PropertyGroup>

<!-- Execute the inner builds -->
<MSBuild
Projects="$(MSBuildProjectFile)"
Targets="_BuildRidSpecificAppBundle"
Properties="RuntimeIdentifier=%(_RuntimeIdentifiersAsItems.Identity);RuntimeIdentifiers=;_IsMultiRidBuild=true">
Properties="RuntimeIdentifier=%(_RuntimeIdentifiersAsItems.Identity);$(_RidSpecificProperties)">
<Output TaskParameter="TargetOutputs" ItemName="_AssemblyPublishDirectories" />
</MSBuild>

Expand Down Expand Up @@ -428,6 +445,7 @@
MarshalManagedExceptionMode=$(_MarshalManagedExceptionMode)
MarshalObjectiveCExceptionMode=$(_MarshalObjectiveCExceptionMode)
@(_MonoLibrary -> 'MonoLibrary=%(Identity)')
MtouchFloat32=$(MtouchFloat32)
Optimize=$(_BundlerOptimize)
PartialStaticRegistrarLibrary=$(_LibPartialStaticRegistrar)
Platform=$(_PlatformName)
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-rtm.21478.8">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-rtm.21480.21">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>b83da76f5fede9432ca6efce8652a616efff2ea6</Sha>
<Sha>b2fac072e4480a39df132de7c152ff5466a1bbe3</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.100-1.21473.1" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/linker</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<!--Package versions-->
<PropertyGroup>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-rtm.21478.8</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-rtm.21480.21</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>6.0.100-1.21473.1</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftDotNetBuildTasksFeedPackageVersion>6.0.0-beta.21212.6</MicrosoftDotNetBuildTasksFeedPackageVersion>
<MicrosoftNETILStripTasksPackageVersion>6.0.0-rc.2.21468.3</MicrosoftNETILStripTasksPackageVersion>
Expand Down
167 changes: 167 additions & 0 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
# private AzDO feeds in the NuGet.config.
#
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
#
# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing
#
# - task: PowerShell@2
# displayName: Setup Private Feeds Credentials
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)

[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$ConfigFile,
[Parameter(Mandatory = $true)][string]$Password
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

. $PSScriptRoot\tools.ps1

# Add source entry to PackageSources
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")

if ($packageSource -eq $null)
{
$packageSource = $doc.CreateElement("add")
$packageSource.SetAttribute("key", $SourceName)
$packageSource.SetAttribute("value", $SourceEndPoint)
$sources.AppendChild($packageSource) | Out-Null
}
else {
Write-Host "Package source $SourceName already present."
}

AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password
}

# Add a credential node for the specified source
function AddCredential($creds, $source, $username, $password) {
# Looks for credential configuration for the given SourceName. Create it if none is found.
$sourceElement = $creds.SelectSingleNode($Source)
if ($sourceElement -eq $null)
{
$sourceElement = $doc.CreateElement($Source)
$creds.AppendChild($sourceElement) | Out-Null
}

# Add the <Username> node to the credential if none is found.
$usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']")
if ($usernameElement -eq $null)
{
$usernameElement = $doc.CreateElement("add")
$usernameElement.SetAttribute("key", "Username")
$sourceElement.AppendChild($usernameElement) | Out-Null
}
$usernameElement.SetAttribute("value", $Username)

# Add the <ClearTextPassword> to the credential if none is found.
# Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs.
# -> https://github.com/NuGet/Home/issues/5526
$passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']")
if ($passwordElement -eq $null)
{
$passwordElement = $doc.CreateElement("add")
$passwordElement.SetAttribute("key", "ClearTextPassword")
$sourceElement.AppendChild($passwordElement) | Out-Null
}
$passwordElement.SetAttribute("value", $Password)
}

function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Password) {
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")

Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."

ForEach ($PackageSource in $maestroPrivateSources) {
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password
}
}

function EnablePrivatePackageSources($DisabledPackageSources) {
$maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
ForEach ($DisabledPackageSource in $maestroPrivateSources) {
Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
# Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries
$DisabledPackageSources.RemoveChild($DisabledPackageSource)
}
}

if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
}

if (!$Password) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
ExitWithExitCode 1
}

# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)

# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}

# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
}

# Check for disabledPackageSources; we'll enable any darc-int ones we find there
$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources")
if ($disabledSources -ne $null) {
Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node"
EnablePrivatePackageSources -DisabledPackageSources $disabledSources
}

$userName = "dn-bot"

# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -Password $Password

$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$dotnet5Source = $sources.SelectSingleNode("add[@key='dotnet5']")
if ($dotnet5Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet5-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet5-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$dotnet6Source = $sources.SelectSingleNode("add[@key='dotnet6']")
if ($dotnet6Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet6-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet6-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$doc.Save($filename)
Loading

0 comments on commit f5c2845

Please sign in to comment.