-
Notifications
You must be signed in to change notification settings - Fork 581
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
dotnet publish / run for linux-arm fails with NetCore5 targets in preview 5+ #1099
Comments
Thanks for logging this @pgrawehr, this is very likely because the .Net 5 TFM changed on the new SDK and won’t be netcoreapp5.0 anymore, can you try using |
@joperezr : Nope, exactly the same result. |
When using |
Oh I see the other issue, you don’t have the dotnet 5 nuget feed since we don’t really depend on it yet and preview 5 builds haven’t been published to nuget.org, which explains why preview 4 works fine (that has published already) For dotnet 5, add the feed: |
Win-x64 works most likely because that runtime comes with the sdk itself as that matches the sdk you installed, but it doesn’t come with the ones for other RIds like linux-arm |
Nope, still same. Output of
|
@joperezr : The problem just got worse when trying to update to preview 6. I can't run any application built for
Steps to reproduce are as above, except now with SDK version "5.0.100-preview.6.20310.4". The version installed on the Pi is https://download.visualstudio.microsoft.com/download/pr/fc54f62e-c7bd-43a3-a27b-4afb08bc4d6f/b01ccacf3d94efc0bbe26f64f7fde9b7/dotnet-sdk-5.0.100-preview.6.20318.15-linux-arm.tar.gz I've tryied both global and local installations of the SDK, no improvement. This is serious, because it basically means Net5 is not usable on the Pi, and I have to revert to 3.1 for my application, which shows other issues. |
Note: It works again after downgrading to 5.0-preview.4. This does not look good at all... |
I did some further (actually very basic) test, but no luck:
(this uses the globaly installed preview 4) -> Starts the app and works fine
Result is
Unfortunatelly, I have no clue on how to debug this further, since the problem is very unlikely to be within the app itself. The |
The |
Ok, that gets one step further. Had to do a bit of trickery:
to get the source lookup to work (gdb wouldn't allow selecting an alternate location to the source path given in the debug information, it seems). |
@sdmaclea Can't get much further, after trying for hours :-( I can't step into Any further advice on how to debug this problem would be greatly appreciated. In the end, it's probably something stupid like an unexpected value of an environment variable or so. But I'm meanwhile quite sure that it is something that will show up for others as well, once 5.0 ships. |
If I were debugging this given a working and non-working version, I would look at I am on vacation today, but I can look tomorrow. I think we have a few Pi 3's running Raspberry PI, one probably is running linux-arm. /cc @dotnet/dotnet-diag |
Can't see any obvious problem yet, but I'll have another look later. I've attached the two trace files: preview4.txt runs my app against preview 4 (works fine - I've aborted the program right after it starts) and preview8.txt contains the exactly same binary run against preview 8 (which fails to start). Note that it is not a forward-compatibility problem. If I rebuild the app against preview 8, this doesn't change anything (except of course, that I can't run it against preview 4, which is expected). |
@sdmaclea After a lot of playing around and looong builds, I was finally able to build a debug version of the CLR ( I'll eventually post a PR for improving the documentation). That now showed that the problem is the removal of the winmd support, which is used here. There's a ticket to update that #1103 , but I don't exactly understand what that means yet. Two questions in this context:
Cc: @joperezr |
@pgrawehr Thanks for digging to root cause on this. This sounds like the current design issue with the loading rules for the app model. My recollection is that all assemblies mentioned in the manifest must be present to start the app. With these winmd files being removed, perhaps there could be an exception (especially since these cannot be used on linux...) /cc @vitek-karas |
Host (dotnet.exe, hostfxr, hostpolicy, dealing with .deps.json, finding all assemblies):
Runtime (coreclr.dll, the source of this error):
SDK (how the app gets built):
|
Yes, the runtime fails to load winmd files now, which is expected, although the experience can be improved: dotnet/sdk#12087. The SDK has a target to block referencing WinMD files, but there might be some holes: dotnet/sdk#13233 (there's a number of discussions going on offline on how to best handle this) |
@jkoritzinsky I wonder if this is more problematic than we expect. I would expect 3.1 apps should just run w/o recompilation on 5.0 if it is the only runtime installed. Sounds like that is no longer true for a class of apps. How big a class of apps is this? |
Any apps that reference WinMD files (transitive included) won't run on 5.0. There's not a lot of them, and most every usage that I know of (including dotnet/iot) has a plan to move off them for 5.0. |
Also 3.1 app built with default settings won't run on 5.0 - roll forward won't allow that. The developer has to explicitly opt into major version roll forward (or rebuild the app as 5.0). |
The primary error happens in |
@joperezr Can you give me a hint on how these .winmd references need to be replaced? What alternative approach shall be used? |
Sure, I have the changes ready since they are very simple but we are currently blocked on commiting them( check #1091 for more info). Basically the change we need to do is to removed the winmd references from the project as well as the dependency to package System.Runtime.WindowsRuntime, and instead add a package dependency to Microsoft.Windows.SDK.NET. That’s it, that should make it work, except that we can’t make that change yet as there is a bug on that SDK package because it has assemblies that are not strong-named signed, and because our assembly is then we won’t be able to compile. I have pinged the team that manages that package so they are aware we are broken and will work on fixing it so that we are unblocked. |
Forgot to close this one too but it was also fixed by #1217 |
Describe the bug
Running
dotnet publish
for a project with target netcore5 fails with the current runtimeGlobal.json at the time of this writting:
Steps to reproduce
On the desktop (Windows) run:
An error is now reported:
Expected behavior
Build passes
Actual behavior
See above. It looks a bit as if the SDK build that's currently referenced is incomplete. The problem does not happen if going back to the "official" beta version 5.0.100-preview.4.20258.7
Versions used
SDK:
5.0.100-preview.5.20251.2 [C:\Program Files\dotnet\sdk]
Runtime:
Microsoft.NETCore.App 5.0.0-preview.5.20230.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Edit
See below: The problem got even worse with previews 6 and 7. I can't get them to work at all on the Raspi when targetting NetCore 5.0.
The text was updated successfully, but these errors were encountered: