dotnet / aspnetcore Public
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
Command-line build fails on Apple M1 silicon during the restore.sh
step
#40109
Comments
Hmm, this looks like an infra issue given the 404, rather than M1 / Apple Silicon specific.
Can you please try again in a few hours? |
@TanayParikh I tried running the |
Could we add a block to global.json like Lines 12 to 14 in 000c458
|
That won't work @wtgodbe because the problem is w/ older runtimes that are needed in some of our projects. We're a bit stuck here because we have projects targeting both The tooling / task projects could perhaps be disabled when on macOS Arm64 and we might be able to use a different copy of dotnet-ef.dll these days. The problem w/ the first part is the build would be incomplete. I'm not sure the second part is viable. The other option might be to use more recent TFMs but only when building on macOS Arm64. Would just require a few more properties set w/ appropriate |
@dougbu Would you suggest a workaround for this? Alternatively, do you think it would be possible to make a fix that would let me run a build just for the Mvc solution with no dependencies? My ultimate goal is to try submitting a pull request for a small enhancement, but I need to be able to build from the sources before I get started. |
Not sure but removing the problematic item or items from global.json and running restore.sh and src/Mvc/build.sh with |
@Chrisboh @dotnet/dnceng is there general guidance for building on newer RIDs that we don't have support for on older TFMs? This repo currently doesn't build on Apple Silicon because we specify 2.1 & 3.1 runtimes in global.json |
I am not sure if there is any general guidance here. @mmitche do you know? |
I don't think there is anything specifically written down, but typically we've had to bootstrap these situations with a preview SDK. Essentially a stage0 type update. |
Does that mean adding the rid to |
Is that viable given the OpenAPI "glue" (the main place we use I can think of a few ways forward which leave the OpenAPI stuff mostly alone and avoid creating a preview SDK for a relatively limited case. I may be overly worried about the complexity of that option however.
I would appreciate everyone's thoughts on the various options. Better ideas much appreciated /cc @rafikiassumani-msft because anything we do here may impact Microsoft.Extensions.ApiDescription.Server. |
I'm a fan of option 1, if it works - the downlevel versions in the SDK are already very up to date: https://github.com/dotnet/installer/blob/b6c29ddce6f3d0472e3449bb65fef6c08b9bd644/src/redist/targets/GenerateBundledVersions.targets#L27-L32 @dasblinkenlight could you try restoring/building this branch to see if it works on Apple silicon? https://github.com/dotnet/aspnetcore/tree/wtgodbe/Silicon |
@wtgodbe I can't get your branch - I see it when I browse to the URL, but trying to fetch gives me a "Permission denied" error:
|
Try (from your aspnetcore directory):
|
@wtgodbe This worked perfectly. I started |
None. We're not using much test coverage on the 3.1 side and our 2.1 usage is teensy. |
Should work out-of-the-box now as of #40393 |
I tried to run ./build.sh on a fresh M1 and it failed.
Build Erros:
System Info
Regarding the message in the build which says it detected an unknown CPU, I tried to check the source and on my machine aspnetcore/eng/common/dotnet-install.sh Line 53 in 0aa76cc
I tried also to change the |
@omajid is the above discrepancy in dotnet-install known? |
I wasn't aware of it until now. That part of dotnet-install.sh was adapted from the similar piece of code in dotnet/runtime, in 2019. Later, in 2020, runtime took this change that we should also include in dotnet-install.sh: https://github.com/dotnet/runtime/pull/39142/files#diff-692d7a1cb247ffea0cb746bd6f4c3d576406e279af19a1810c0278ca5f16f28c Would you like me to do a PR? I dont have macOS arm64 machine to test, though. |
I think we should update the global dotnet-install scripts to account for arm64 - I unfortunately also don't have a macOS arm64 test machine. Maybe @dotnet/dnceng could help you access one if need be |
@wtgodbe I can do it also if you want, adding aspnetcore/eng/common/dotnet-install.sh Line 55 in 0aa76cc
|
@xsoheilalizadeh Yes, that would be great! |
PR #40698 |
Thank you for the PR, but that file is centrally managed & shared by many dotnet repos - @omajid will handle making the centralized fix |
Had to revert #40393, if we can find a way to use |
We have and can share an M1 machine on a limited basis. Just ping @ilyas1974 when you're ready; they're limited so we'd like to minimize downtime if possible. |
Is there an existing issue for this?
Describe the bug
Step 3 from the Build ASP.NET Core from Source guide fails on Apple M1 silicon.
When I run
./restore.sh
I get several errors that look like the one pasted below:The run ends with this error:
Build failed with exit code 1. Check errors above.
Full log is attached.
restore-log-errors.txt
Expected Behavior
./restore.sh
is expected to run without errors.Steps To Reproduce
./restore.sh
Exceptions (if any)
No response
.NET Version
7.0.100-preview.2.22103.2
Anything else?
dotnet --info
.NET SDK (reflecting any global.json):
Version: 7.0.100-preview.2.22103.2
Commit: 22b9143420
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.1
OS Platform: Darwin
RID: osx.12-arm64
Base Path: /Users/sergey/aspnetcore/.dotnet/sdk/7.0.100-preview.2.22103.2/
Host (useful for support):
Version: 7.0.0-preview.2.22103.2
Commit: 0ae04e5b33
.NET SDKs installed:
7.0.100-preview.2.22103.2 [/Users/sergey/aspnetcore/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.0-preview.2.22102.20 [/Users/sergey/aspnetcore/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.0-preview.2.22102.1 [/Users/sergey/aspnetcore/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.2.22103.2 [/Users/sergey/aspnetcore/.dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
The text was updated successfully, but these errors were encountered: