-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Unable to build: Unable to load Analyzer assembly #77723
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsDescriptionWith the latest HEAD of runtime I'm unable to build on Arm64 Linux. Lots of errors that look like this: Reproduction Steps
Expected behaviorA clean build :) Actual behaviorFull output: log.txt Regression?Used to work. Was working at 17d613e Known WorkaroundsNone :( ConfigurationArm64 Linux Ubuntu 18.04 Other informationNo response
|
I'm seeing the same on X64 too. |
It does. Suspect this is the issue.
I'm on Arm64 Linux, but these are for X86 Windows. |
I am able to repro this on Linux/arm64 machine, but I don't think it is related to x86 windows. I see the same printed for preview5
Even the previous version of the binaries was labeled that way (and I believe it just means that they were compiled on Windows machine) but are x-platform.
The error is saying "Access is denied." and I am not sure why that would be coming.
|
FYI @stephentoub @ViktorHofer @jkoritzinsky looks like we are seeing breaks over updated versions of Roslyn/analyzers. This is odd... since it's an access denied error code I'd expect permission issues or locks, but this is Linux and the access list looks sane (764). I can't repro on x64 and don't have arm64 hardware... |
It's probably not much use, but here's the log of it failing on X86 Linux. It's a dell r540. The test is running inside a clean ubuntu 18.04 docker image. |
@ViktorHofer - did you get a chance to look at this? |
@kunalspathak I wasn't investing this issue since it's affecting the repo tasks that are owned by the Mono infrastructure team. |
@steveisok - any idea? |
Also +@jkoritzinsky |
This isn't impacting just mono tasks. CrossGen2Tasks is also showing the same problem. |
Spoke with @jkoritzinsky and we have a suspicion that it could be because of dotnet/roslyn#64831.
But if I pass @jaredpar - any idea on how to debug this? |
Based on the evidence here that does seem like a good candidate but I'm struggling to see how that could result in an Access Denied error. This didn't change how we load assemblies, just where we load them .... Let me see if I can repro this. |
Surprisingly this doesn't hit in our CI, but I can consistently repro in on Arm64 device. |
As a quick option can someone who can repro do the following:
Share out both log.txt and msbuild.binlog |
Do we have any known issues around ALC and ARM64? The functional change in behavior here is that we are creating, using and disposing more ALC in the same process. Before the change, assuming it's the culprit, we were more likely to drop do this in separate processes. |
Sent you offline. |
Thanks. Looking through that I suspect the cause is not a result of dotnet/roslyn#64831. Or at least that didn't introduce any bugs that result in an access denied error. That change most likely made this build occur in the compiler server vs. the command line compiler. I think that exposed an existing bug in this scenario. The primary difference between using the compiler server and not using it for analyzers / generators is that in the compiler server case we first copy all of the files to a temp directory. The compiler server is a long lived process, we don't want to keep handles to files that could be in the user repository so we copy them first. You can imagine the process as essentially:
The access denied is most likely coming from either the creation of the temp directory or tyring to read the analyzer files. Given we can successfully compile without the server that means we can read the analyzers. So I suspect there is an issue in ARM64 with creating the temp directory. That isn't really something the compilerc can fix though. |
You mean
That is odd because it is a common scenario that would have surfaced if it was problem on Arm64 device. May be the circumstances under which we create the temp directory is problematic. Is there a code base that you can point at which does the creation of temp directory? Is there a simpler repro that I can debug locally to confirm if creation of temp directory indeed is problematic?
Is there a way to print the temp directory path on console? |
I was stracing the build:
The error message is coming from a socket (recvFrom). I'm assuming this is the client getting it from the build server. Full log file: out.txt |
Correct
That doesn't line up with the logs that @kunalspathak sent me though. There the client / server shows that the sockets are completing successfully. If the socket fails the build will assume the server panic'd and it will silently fall back to the command line. That would also be visible in the logs.
The server stays alive between builds so it's possible when you did the strace the build hooked into an existning server vs. created one during build. If you want to be sure that the server starts during the build kill all dotnet processes before starting the bulid. You can also just start the server manually and the build will connect to it |
Got it! From the server:
Looking at those files...
Deleted that, and the build now works for me.
Looks like both /tmp/VBCSCompiler and /tmp/VBCSCompiler/AnalyzerAssemblyLoader need write access by everyone. |
This issue will only occur when there are multiple usernames running builds on the same machine without using docker and without clearing out /tmp/ between builds. Suspect this is the roughly the location of the issue: Something just needs to ensure that any tmp directories that get created are set to be writable by anyone. |
Alternatively, if these files are unique per user, the build server could use /run/user/$uid/AnalyzerAssemblyLoader instead of /tmp |
That shouldn't be done though as it would allow developers to interfere with each others builds. I think rather we need to have a directory specific to each user. |
Closing this since it's not a dotnet/runtime issue. If you hit this deleting |
Description
With the latest HEAD of runtime I'm unable to build on Arm64 and X64 Linux.
Lots of errors that look like this:
CSC : error CS8034: Unable to load Analyzer assembly /home/alahay01/.nuget/packages/microsoft.codeanalysis.csharp.codestyle/4.4.0-2.22423.18/analyzers/dotnet/cs/Microsoft.CodeAnalysis.CSharp.CodeStyle.dll : Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp.CodeStyle, Version=4.4.6.42318, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Access is denied. [/home/alahay01/dotnet/runtime_csel_else/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
Reproduction Steps
Expected behavior
A clean build :)
Actual behavior
Full output: log.txt
Regression?
Used to work. Was working at 17d613e
Known Workarounds
None :(
Configuration
Arm64 Linux Ubuntu 18.04
Other information
No response
The text was updated successfully, but these errors were encountered: