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

Stop silent iOS updates with hard minimum requirements on xcode #19934

Closed
svaldetero opened this issue Jan 16, 2024 · 10 comments
Closed

Stop silent iOS updates with hard minimum requirements on xcode #19934

svaldetero opened this issue Jan 16, 2024 · 10 comments
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@svaldetero
Copy link

Description

I have a maui ios app the builds in Azure Devops Pipelines. It builds fine on monday. On Tuesday it now has a build error. The reason is that Microsoft.NET.Sdk.iOS.Manifest-8.0.100 nuget / workload was updated from 17.0 to 17.2. Which now has a hard requirement on XCode 15.1. I previously pinned the Xcode version to 15.0.1 since that's what was required before and xcode 15 is not the default version on macos-13 image.

This scenario has happened several times before with .net7.

Does every minor update imply a new xcode requirement? I'm even pinning .net to 8.0.x, but that didn't help since it is still 8.0.100 but the workload went from 17.0 -> 17.2.

For reference, here are my steps to setup the build:

parameters:
  platform: 'any'
  workload: 'maui-ios maui-android'
  xcodeversion: '15.0.1'

steps:
- task: UseDotNet@2
  displayName: 'Setup .NET' 
  inputs:
    packageType: 'sdk'
    version: '8.0.x'
    includePreviewVersions: true
    installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |
    dotnet workload install ${{ parameters.workload }} --source https://api.nuget.org/v3/index.json
    dotnet workload list
  displayName: 'Install MAUI Workload(s)'

- bash: |

    echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_${{ parameters.xcodeversion }}.app
    sudo xcode-select --switch /Applications/Xcode_${{ parameters.xcodeversion }}.app/Contents/Developer
  
  displayName: 'Select Xcode version'

I comment out the xcode step when the default is the correct version, however this problem inevitable happens again at some point.

Steps to Reproduce

  1. Create a working build pipeline
  2. Do nothing
  3. Wait for a workload update that has a new minimum xcode requirement
  4. Next time building the pipeline breaks

Link to public reproduction project repository

No response

Version with bug

8.0.5

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

8.0.3

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Update my pipeline to select a different xcode version OR update the workload install step to pin to a specific rollback file using an undocumented parameter.

Relevant log output

These are the errors that I get when this scenario happens:

ILLINK : warning MT0079: The recommended Xcode version for Microsoft.iOS 17.2.8004 is Xcode 15.1 or later. The current Xcode version (found in /Applications/Xcode_15.0.1.app/Contents/Developer) is 15.0.1. [/Users/runner/work/1/s/Mobile/src/Maui/i2.POS.Maui.csproj::TargetFramework=net8.0-ios]
ILLink : unknown error IL7000: An error occured while executing the custom linker steps. Please review the build log for more information. [/Users/runner/work/1/s/Mobile/src/Maui/i2.POS.Maui.csproj::TargetFramework=net8.0-ios]
ILLINK : error MT0180: This version of Microsoft.iOS requires the iOS 17.2 SDK (shipped with Xcode 15.1). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only in your project's iOS Build Options > Linker Behavior (to try to avoid the new APIs). [/Users/runner/work/1/s/Mobile/src/Maui/i2.POS.Maui.csproj::TargetFramework=net8.0-ios]
ILLINK : error MT2301: The linker step 'Setup' failed during processing: This version of Microsoft.iOS requires the iOS 17.2 SDK (shipped with Xcode 15.1). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only in your project's iOS Build Options > Linker Behavior (to try to avoid the new APIs). [/Users/runner/work/1/s/Mobile/src/Maui/i2.POS.Maui.csproj::TargetFramework=net8.0-ios]
@svaldetero svaldetero added the t/bug Something isn't working label Jan 16, 2024
@samhouts samhouts added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label Feb 2, 2024
@negberts
Copy link

Not sure if this is related, but we are suddenly getting errors on nuget restore because of a changed iOS version:

"/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln" (Restore target) (1) ->
       (Restore target) -> 
         /Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp/Pim.MobileApp.Maui/Pim.MobileApp.Maui.csproj : error NU1202: Package Shiny.Hosting.Maui 3.2.2 is not compatible with **net8.0-ios16.1** (.NETCoreApp,Version=v8.0). Package Shiny.Hosting.Maui 3.2.2 supports: [/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln]
       /Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp/Pim.MobileApp.Maui/Pim.MobileApp.Maui.csproj : error NU1202:   - net8.0-android34.0 (.NETCoreApp,Version=v8.0) [/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln]
       /Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp/Pim.MobileApp.Maui/Pim.MobileApp.Maui.csproj : error NU1202:   - **net8.0-ios17.0** (.NETCoreApp,Version=v8.0) [/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln]
       /Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp/Pim.MobileApp.Maui/Pim.MobileApp.Maui.csproj : error NU1202:   - net8.0-maccatalyst17.0 (.NETCoreApp,Version=v8.0) [/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln]
       /Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp/Pim.MobileApp.Maui/Pim.MobileApp.Maui.csproj : error NU1202:   - net8.0-windows10.0.19041 (.NETCoreApp,Version=v8.0) [/Users/runner/work/1/s/Pim.MobileApp/Pim.MobileApp.sln]

Builds were doing fine a week ago and no changes have been made to our code. Building against the macOS-13 agent, but the macOS-latest is also not working. What is changing in these agents that builds are suddenly not working anymore? And is there any way for me to fix this?

@negberts
Copy link

So apparantly it is/was in the install maui steps... Previously the following packages where installed:
Installing pack Microsoft.iOS.Sdk version 17.2.8004..

And now suddenly:
Installing pack Microsoft.iOS.Sdk version 16.4.7129...

@negberts
Copy link

negberts commented Feb 15, 2024

--from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/8.0.6.json added to the install maui task solved my issue. But I still don't understand why I suddenly have to...

@svaldetero
Copy link
Author

Building against the macOS-13 agent, but the macOS-latest is also not working

FYI, macos-latest is macos-12, not macos-13. Which might make sense why it installed a lower version 17.2 -> 16.4

I don't think this is the same issue as mine as you changed the OS that you're running on which, in turn, has different defaults or maximum versions. My issue is that the underlying iOS nuget package was updated for the same SDK version, and how it has a new minimum requirement. I changed nothing, and with .net8 pinned, it still did an upgrade the broke the build.

@negberts
Copy link

@svaldetero both runs were against the macos-13 agent... It just suddenly stopped installing 17.2 when installing maui.

@Redth
Copy link
Member

Redth commented Apr 9, 2024

I believe this is due to packages being updated during a workload install, so some are not yet published/indexed/available on NuGet.org feed while the command is run.

Related: dotnet/sdk#23820

@svaldetero
Copy link
Author

@Redth This issue is more that the same SDK version increased the minimum version of something else (xcode). And that new minimum version was no longer the default installation.

@Redth
Copy link
Member

Redth commented Apr 9, 2024

Ahh yeah sorry, I misunderstood this one as it was linked from another related to package publishing.

We do have plans to try publishing multi targeted macios workloads and then try to always build MAUI against the older target platform version to avoid this type of issue in the future.

@Zhanglirong-Winnie
Copy link

Hi, @svaldetero
Please check #18632 to see if it is the same as your problem and see if the solution can solve your problem.

@Zhanglirong-Winnie Zhanglirong-Winnie added the s/triaged Issue has been reviewed label Jul 5, 2024
@jfversluis
Copy link
Member

In these scenarios you probably want to pin a version as much as possible. You should be able to do so with what is described here.

Otherwise unfortunately there is not much we can do. This is something that comes from the .NET for iOS layer. Hope this helps!

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants