Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Use arcade dependency management tooling #10890

Merged
merged 17 commits into from
Apr 2, 2021
Merged

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Mar 16, 2021

Context: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md

The dotnet core engineering group has some dependency management tooling
(known as darc) that we'd like to adopt. Integrating this tooling in
to the build system will make it easier to stay up to date with the
latest .NET 6 SDK changes.

Many dotnet repos use a publishing workflow that will push build
artifact data to a central location known as the "Build Asset Registry".
This data includes a "Channel" association, which is the key to
dependency updating. Local updates and automatic update "Subscriptions"
compare the version files in a given repo against the product versions
available in the channel that you are interested in.

We hope to be able to publish Xamarin SDK build information to this
central registry in the near future, so that other products can take a
dependency on us as needed (MAUI for instance).

The darc tool looks for four different files in a repo when adding a
dependency or when checking for an update:

  • eng/Version.Details.xml
  • eng/Versions.props
  • nuget.config
  • global.json

Both of the Version files present in the eng folder are updated when
a new dependency is available.

To work with darc locally you'll need to install the global tool, join
the arcade-contrib GitHub team, and configure your auth settings.

To add a new dependency, use the darc add-dependency command:

darc add-dependency -n Microsoft.NetCore.App.Runtime.ios-arm64 -t product -v 6.0.0-preview.2.21154.6 -r https://github.com/dotnet/runtime

To update all dependencies, use the darc update-dependencies
command:

darc update-dependencies --channel ".NET 6"

To configure automatic updates, use the darc add-subscription
command to enroll a target repo/branch into updates from a particular
channel:

 darc add-subscription --channel ".NET 6" --source-repo https://github.com/dotnet/installer --target-repo https://github.com/xamarin/xamarin-macios --target-branch main --update-frequency everyWeek --standard-automerge

Once a subscription is configured, a pull request will be created
automatically by the dotnet Maestro bot when dependency updates are
available.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent

<disabledPackageSources>
<clear />
</disabledPackageSources>
<config>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file looks like whitespace only changes?

Copy link
Member Author

@pjcollins pjcollins Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The darc tool formatted this file as part of dependency updating. I figure it's best to include those formatting changes in this initial PR so future auto PRs will only change version information.

@rolfbjarne one other related issue that I wanted your opinion on is that the update tooling currently requires that a global.json file exist in the root of the repo. I am going to test this later today, but I think we may need to change the way the global.json is generated as part of this PR as well. Do you have any initial thoughts on a preferred way to include a default global.json? It can be empty, it just needs to exist for the tool to run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If need a global.json in the repo, we have to stop generating it (or modifying it during the build), otherwise things will become annoying quite fast (with the file always showing up as modified).

I think the best option would be to:

  • Stop generating it
  • Commit the current generated result
  • Compute DOTNET_VERSION from it
  • Modify system-dependencies.sh to grep global.json instead of Make.config for the .NET version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, an we just do the trick I do with make + sed to stop needed to parse? Call make system-dependecies.sh and take the values from make.config.. I know, it add an extra step. Or maybe, is there a way to import the env values from the makefile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A root global.json file has been added, and the new dotnet.config make file now includes both DOTNET_VERSION and DOTNET6_VERSION. This keeps other $(DOTNET_VERSION) references working. DOTNET_URL has been moved from Make.config to system-dependencies.sh, and made "evergreen" by using a URL that stays constant (aside from the version).

DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION)))
DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21155.3/dotnet-sdk-6.0.100-preview.2.21155.3-osx-x64.pkg
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21155.3/dotnet-sdk-6.0.100-preview.2.21155.3-osx-x64.tar.gz
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$(DOTNET6_VERSION)/dotnet-sdk-$(DOTNET6_VERSION)-osx-x64.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolfbjarne that was requested (thrice iirc) and you mentioned using a variable would break other stuff (not that I can remember what exactly)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spouliot the reason was: #10501 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes in https://github.com/xamarin/xamarin-macios/pull/9885/files#diff-9e58bdf3f9a2fcd07e4cc0d4647a855b75995005a790f785d4ba6333d1fa7872L1021 removed the dependency that system-dependencies.sh had on the DOTNET6* variables. I removed DOTNET6_URL in this PR because I think that was the only place referencing it previously (and nothing seems to reference it now). We can generate the URL variable declaration as well if needed though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example of my left hand not knowing what my right hand does 🤦‍♂️

