Skip to content

Commit 32c3ba9

Browse files
authored
Merge branch 'main' into feature/pre-commit-hook_support_1138
2 parents 393cfcc + a1a0998 commit 32c3ba9

6 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/test-pr-arm64.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ jobs:
3131
strategy:
3232
matrix:
3333
features: ${{ fromJSON(needs.detect-changes.outputs.features) }}
34+
# NOTE: ubuntu:focal and debian:11 are excluded because they ship
35+
# GLIBC 2.31, but PowerShell >= 7.6.0 requires GLIBC 2.33+ on arm64.
36+
# ubuntu:focal reached EOL Apr 2025; debian:11 reaches EOL Aug 2026.
3437
baseImage:
3538
[
36-
"ubuntu:focal",
3739
"ubuntu:jammy",
38-
"debian:11",
3940
"debian:12",
4041
"mcr.microsoft.com/devcontainers/base:ubuntu",
4142
"mcr.microsoft.com/devcontainers/base:debian",

src/powershell/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "powershell",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"name": "PowerShell",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/powershell",
66
"description": "Installs PowerShell along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",

src/powershell/install.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ find_preview_version_from_git_tags() {
126126
local requested_version=${!variable_name}
127127
local repository_url=$2
128128

129-
if [ -z "${googlegit_cmd_name}" ]; then
129+
if [ -z "${git_cmd_name}" ]; then
130130
if type git > /dev/null 2>&1; then
131131
git_cmd_name="git"
132132
else
@@ -135,22 +135,22 @@ find_preview_version_from_git_tags() {
135135
fi
136136
fi
137137

138-
# Fetch tags from remote repository
138+
# Fetch tags from remote repository (match both -preview.X and -rc.X tags)
139139
local tags
140-
tags=$(git ls-remote --tags "${repository_url}" 2>/dev/null | grep -oP 'refs/tags/v\K[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+' | sort -V)
140+
tags=$(git ls-remote --tags "${repository_url}" 2>/dev/null | grep -oP 'refs/tags/v\K[0-9]+\.[0-9]+\.[0-9]+-(preview|rc)\.[0-9]+' | sort -V)
141141

142142
if [ -z "${tags}" ]; then
143-
echo "No preview tags found in repository."
143+
echo "No preview/rc tags found in repository."
144144
return 1
145145
fi
146146

147147
local version=""
148148

149149
if [ "${requested_version}" = "preview" ] || [ "${requested_version}" = "latest" ]; then
150-
# Get the latest preview version
150+
# Get the latest preview/rc version
151151
version=$(echo "${tags}" | tail -n 1)
152152
elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+$ ]]; then
153-
# Partial version provided (e.g., "7.6"), find latest preview matching that major.minor
153+
# Partial version provided (e.g., "7.6"), find latest preview/rc matching that major.minor
154154
version=$(echo "${tags}" | grep "^${requested_version}\." | tail -n 1)
155155
elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-preview$ ]]; then
156156
# Version like "7.6.0-preview" provided, find latest preview for that version
@@ -161,6 +161,11 @@ find_preview_version_from_git_tags() {
161161
if echo "${tags}" | grep -q "^${requested_version}$"; then
162162
version="${requested_version}"
163163
fi
164+
elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then
165+
# Exact RC version provided, verify it exists
166+
if echo "${tags}" | grep -q "^${requested_version}$"; then
167+
version="${requested_version}"
168+
fi
164169
fi
165170

166171
if [ -z "${version}" ]; then
@@ -382,7 +387,7 @@ install_using_github() {
382387
fi
383388
pwsh_url="https://github.com/PowerShell/PowerShell"
384389
# Check if we need to find a preview version or stable version
385-
if [[ "${POWERSHELL_VERSION}" == *"preview"* ]] || [ "${POWERSHELL_VERSION}" = "preview" ]; then
390+
if [[ "${POWERSHELL_VERSION}" == *"preview"* ]] || [ "${POWERSHELL_VERSION}" = "preview" ] || [[ "${POWERSHELL_VERSION}" == *"-rc."* ]]; then
386391
echo "Finding preview version..."
387392
find_preview_version_from_git_tags POWERSHELL_VERSION "${pwsh_url}"
388393
else
@@ -446,9 +451,9 @@ if ! type pwsh >/dev/null 2>&1; then
446451
POWERSHELL_ARCHIVE_ARCHITECTURES="${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}"
447452
fi
448453

449-
if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_UBUNTU}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]]; then
454+
if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_UBUNTU}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]] && [[ "${POWERSHELL_VERSION}" != *"-rc."* ]]; then
450455
install_using_apt || use_github="true"
451-
elif [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]]; then
456+
elif [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]] && [[ "${POWERSHELL_VERSION}" != *"-rc."* ]]; then
452457
install_using_dnf && install_powershell_dnf || use_github="true"
453458
else
454459
use_github="true"

test/powershell/powershell_preview_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source dev-container-features-test-lib
77

88
# Test preview version installation
99
check "pwsh is installed" bash -c "command -v pwsh"
10-
check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'"
10+
check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'"
1111
check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'"
1212

1313
# Report result

test/powershell/powershell_preview_version_almalinux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source dev-container-features-test-lib
77

88
# Test preview version installation on AlmaLinux
99
check "pwsh is installed" bash -c "command -v pwsh"
10-
check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'"
10+
check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'"
1111
check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'"
1212

1313
# Report result

test/powershell/powershell_preview_version_debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source dev-container-features-test-lib
77

88
# Test preview version installation on Debian
99
check "pwsh is installed" bash -c "command -v pwsh"
10-
check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'"
10+
check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'"
1111
check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'"
1212

1313
# Report result

0 commit comments

Comments
 (0)