Skip to content

Commit

Permalink
fix build failing because of webrtc-based code (#3)
Browse files Browse the repository at this point in the history
* fixes for webrtc-livekit, refactor with shared build action
  • Loading branch information
pirafrank authored Jan 30, 2025
1 parent 688f27a commit 5c7756f
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 174 deletions.
94 changes: 94 additions & 0 deletions .github/actions/zed-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Zed Build
description: Perform a Zed build for Windows
runs:
using: "composite"
steps:
- name: Check LongPathsEnabled first
shell: pwsh
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Enable long paths in Windows
shell: pwsh
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
git config --global core.longpaths true
- name: Check LongPathsEnabled after
shell: pwsh
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Extract toolchain channel
id: extract_toolchain
working-directory: ${{ github.workspace }}\zed
shell: bash
run: |
TOOLCHAIN_CHANNEL=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f 2)
echo "Toolchain channel: $TOOLCHAIN_CHANNEL"
echo "TOOLCHAIN_CHANNEL=$TOOLCHAIN_CHANNEL" >> $GITHUB_OUTPUT
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.extract_toolchain.outputs.TOOLCHAIN_CHANNEL }}
target: "wasm32-wasip1"
components: "rustfmt, clippy"

- name: Show Rust toolchain info
shell: pwsh
run: |
rustc --version
rustup show
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

- name: Install Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 26100

- name: Build project
working-directory: ${{ github.workspace }}\zed
shell: pwsh
# zed may be set to run the exe after the build, this
# won't work in an headless environment. The build at this
# point is likely to have completed successfully.
continue-on-error: true
env:
RUSTFLAGS: "-C symbol-mangling-version=v0 --cfg tokio_unstable --cfg windows_slim_errors -C target-feature=+crt-static --cfg gles"
run: |
cargo run --release --verbose
- name: Show build artifacts
working-directory: ${{ github.workspace }}/zed
shell: bash
run: |
ls -la target/release
- name: Check build artifacts
working-directory: ${{ github.workspace }}/zed
shell: bash
run: |
if [ ! -f ./target/release/zed.exe ]; then
echo "zed.exe not found. Build likely to have failed."
exit 1
fi
- name: Compress build artifacts
working-directory: ${{ github.workspace }}\zed\target\release
shell: pwsh
run: |
Compress-Archive -Path zed.exe -Destination zed.zip
Compress-Archive -Path zed.pdb -Destination zed.pdb.zip
- name: Calculate SHA256 checksum
working-directory: ${{ github.workspace }}/zed/target/release
shell: bash
run: |
sha256sum zed.exe > zed.exe.sha256
sha256sum zed.zip > zed.zip.sha256
sha256sum zed.pdb.zip > zed.pdb.zip.sha256
97 changes: 7 additions & 90 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,98 +88,15 @@ jobs:
path: own

- name: Checkout Zed
shell: pwsh
run: |
git clone https://github.com/zed-industries/zed.git zed
cd zed
git checkout ${{ needs.checks.outputs.ref }}
- name: Check LongPathsEnabled first
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Enable long paths in Windows and in Git
shell: powershell
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
git config --global core.longpaths true
- name: Check LongPathsEnabled after
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Extract toolchain channel
id: extract_toolchain
working-directory: ./zed
shell: bash
run: |
TOOLCHAIN_CHANNEL=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f 2)
echo "Toolchain channel: $TOOLCHAIN_CHANNEL"
echo "TOOLCHAIN_CHANNEL=$TOOLCHAIN_CHANNEL" >> $GITHUB_OUTPUT
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.extract_toolchain.outputs.TOOLCHAIN_CHANNEL }}
target: "wasm32-wasip1"
components: "rustfmt, clippy"

- name: Show Rust toolchain info
run: |
rustc --version
rustup show
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

- name: Install Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
uses: actions/checkout@v4
with:
sdk-version: 22000

- name: Build project
working-directory: ./zed
shell: pwsh
# zed may be set to run the exe after the build, this
# won't work in an headless environment. The build at this
# point is likely to have completed successfully.
continue-on-error: true
run: |
cargo run --release
repository: zed-industries/zed
ref: ${{ needs.checks.outputs.ref }}
path: zed

- name: Show build artifacts
working-directory: ./zed
shell: bash
run: |
ls -la target/release
- name: Check build artifacts
working-directory: ./zed
shell: bash
run: |
if [ ! -f ./target/release/zed.exe ]; then
echo "zed.exe not found. Build likely to have failed."
exit 1
fi
- name: Compress build artifacts
working-directory: .\zed\target\release
shell: pwsh
run: |
Compress-Archive -Path zed.exe -Destination zed.zip
Compress-Archive -Path zed.pdb -Destination zed.pdb.zip
- name: Calculate SHA256 checksum
id: checksum
working-directory: ./zed/target/release
shell: bash
run: |
sha256sum zed.exe > zed.exe.sha256
sha256sum zed.zip > zed.zip.sha256
sha256sum zed.pdb.zip > zed.pdb.zip.sha256
echo "zed_zip_sha256=$(cat zed.zip.sha256 | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- name: Build Zed
id: zed-build
uses: ./own/.github/actions/zed-build

- name: Extract clean version
id: extract_version
Expand Down
87 changes: 3 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,90 +47,9 @@ jobs:
ref: ${{ needs.checks.outputs.ref }}
path: zed

- name: Check LongPathsEnabled first
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Enable long paths in Windows
shell: powershell
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
git config --global core.longpaths true
- name: Check LongPathsEnabled after
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- name: Extract toolchain channel
id: extract_toolchain
working-directory: ${{ github.workspace }}\zed
shell: bash
run: |
TOOLCHAIN_CHANNEL=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f 2)
echo "Toolchain channel: $TOOLCHAIN_CHANNEL"
echo "TOOLCHAIN_CHANNEL=$TOOLCHAIN_CHANNEL" >> $GITHUB_OUTPUT
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.extract_toolchain.outputs.TOOLCHAIN_CHANNEL }}
target: "wasm32-wasip1"
components: "rustfmt, clippy"

- name: Show Rust toolchain info
run: |
rustc --version
rustup show
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

- name: Install Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22000

- name: Build project
working-directory: ${{ github.workspace }}\zed
shell: pwsh
# zed may be set to run the exe after the build, this
# won't work in an headless environment. The build at this
# point is likely to have completed successfully.
continue-on-error: true
run: |
cargo run --release
- name: Show build artifacts
working-directory: ${{ github.workspace }}/zed
shell: bash
run: |
ls -la target/release
- name: Check build artifacts
working-directory: ${{ github.workspace }}/zed
shell: bash
run: |
if [ ! -f ./target/release/zed.exe ]; then
echo "zed.exe not found. Build likely to have failed."
exit 1
fi
- name: Compress build artifacts
working-directory: ${{ github.workspace }}\zed\target\release
shell: pwsh
run: |
Compress-Archive -Path zed.exe -Destination zed.zip
Compress-Archive -Path zed.pdb -Destination zed.pdb.zip
- name: Calculate SHA256 checksum
working-directory: ${{ github.workspace }}/zed/target/release
shell: bash
run: |
sha256sum zed.exe > zed.exe.sha256
sha256sum zed.zip > zed.zip.sha256
sha256sum zed.pdb.zip > zed.pdb.zip.sha256
- name: Build Zed
id: zed-build
uses: ./own/.github/actions/zed-build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 5c7756f

Please sign in to comment.