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

.NET 7 RC1 dotnet build fails without errors on MAC M1 #7840

Open
esskar opened this issue Sep 29, 2022 · 19 comments
Open

.NET 7 RC1 dotnet build fails without errors on MAC M1 #7840

esskar opened this issue Sep 29, 2022 · 19 comments

Comments

@esskar
Copy link

esskar commented Sep 29, 2022

Description

I was switching from .NET 7 Preview 7 to .NET 7 RC1 yesterday. Everything runs ok, but after some builds and runs, dotnet stops building my project.

╰─ dotnet build                                                        ─╯
MSBuild version 17.4.0-preview-22428-01+14c24b2d3 for .NET

Build FAILED.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.00

It's the second time this happens. I need to restart the machine to get it working again.
Deleting obj and/or bin folder does not help.

Configuration

MSBuild version 17.4.0-preview-22428-01+14c24b2d3 for .NET
Tye version 0.11.0-alpha.22111.1+3edef5428949c518c078844d6438e5ba86fce600

.NET SDK:
Version: 7.0.100-rc.1.22431.12
Commit: f1cf61e1c0

Runtime Environment:
OS Name: Mac OS X
OS Version: 12.6
OS Platform: Darwin
RID: osx.12-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.100-rc.1.22431.12/

Host:
Version: 7.0.0-rc.1.22426.10
Architecture: arm64
Commit: 06aceb7015

.NET SDKs installed:
6.0.400 [/usr/local/share/dotnet/sdk]
7.0.100-preview.7.22377.5 [/usr/local/share/dotnet/sdk]
7.0.100-rc.1.22431.12 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-rc.1.22427.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-rc.1.22426.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Information

When this happens, vs code is not finding any references. Everything is signaled as red and unknown in vs code.

@esskar esskar mentioned this issue Sep 29, 2022
@wickedw
Copy link

wickedw commented Oct 1, 2022

This is also happening on 4.2 GHz Quad-Core Intel Core i7 iMAC.

@livehop
Copy link

livehop commented Oct 2, 2022

Can you please let us know how I can remove the .Net 7 version ? the dotnet-core-uninstall does not work and VS preivew automtically installed this version

@GabrielCappelli
Copy link

I'm having the same issue, passing --disable-build-servers to dotnet build seems to get it to build again.

@livehop
Copy link

livehop commented Oct 3, 2022

Thanks! -- for now I just ran :

dotnet new globaljson

and then changd the globaljson of my project to

{
"sdk": {
"version": "6.0.401"
}
}


Good to know you have the option you provided as well!

@jburnett
Copy link

jburnett commented Oct 4, 2022

We're experiencing w/Intel CPUs like @wickedw. May be helpful to correct the title.

Is there an env var for disabling build servers? Would be helpful for cross compile.

@michaelgsharp
Copy link
Member

@rainersigwald is this related to msbuild?

@rainersigwald
Copy link
Member

Very plausibly. dotnet/sdk#28369 disables MSBuild Server for GA. Please try setting the environment variable DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1--if that resolves the issue the GA change will also take care of it.

cc @rokonec

@agocke
Copy link
Member

agocke commented Oct 11, 2022

Reproed consistently for me in Ubuntu. After setting the env variable and building once, it seems like things are working again, even after unsetting the environment variable. This might involve some sort of state corruption.

@rokonec
Copy link
Member

rokonec commented Oct 11, 2022

@agocke Can you please share with me repro steps?
I would like to verify that it is known bug to us.

@agocke
Copy link
Member

agocke commented Oct 11, 2022

I downloaded the rc-1 tar.gz, extracted it to a local directory (over my preview 5 copy), then simply went to a directory and did dotnet build. Every invocation of MSBuild failed in the same way. I tried deleting a bunch of files -- I even wiped the files I extracted and re-extracted them. That didn't help.

Interestingly enough, if I extracted the files to a different directory, and tried again, that worked.

After I found this thread, I then set the environment variable and rebuilt and the problem went away immediately. I then removed the environment variable and tried building again. That also worked.

There must be some sort of cached information that causes this issue.

@mairaw
Copy link
Contributor

mairaw commented Oct 12, 2022

And just to confirm, did you download the Arm64 version since you mentioned you're on Mac M1?

@sep2
Copy link

sep2 commented Oct 12, 2022

I use the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 and it works, then I removed the env it failed again. The env is mandatory for a successful build. I'm on archlinux x64.

@rainersigwald
Copy link
Member

@sep2 Great. That workaround will no longer be required with the final 7.0.100 SDK (but is still needed for RC2). Sorry for the inconvenience!

@agocke
Copy link
Member

agocke commented Oct 12, 2022

Yup I downloaded arm64

@devmobasa
Copy link

Just an FYI— I've been working with .NET Core since its 1.0 days and haven't encountered this issue until now. However, with .NET 8 RC2, the problem surfaced for the first time. Fortunately, setting the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER environment variable did the trick and resolved the issue.

@rainersigwald
Copy link
Member

@rokonec is @ibro's experience expected? I thought server was off by default still.

@devmobasa
Copy link

devmobasa commented Nov 9, 2023

I'm uncertain whether the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER environment variable is still relevant to my issue. It seemed to resolve the issue temporarily, but the fix has been hit-or-miss lately.

@rokonec
Copy link
Member

rokonec commented Nov 9, 2023

@ibro This is highly unexpected, env var DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER has been deprecated in net8 see https://github.com/dotnet/sdk/blob/62aa4b7c6c2f6fcf673ec2d9aacc8ca07f51913b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs#L19 and is no longer in our codebase at all.
Please verify that given build is configured for net8 rc2 and if so please provide us with aka.ms/binlog
I have tested it on net8 rc2 Windows and msbuild server is still off by default - as designed.

@devmobasa
Copy link

Seems to be fine with .NET 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests