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

NuGet package missing macOS executable #24663

Open
5 tasks done
JunielKatarn opened this issue Dec 12, 2024 · 4 comments
Open
5 tasks done

NuGet package missing macOS executable #24663

JunielKatarn opened this issue Dec 12, 2024 · 4 comments
Labels
Area-Maintainers-Build specific to affecting the build Needs-Triage The issue is new and needs to be triaged by a work group.

Comments

@JunielKatarn
Copy link

JunielKatarn commented Dec 12, 2024

Prerequisites

Steps to reproduce

  1. Download or install the NuGet package.
    https://www.nuget.org/packages/PowerShell/7.4.6
  2. Extract the NuGet package.
  3. Try to run the PowerShell executable.
    ./tools/net8.0/any/unix/pwsh -Version
    

Expected behavior

Version string is printed in the terminal.

PowerShell 7.4.6

Actual behavior

The following error is displayed:

tools/net8.0/any/unix/pwsh: cannot execute binary file

Error details

(See *Actual behavior*)

Additional context:

$ file tools/net8.0/any/unix/pwsh
tools/net8.0/any/unix/pwsh: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=b5bea1cae27286f26751c5bee267f37810104be4, stripped

The only non-windows pwsh executable is linux-only.
The "Mach-O" executable is missing in the NuGet package.

Environment data

None for `$PSVersionTable`. Trying to start PowerShell as distributed by the NuGet package.

macOS 15.1.1
ARM64 and x64

Visuals

No response

@JunielKatarn JunielKatarn added the Needs-Triage The issue is new and needs to be triaged by a work group. label Dec 12, 2024
@mklement0
Copy link
Contributor

mklement0 commented Dec 12, 2024

Said package is meant to be installed with dotnet tool install [-g], i.e. as a .NET tool.

Invoked as such - by name only via $env:PATH rather than by full, package-internal path (which should be considered an implementation detail) - it does have a macOS-appropriate CLI entry point.

However, there is a problematic aspect, after all:

@JunielKatarn
Copy link
Author

Said package is meant to be installed with dotnet tool install [-g], i.e. as a .NET tool.

Invoked as such - by name only via $env:PATH rather than by full, package-internal path (which should be considered an implementation detail) - it does have a macOS-appropriate CLI entry point.

However, there is a problematic aspect, after all:

Thanks for the explanation about the intended usage and installation.

However, as #12205 shows and as mentioned in the error details, there is no macOS executable in the NuGet whatsoever. The "unix" executable is on the ELF (Executable Linux File) format.

@mklement0
Copy link
Contributor

When you install PowerShell as a .NET tool globally, a macOS executable is placed in $HOME/.dotnet/tools, which serves as the entry point.

You can verify this with file $HOME/.dotnet/tools/pwsh

#12205 is about the value of $PSHOME pointing to a directory whose pwsh file is indeed a x86-64 Linux one, but this is only a problem if you invoke it directly. #24090 has more details. The - arguably problematic - fix via PR #24228 will be to make $PSHOME point to $HOME/.dotnet/tools

@rhubarb-geek-nz
Copy link

My understanding is that when run as a dotnet tool is uses the pwsh.dll rather than pwsh. Where this fails is when you try and run pwsh from the PATH with a script run by the powershell tool.

What is more important is that the libSystem.IO.Ports.Native.dylib, libSystem.IO.Ports.Native.so, libpsl-native.dylib and libpsl-native.so exist under the correct runtimes tree.

So pwsh.dll is not CPU specific but the lib*.so and lib*.dylib are.

@SeeminglyScience SeeminglyScience added the Area-Maintainers-Build specific to affecting the build label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Maintainers-Build specific to affecting the build Needs-Triage The issue is new and needs to be triaged by a work group.
Projects
None yet
Development

No branches or pull requests

4 participants