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

An error ocurred while installing powershell-core 7.3.1 #1

Open
johnjelinek opened this issue Jan 21, 2023 · 3 comments
Open

An error ocurred while installing powershell-core 7.3.1 #1

johnjelinek opened this issue Jan 21, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@johnjelinek
Copy link

johnjelinek commented Jan 21, 2023

When I try to install latest on an m1 mac running Ventura 13.1, it fails to install.

asdf install powershell-core latest

* Downloading powershell-core release 7.3.1...
chmod: /Users/jojeli/.asdf/installs/powershell-core/7.3.1/pwsh: No such file or directory
asdf-powershell-core: Expected /Users/jojeli/.asdf/installs/powershell-core/7.3.1/pwsh to be executable.
asdf-powershell-core: An error ocurred while installing powershell-core 7.3.1.

I tracked it down to the extract process:

tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"

if you drop --strip-components=1 then, it is able to install.

asdf install powershell-core latest
mkdir: /Users/jojeli/.asdf/downloads/powershell-core/7.3.1: File exists
* Downloading powershell-core release 7.3.1...
powershell-core 7.3.1 installation was successful!

Now, when I run pwsh, macos pops up with a lot of messages to allow *.dylib files. After I allow all those, now I get this error:

pwsh

Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies cannot be loaded for execution. (0x80131058)
File name: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
[1]    31603 abort      pwsh

file $(asdf where powershell-core)/pwsh

~/.asdf/installs/powershell-core/7.3.1/pwsh: Mach-O 64-bit executable arm64
@johnjelinek johnjelinek added the bug Something isn't working label Jan 21, 2023
@johnjelinek
Copy link
Author

johnjelinek commented Jan 21, 2023

I ended up fixing this after the "installation was successful" by replacing the entire 7.3.1 directory:

rm -rf $(asdf where powershell-core)
mkdir -p $(asdf where powershell-core)
tar -xzf ~/Downloads/powershell-7.3.1-osx-arm64.tar.gz -C $(asdf where powershell-core)
chmod +x $(asdf where powershell-core)/pwsh

I still had to hit Allow Anyway for each of the dylib files, but after that, pwsh came up.

@daveneeley
Copy link
Owner

I noticed that earlier this week on WSL and it seems like something changed in the artifact paths inside the github release. Thanks for the report. I'll update when it's fixed.

@daveneeley
Copy link
Owner

daveneeley commented Mar 6, 2023

This should be resolved now. Update your plugin to the latest with asdf plugin update powershell-core then run a new plugin install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants