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

Unexpected change in image ubuntu-22.04 20240126.1.0 breaking CI #9259

Closed
2 of 13 tasks
Arlodotexe opened this issue Jan 30, 2024 · 5 comments
Closed
2 of 13 tasks

Unexpected change in image ubuntu-22.04 20240126.1.0 breaking CI #9259

Arlodotexe opened this issue Jan 30, 2024 · 5 comments
Assignees
Labels
Area: Scripting and command line bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Ubuntu

Comments

@Arlodotexe
Copy link

Description

The runner image in our CI is being updated to 20240126.1.0, and has introduced an unexpected change in behavior from the previous version 20240122.3.0.

Quotes are being included and escaped where they weren't before, with no changes except for the runner image being updated.

image

The code which generates the command being run is found here, and does not behave consistently between these two runner images.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

image

Failing under runner image 20240126.1.0: https://github.com/CommunityToolkit/Windows/actions/runs/7716374360/job/21033016594

No failure under runner image 20240122.3.0: https://github.com/CommunityToolkit/Windows/actions/runs/7716461243/job/21033317974?pr=328

Is it regression?

Yes

Expected behavior

Consistent behavior between runner images

Actual behavior

With the new runner images, quotes are being included and escaped where they weren't before.

Repro steps

Should be reproducible by invoking a PowerShell command built similar to this:

$cmd = 'dotnet'
$arguments = @(
    $sdkoptions
    'tool'
    'run'
    'slngen'
    '-o'
    $generatedSolutionFilePath
    $slngenConfig
    $diagnostics
    '--platform'
    $platforms
    $projects
)

Write-Output "Running Command: $cmd $arguments"

&$cmd @arguments
@erik-bershel erik-bershel added Area: Scripting and command line OS: Ubuntu investigate Collect additional information, like space on disk, other tool incompatibilities etc. and removed needs triage labels Jan 30, 2024
@erik-bershel
Copy link
Contributor

Hello @Arlodotexe!
It seems as a result of upgrade to PowerShell 7.4 which happening right now. Check here: #9115
Unfortunately, sometimes existing code stops executing after updating the language environment. On the other hand, this could still be a bug in the image if this code runs in a local environment with the same version of PowerShell. Thus, we first need to ensure that the issue is indeed related to this update. You can check/report the PowerShell repository for issue and try running the code locally, then return to us with the results.

@erik-bershel erik-bershel self-assigned this Jan 30, 2024
@areifert
Copy link

My organization is also seeing this failure behavior in Azure DevOps, specifically on jobs using the ubuntu-latest image. We have variables that include \", which resolved to " on previous images; this is no longer occurring.

Notably, other jobs use the same variable but run using the windows-latest image (which also has Powershell 7.4), and these jobs are working the same as before. This issue seems to only affect jobs using ubuntu-latest.

Adding a step to manually downgrade to Powershell 7.2.x (using the steps in #9115) on jobs using ubuntu-latest allows us to proceed.

@Arlodotexe
Copy link
Author

@erik-bershel Looks like your hunch was correct. I was able to reproduce the issue locally on Windows (7.4.0) and a similar issue on Linux (7.4.1).

Since Windows still ships inbox with PowerShell 5.1, we need to maintain compatibility across both and have opted to just remove the quotes which are being escaped in newer versions of PowerShell.

We'll pass this on to the PowerShell team. Since there's nothing for the runner team to do here, I'll close this for now. Thanks!

@erik-bershel
Copy link
Contributor

As a WA for @areifert and @Arlodotexe cases also could be used PS7.4 with the "PSWindowsNativeCommandArgPassing = Legacy" option enabled. See doc here:https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.4

@areifert
Copy link

As a WA for @areifert and @Arlodotexe cases also could be used PS7.4 with the "PSWindowsNativeCommandArgPassing = Legacy" option enabled. See doc here:https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.4

This is a much better workaround than manually downgrading Powershell, thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Scripting and command line bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Ubuntu
Projects
None yet
Development

No branches or pull requests

3 participants