PowerShell / PowerShell/PowerShell

Pwsh still corrupts environment variable on Linux Arm 64

Aperta
#24,693 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs-Triage WG-Engine WG-NeedsReview
Lingua principale
C#
Stelle
55.5k
Fork
8.5k
Merge medio
1g 2h
PR unite (30g)
88

Descrizione

Prerequisites
Steps to reproduce

use the following docker file building on a Linux Arm machine (I'm using AWS Graviton EC2)

FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble-${TARGETARCH}${TARGETVARIANT}
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILDVARIANT
ARG ARM64ORX64
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
&& printf ", TARGETVARIANT=${TARGETVARIANT}" \
&& printf ", TARGETARCH=${TARGETARCH}" \
&& printf ", BUILDVARIANT=${BUILDVARIANT} \n" \
&& printf ", ARM64ORX64=${ARM64ORX64} \n" \
    && printf "With uname -s : " && uname -s \
    && printf "and  uname -m : " && uname -m

RUN pwsh
RUN pwsh --version
RUN which pwsh
RUN echo $PATH
RUN ls -l /usr/bin/pwsh
RUN pwsh -Command 'Write-Host ${env:PSHOME}'
RUN pwsh -Command 'Write-Host ${env:PATH}'
RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA'

and the following Exec format error is output

 > [10/10] RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA':

[2024-12-18T13:30:25.569Z] 1.392 ResourceUnavailable: Program 'pwsh' failed to run: An error occurred trying to start process '/usr/share/powershell/.store/powershell.linux.arm64/7.5.0-preview.5/powershell.linux.arm64/7.5.0-preview.5/tools/net9.0/any/pwsh' with working directory '/'. Exec format errorAt line:1 char:1

Full docker output : dockerlog.txt

this was originally raised via Issue https://github.com/PowerShell/PowerShell/issues/24090 and I thought this was resolved in PR https://github.com/PowerShell/PowerShell/pull/24228

Expected behavior
[2024-12-18T13:27:43.017Z] #13 [10/10] RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA'


should output "hello"
Actual behavior
[2024-12-18T13:30:25.569Z] #13 1.392 ResourceUnavailable: Program 'pwsh' failed to run: An error occurred trying to start process '/usr/share/powershell/.store/powershell.linux.arm64/7.5.0-preview.5/powershell.linux.arm64/7.5.0-preview.5/tools/net9.0/any/pwsh' with working directory '/'. Exec format errorAt line:1 char:1
Error details

No response

Environment data
RUN pwsh $PSVersionTable

[2024-12-19T10:04:36.769Z] #11 0.636 PowerShell 7.5.0-preview.5
Visuals

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione tramite Dockerfile su un host Linux ARM64 e con l’entry point pwsh -Command 'pwsh -EncodedCommand ...'. Confronta il comportamento segnalato di PowerShell 7.5.0-preview.5 con l’issue #24090 e la PR #24228. Il lavoro è completato quando il comando viene eseguito correttamente nell’immagine ARM64 e restituisce hello invece di un Exec format error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, shell
Ambito
cli, operating-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.