-
Notifications
You must be signed in to change notification settings - Fork 514
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
[msbuild] Fix creating Build.zip. #16445
Conversation
We recently switched from building the msbuild tasks with 'msbuild' to use 'dotnet build' instead. One difference between the two methods is that 'dotnet build' doesn't copy referenced assemblies to the output path. This turns out to be a problem because we zip up the output from the Xamarin.Messaging.Build project, and expect it to contain everything required to load the Xamarin.Messaging.Build assembly (this zip file is shipped with our VS (Windows) support, and during remote execution copied to the connected mac and then the build from Windows will load the assembly on the Mac in order to do stuff on the Mac). Another problem is that we include MSBuild assemblies from the '$(MSBuildBinPath)' location, which is now different (we used to pick up Mono's MSBuild assemblies, and that changed when we started building with .NET). In other words: because the Build.zip file stopped containing all the required files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped working. Ref: xamarin#16418 Here we attempt to fix this by: * Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced assemblies to the output directory. * Explicitly referencing Mono's MSBuild assemblies instead of relying upon finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ Generator diffGenerator diff is empty Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 223 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Build agent looks good!
We recently switched from building the msbuild tasks with 'msbuild' to use 'dotnet build' instead. One difference between the two methods is that 'dotnet build' doesn't copy referenced assemblies to the output path. This turns out to be a problem because we zip up the output from the Xamarin.Messaging.Build project, and expect it to contain everything required to load the Xamarin.Messaging.Build assembly (this zip file is shipped with our VS (Windows) support, and during remote execution copied to the connected mac and then the build from Windows will load the assembly on the Mac in order to do stuff on the Mac). Another problem is that we include MSBuild assemblies from the '$(MSBuildBinPath)' location, which is now different (we used to pick up Mono's MSBuild assemblies, and that changed when we started building with .NET). In other words: because the Build.zip file stopped containing all the required files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped working. Ref: xamarin#16418 Here we attempt to fix this by: * Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced assemblies to the output directory. * Explicitly referencing Mono's MSBuild assemblies instead of relying upon finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
We recently switched from building the msbuild tasks with 'msbuild' to use 'dotnet build' instead. One difference between the two methods is that 'dotnet build' doesn't copy referenced assemblies to the output path. This turns out to be a problem because we zip up the output from the Xamarin.Messaging.Build project, and expect it to contain everything required to load the Xamarin.Messaging.Build assembly (this zip file is shipped with our VS (Windows) support, and during remote execution copied to the connected mac and then the build from Windows will load the assembly on the Mac in order to do stuff on the Mac). Another problem is that we include MSBuild assemblies from the '$(MSBuildBinPath)' location, which is now different (we used to pick up Mono's MSBuild assemblies, and that changed when we started building with .NET). In other words: because the Build.zip file stopped containing all the required files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped working. Ref: xamarin#16418 Here we attempt to fix this by: * Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced assemblies to the output directory. * Explicitly referencing Mono's MSBuild assemblies instead of relying upon finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
We recently switched from building the msbuild tasks with 'msbuild' to use 'dotnet build' instead. One difference between the two methods is that 'dotnet build' doesn't copy referenced assemblies to the output path. This turns out to be a problem because we zip up the output from the Xamarin.Messaging.Build project, and expect it to contain everything required to load the Xamarin.Messaging.Build assembly (this zip file is shipped with our VS (Windows) support, and during remote execution copied to the connected mac and then the build from Windows will load the assembly on the Mac in order to do stuff on the Mac). Another problem is that we include MSBuild assemblies from the '$(MSBuildBinPath)' location, which is now different (we used to pick up Mono's MSBuild assemblies, and that changed when we started building with .NET). In other words: because the Build.zip file stopped containing all the required files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped working. Ref: xamarin#16418 Here we attempt to fix this by: * Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced assemblies to the output directory. * Explicitly referencing Mono's MSBuild assemblies instead of relying upon finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
We recently switched from building the msbuild tasks with 'msbuild' to use 'dotnet build' instead. One difference between the two methods is that 'dotnet build' doesn't copy referenced assemblies to the output path. This turns out to be a problem because we zip up the output from the Xamarin.Messaging.Build project, and expect it to contain everything required to load the Xamarin.Messaging.Build assembly (this zip file is shipped with our VS (Windows) support, and during remote execution copied to the connected mac and then the build from Windows will load the assembly on the Mac in order to do stuff on the Mac). Another problem is that we include MSBuild assemblies from the '$(MSBuildBinPath)' location, which is now different (we used to pick up Mono's MSBuild assemblies, and that changed when we started building with .NET). In other words: because the Build.zip file stopped containing all the required files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped working. Ref: xamarin#16418 Here we attempt to fix this by: * Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced assemblies to the output directory. * Explicitly referencing Mono's MSBuild assemblies instead of relying upon finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
…msbuild. (#17256) Mono has a networking bug that NuGet often triggers, leading to build failures like this: [...] GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/49e5305d-d845-4a14-9d69-6f5dbfb9570c/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/9d6ecda8-a4ca-4c13-8c0c-939b925b1f31/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 263ms Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json OK https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 261ms NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/2a281e02-c7a8-4a75-8582-3407d441de57/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 272ms [...] This is very annoying when it happens on our bots, because we have to retry the build until it works. I initially tried to fix this by simplify building the msbuild solution with .NET, and while that worked (the random network errors in NuGet disappeared), another issue surfaced (ref: #16418). This other issue was fixed in main (#16445), but on the release branches the original fix was reverted instead, since that was the safest approach (better to have random network errors on the bots than ship a something that doesn't work 100% of the time). However, due to the number of release branches we currently have (and they're unlikely to decrease in number any time soon), the random network errors on the bots are getting more and more disruptive, so let's try the fix again on our release branches. Ref: #16445, #16428.
…nstead of msbuild. (#17257) Mono has a networking bug that NuGet often triggers, leading to build failures like this: [...] GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/49e5305d-d845-4a14-9d69-6f5dbfb9570c/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/9d6ecda8-a4ca-4c13-8c0c-939b925b1f31/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 263ms Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json OK https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 261ms NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/2a281e02-c7a8-4a75-8582-3407d441de57/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 272ms [...] This is very annoying when it happens on our bots, because we have to retry the build until it works. I initially tried to fix this by simplify building the msbuild solution with .NET, and while that worked (the random network errors in NuGet disappeared), another issue surfaced (ref: #16418). This other issue was fixed in main (#16445), but on the release branches the original fix was reverted instead, since that was the safest approach (better to have random network errors on the bots than ship a something that doesn't work 100% of the time). However, due to the number of release branches we currently have (and they're unlikely to decrease in number any time soon), the random network errors on the bots are getting more and more disruptive, so let's try the fix again on our release branches. Ref: #16445, #16428. Backport of #17256 Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
…msbuild. (#17258) Mono has a networking bug that NuGet often triggers, leading to build failures like this: [...] GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/49e5305d-d845-4a14-9d69-6f5dbfb9570c/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/9d6ecda8-a4ca-4c13-8c0c-939b925b1f31/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 263ms Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json OK https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 261ms NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/2a281e02-c7a8-4a75-8582-3407d441de57/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 272ms [...] This is very annoying when it happens on our bots, because we have to retry the build until it works. I initially tried to fix this by simplify building the msbuild solution with .NET, and while that worked (the random network errors in NuGet disappeared), another issue surfaced (ref: #16418). This other issue was fixed in main (#16445), but on the release branches the original fix was reverted instead, since that was the safest approach (better to have random network errors on the bots than ship a something that doesn't work 100% of the time). However, due to the number of release branches we currently have (and they're unlikely to decrease in number any time soon), the random network errors on the bots are getting more and more disruptive, so let's try the fix again on our release branches. Ref: #16445, #16428. Backport of #17256 Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
…nstead of msbuild. (#17259) Mono has a networking bug that NuGet often triggers, leading to build failures like this: [...] GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/49e5305d-d845-4a14-9d69-6f5dbfb9570c/nuget/v3/flat2/system.threading.tasks.extensions/index.json GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/9d6ecda8-a4ca-4c13-8c0c-939b925b1f31/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 263ms Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json Retrying 'FindPackagesByIdAsync' for source 'https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json'. Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. GET https://pkgs.dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_packaging/bcd6855c-070e-4cb7-a698-ac197b93cd87/nuget/v3/flat2/system.threading.tasks.extensions/index.json OK https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 261ms NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/2a281e02-c7a8-4a75-8582-3407d441de57/nuget/v3/flat2/system.runtime.serialization.primitives/index.json 272ms [...] This is very annoying when it happens on our bots, because we have to retry the build until it works. I initially tried to fix this by simplify building the msbuild solution with .NET, and while that worked (the random network errors in NuGet disappeared), another issue surfaced (ref: #16418). This other issue was fixed in main (#16445), but on the release branches the original fix was reverted instead, since that was the safest approach (better to have random network errors on the bots than ship a something that doesn't work 100% of the time). However, due to the number of release branches we currently have (and they're unlikely to decrease in number any time soon), the random network errors on the bots are getting more and more disruptive, so let's try the fix again on our release branches. Ref: #16445, #16428. Backport of #17256 Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
We recently switched from building the msbuild tasks with 'msbuild' to use
'dotnet build' instead.
One difference between the two methods is that 'dotnet build' doesn't copy
referenced assemblies to the output path.
This turns out to be a problem because we zip up the output from the
Xamarin.Messaging.Build project, and expect it to contain everything required
to load the Xamarin.Messaging.Build assembly (this zip file is shipped with
our VS (Windows) support, and during remote execution copied to the connected
mac and then the build from Windows will load the assembly on the Mac in order
to do stuff on the Mac).
Another problem is that we include MSBuild assemblies from the
'$(MSBuildBinPath)' location, which is now different (we used to pick up
Mono's MSBuild assemblies, and that changed when we started building with
.NET).
In other words: because the Build.zip file stopped containing all the required
files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped
working.
Ref: #16418
Here we attempt to fix this by:
assemblies to the output directory.
finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to
hardcode Mono's path, since it's unlikely we'll get any new Mono updates.