Open Hu1buerger opened 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
This might be related to this previous but similar issue #25767.
as described in #12359 i set DOTNET_ROOT $(dirname $(realpath $(which dotnet)))
with no luck.
This isn't an M1 running x64 code is it? I've seen a number of issues like this one
@joeloff unfortunately not. It's an Intel Mac
This feels like something didn't work correctly in the brew install of .NET. Per the dotnet --info
the install is located in /usr/local/Cellar/dotnet/6.0.104_1/libexec
, but based on the errors it's not registered. So apphost won't be able to find it since it's not on the default path nor is it registered.
I don't have a mac at hand to try this - to verify that brew is not doing the right thing here. @joeloff could you please check on this? I assume we don't own the brew .NET package, right?
A workaround is either:
/etc/dotnet/install_location_x64
(that file should be a text file with just the path to the .NET install in it on the first line)DOTNET_ROOT
environment variable to the path of the .NET install.For those interested, details on how the install location works and what is used to find it are here: https://github.com/dotnet/designs/blob/main/accepted/2021/install-location-per-architecture.md
@vitek-karas afaik brew just runs the default installer see here
I honestly don't know, but something had to install the runtime into /usr/local/Cellar/dotnet/6.0.104_1/libexec
- it's definitely not its default location. Based on internet search the /usr/local/Cellar
is the location into which brew installs software. It then links to it from the usual locations. But depending on how it does that either the brew or the package need to know about this in the case of runtime, since it needs to register that location in the /etc/dotnet/install_location_x64
(in the case of the x64 architecture).
@joeloff @ericstj - do one of you know if we tested runtime/sdk packages with brew?
Not certain, but the installer's postinstall script doesn't hardcode the path. It gets it from the installation engine: https://github.com/dotnet/runtime/blob/cae954add0f01c85de7fef8cc41c2a11d1c920e1/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall#L8
@Hu1buerger could you please grab a host trace of the failure?
export COREHOST_TRACE=1
export COREHOST_TRACEFILE=host.txt
--- run the tool which fails
Then share the host.txt
- please be aware that the file contains local file paths, environment and other pieces of information about the machine and its state. Make sure you're OK sharing this publicly.
@vitek-karas host.txt
FYI: I uninstalled dotnet and installed dotnet manually.
Thanks, the shared host.txt doesn't show anything unusual - normal default .NET install, seems to work.
The Formula mentions this, but you need to set DOTNET_ROOT
properly:
export DOTNET_ROOT="$HOMEBREW_PREFIX/opt/dotnet/libexec"
Here's the hosts.txt output without this for completeness:
Tracing enabled @ Wed Mar 8 00:53:35 2023 UTC
--- Invoked apphost [version: 7.0.0, commit hash: d099f075e45d2aa6007a22b71b45a08758559f80] main = {
authcore
}
The managed DLL bound to this executable is: '.store/authenticatorcore/0.1.0-ci-20230308-004036/authenticatorcore/0.1.0-CI-20230308-004036/tools/net7.0/any/AuthenticatorCore.dll'
Looking for architecture-specific install_location file in '/etc/dotnet/install_location_arm64'.
Found registered install location '/usr/local/share/dotnet'.
Using global installation location [/usr/local/share/dotnet] as runtime location.
The required library libhostfxr.dylib could not be found. Searched with root path [/Users/joeflint/.dotnet/tools/.store/authenticatorcore/0.1.0-ci-20230308-004036/authenticatorcore/0.1.0-ci-20230308-004036/tools/net7.0/any/], environment variable [DOTNET_ROOT], default install location [/usr/local/share/dotnet], self-registered config location [/etc/dotnet/install_location_arm64]
You must install .NET to run this application.
App: /Users/joeflint/.dotnet/tools/authcore
Architecture: arm64
App host version: 7.0.0
.NET location: Not found
Learn about runtime installation:
https://aka.ms/dotnet/app-launch-failed
Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=arm64&rid=osx.13-arm64&apphost_version=7.0.0
Describe the bug
After installing httprepl, running
$httprepl
or$dotnet httprepl
is failing.To Reproduce
Install dotnet via brew and httprepl via
$dotnet tool install -g Microsoft.dotnet-httprepl
. Try running httprepl as described above.Exceptions (if any)
Further technical details