@pjcollins is right, we only look for DOTNET_VERSION now in system-dependencies.sh, the DOTNET6_* variables don't matter anymore.

Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the comment: #10501 (comment) we should not use the variable, or fix the dependencies.sh script.

DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION)))
DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21155.3/dotnet-sdk-6.0.100-preview.2.21155.3-osx-x64.pkg
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21155.3/dotnet-sdk-6.0.100-preview.2.21155.3-osx-x64.tar.gz
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$(DOTNET6_VERSION)/dotnet-sdk-$(DOTNET6_VERSION)-osx-x64.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spouliot the reason was: #10501 (comment)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

3 tests failed, 45 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1103'

<disabledPackageSources>
<clear />
</disabledPackageSources>
<config>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If need a global.json in the repo, we have to stop generating it (or modifying it during the build), otherwise things will become annoying quite fast (with the file always showing up as modified).

I think the best option would be to:

  • Stop generating it
  • Commit the current generated result
  • Compute DOTNET_VERSION from it
  • Modify system-dependencies.sh to grep global.json instead of Make.config for the .NET version.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent

@rolfbjarne
Copy link
Member

I think it would be nice to have the explanation of this whole process documented in the repo itself (i.e. the PR description), because almost nobody think think to look at the PR after it's been merged.

Maybe add it as docs/DARC.md?

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent

@pjcollins pjcollins marked this pull request as ready for review March 22, 2021 18:10
@pjcollins pjcollins requested a review from emaf as a code owner March 22, 2021 18:10
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

19 tests failed, 163 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (all optimizations) [dotnet]: BuildFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/tvOS - simulator/Debug [dotnet]: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug (iOS 10.3) [dotnet]: BuildFailure
  • introspection/tvOS - simulator/Debug (tvOS 10.2) [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1101'

@rolfbjarne
Copy link
Member

At least some of these failures are due to the bump itself, and will be fixed with #10772.

@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Mar 24, 2021
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

19 tests failed, 163 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (all optimizations) [dotnet]: BuildFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/tvOS - simulator/Debug [dotnet]: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug (iOS 10.3) [dotnet]: BuildFailure
  • introspection/tvOS - simulator/Debug (tvOS 10.2) [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1096'

…ur locally built ones.

The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

5 tests failed, 177 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (all optimizations) [dotnet]: Failed

Pipeline on Agent XAMBOT-1094'

@rolfbjarne
Copy link
Member

Threading changes broke waits: dotnet/runtime#50245

This is blocked until that bug is fixed (and an updated .NET 6 version is available), then this PR will have to be updated with the new .NET 6 version.

That required renaming simulator runtime packs...
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

1 tests failed, 79 tests passed.

Failed tests

  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)

Pipeline on Agent XAMBOT-1097'

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

1 tests failed, 79 tests passed.

Failed tests

  • MSBuild tests/Integration: Failed (Execution failed with exit code 28)

Pipeline on Agent XAMBOT-1095'

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

🎉 All 80 tests passed 🎉

Pipeline on Agent XAMBOT-1095'

spouliot added 2 commits April 1, 2021 19:59
This fix the issue with `Wait` that failed several tests in monotouch-tests

However it does not include the fix for AppConext.GetData on device (AOT)
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

🎉 All 94 tests passed 🎉

Pipeline on Agent XAMBOT-1099'

@dalexsoto dalexsoto merged commit 5c12fdf into main Apr 2, 2021
@dalexsoto dalexsoto deleted the arcade-auto-deps branch April 2, 2021 04:02
tj-devel709 pushed a commit that referenced this pull request Apr 7, 2021
* [build] Use arcade dependency management tooling

* Apply feedback

* Apply second round of feedback

* Always make dotnet.config before trying to read it

* Debugging

* Update dependencies, trim tabs and spaces

* [dotnet] Remove the existing workload shipped with .NET and install our locally built ones.

The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.

* Update .gitignores.

* Bump to 6.0.100-preview.3.21181.5

That required renaming simulator runtime packs...

* More rename for simulator packages

* moar (hopefully all)

* Bump to 6.0.100-preview.3.21201.11

This fix the issue with `Wait` that failed several tests in monotouch-tests

However it does not include the fix for AppConext.GetData on device (AOT)

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
Co-authored-by: Sebastien Pouliot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants