Skip to content

Commit 9cb7b42

Browse files
committed
tentative
1 parent e7d9258 commit 9cb7b42

3 files changed

Lines changed: 89 additions & 21 deletions

File tree

‎eng/pack/scripts/rc_mac_arm64_deps.sh‎

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,61 @@
1-
#!/bin/bash
2-
3-
python -m venv .env
1+
#!/usr/bin/env bash
2+
# Step 1: Create venv
3+
python${PYTHON_VERSION} -m venv .env
44
source .env/bin/activate
5-
python -m pip install --upgrade pip
5+
python -m pip install "setuptools<68" wheel
66

7-
cd workers
7+
# Step 2: Install Bazel
8+
# Try system package manager first, otherwise fallback to binary download
9+
echo "=== Install Bazel ==="
10+
if command -v apt-get &>/dev/null; then
11+
sudo apt-get update
12+
sudo apt-get install -y bazel
13+
elif command -v brew &>/dev/null; then
14+
brew install bazelisk # macOS: bazelisk auto-tracks correct Bazel version
15+
else
16+
BAZEL_VERSION=6.5.0
17+
curl -LO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64"
18+
chmod +x "bazel-${BAZEL_VERSION}-linux-x86_64"
19+
sudo mv "bazel-${BAZEL_VERSION}-linux-x86_64" /usr/local/bin/bazel
20+
fi
21+
22+
bazel --version
23+
24+
echo "=== Checking Python version being used ==="
25+
python --version
26+
pip --version
27+
28+
echo "=== Cloning grpc repo ==="
29+
if [ ! -d "grpc" ]; then
30+
git clone --recursive https://github.com/grpc/grpc
31+
else
32+
( cd grpc && git fetch origin && git submodule update --init --recursive )
33+
fi
834

9-
# Build and install grpcio from source
10-
git clone --recursive https://github.com/grpc/grpc
1135
cd grpc
12-
python tools/distrib/python/make_grpcio_tools.py
13-
python tools/distrib/python/make_grpcio_wheel.py
14-
pip install artifacts/grpcio-*.whl
1536

37+
echo "=== Building grpcio wheel with setup.py ==="
38+
python setup.py bdist_wheel -d dist
39+
40+
echo "=== Checking built wheels ==="
41+
ls -la dist
42+
43+
echo "=== Installing grpcio wheel into venv ==="
44+
for whl in dist/grpcio-*.whl; do
45+
if [ -f "$whl" ]; then
46+
echo "Installing wheel: $whl"
47+
pip install "$whl"
48+
else
49+
echo "❌ No grpcio wheel found in dist/"
50+
exit 1
51+
fi
52+
done
1653

54+
cd ..
55+
echo "=== Installing your workers package ==="
56+
cd workers
1757
python -m pip install .
58+
1859
python -m pip install . --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
1960

2061
python -m pip install invoke

‎eng/pack/scripts/rc_win_deps.ps1‎

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
param (
22
[string]$pythonVersion
33
)
4-
$versionParts = $pythonVersion -split '\.' # Splitting by dot
5-
$versionMinor = [int]$versionParts[1]
64

5+
# Create venv
76
python -m venv .env
8-
.env\Scripts\Activate.ps1
9-
python -m pip install --upgrade pip
7+
. .env\Scripts\Activate.ps1
8+
python -m pip install "setuptools<68" wheel
109

11-
cd workers
10+
# Install Bazel
11+
choco install bazel --version=6.5.0 -y
12+
refreshenv
13+
bazel --version
14+
15+
Write-Host "=== Checking Python version being used ==="
16+
.\.env\Scripts\python.exe --version
17+
.\.env\Scripts\pip.exe --version
18+
19+
Write-Host "=== Cloning gRPC repo ==="
20+
if (-not (Test-Path "grpc")) {
21+
git clone --recursive https://github.com/grpc/grpc
22+
} else {
23+
cd grpc
24+
Write-Host "Repo already exists. Updating submodules..."
25+
git submodule update --init --recursive
26+
cd ..
27+
}
1228

13-
# Build and install grpcio from source
14-
git clone --recursive https://github.com/grpc/grpc
1529
cd grpc
16-
python tools\distrib\python\make_grpcio_tools.py
17-
python tools\distrib\python\make_grpcio_wheel.py
18-
pip install artifacts/grpcio-*.whl
1930

31+
Write-Host "=== Building grpcio wheel with setup.py ==="
32+
..\.\.env\Scripts\python.exe setup.py bdist_wheel -d dist
33+
34+
Write-Host "=== Checking built wheels ==="
35+
Get-ChildItem dist
36+
37+
Write-Host "=== Installing grpcio wheel into venv ==="
38+
Get-ChildItem -Path "dist" -Filter "grpcio-*.whl" | ForEach-Object {
39+
Write-Host "Installing wheel: $($_.FullName)"
40+
..\.\.env\Scripts\pip.exe install $_.FullName
41+
}
42+
43+
cd ..
44+
45+
# Go back to your project root and install your workers package
46+
Set-Location workers
2047
python -m pip install .
2148

2249
$depsPath = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath "deps"

‎eng/pack/templates/macos_64_env_gen.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ steps:
4848
args: '${{ parameters.pythonVersion }}'
4949
displayName: 'Build and install dependencies'
5050
condition: ne(variables['minorVersion'], '14')
51-
- task: PowerShell@2
51+
- task: ShellScript@2
5252
inputs:
5353
filePath: 'eng/pack/scripts/rc_mac_arm64_deps.sh'
5454
arguments: '${{ parameters.pythonVersion }}'

0 commit comments

Comments
 (0)