PowerShell / PowerShell/PowerShell

install.sh downloads binary for wrong architecture

Open
#19,804 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Prerequisites
Steps to reproduce

Take the following Dockerfile

FROM openSUSE/tumbleweed

RUN zipper --non-interactive install curl libicu htop vim && \
    zipper clean --all

RUN bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)

and build it with:

docker buildx build --platform linux/arm64 --tag latest --load .
Expected behavior
A docker image with installed PowerShell for linux/arm64.
Actual behavior
The build fails because the install.sh script downloads PowerShell for amd64 instead of arm64.
Error details
#0 15.61 Destination file: powershell-7.3.4-linux-x64.tar.gz
#0 15.61 Source URL: https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/powershell-7.3.4-linux-x64.tar.gz
#0 15.61   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#0 15.62                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 68.3M  100 68.3M    0     0  7620k      0  0:00:09  0:00:09 --:--:-- 9630k
#0 24.80 Installing PowerShell to /opt/microsoft/powershell/7.3.4 in overwrite mode
#0 26.80 qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
#0 26.80 ERROR: PowerShell failed to install!
Environment data
#0 0.361 Operating System Details:
#0 0.361   OS: linux
#0 0.361   DIST: 
#0 0.361   DistroBasedOn: suse
#0 0.361   PSUEDONAME: 
#0 0.361   REV: 20230604
#0 0.361   KERNEL: 5.15.49-linuxkit
#0 0.361   MACH: aarch64
#0 0.361   OSSTR:
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tools/install-powershell.sh, then reproduce the issue using the supplied Dockerfile and docker buildx command for linux/arm64. Check how the script determines the architecture and downloads the release archive. Done means an arm64 image installs the arm64 PowerShell binary instead of the x64 archive.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, docker, dockerfile, powershell
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.