- Notifications
You must be signed in to change notification settings - Fork 0
Add Windows bindings generation support#1
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2b453bb6c9354897c2842f8f161cd38dbe4b26be528c1c1123bcb1c8File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -17,12 +17,55 @@ on: | ||||||
| required: true | ||||||
| jobs: | ||||||
| build: | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
| packages: write | ||||||
| strategy: | ||||||
| matrix: | ||||||
| os: [ubuntu-latest, windows-latest] | ||||||
| include: | ||||||
| - os: ubuntu-latest | ||||||
| jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz | ||||||
| jextract_archive: jdk.tar.gz | ||||||
| os_name: linux | ||||||
| gradle_cmd: ./gradlew | ||||||
| - os: windows-latest | ||||||
| jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_windows-x64_bin.tar.gz | ||||||
| jextract_archive: jdk.tar.gz | ||||||
| os_name: windows | ||||||
| gradle_cmd: .\gradlew.bat | ||||||
| runs-on: ${{ matrix.os }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - run: wget -O $RUNNER_TEMP/jdk.tar.gz https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz | ||||||
| - run: tar -xf $RUNNER_TEMP/jdk.tar.gz | ||||||
| - run: echo "JEXTRACT_HOME=$(pwd)/jextract-25" >> $GITHUB_ENV | ||||||
| - name: Download jextract (Linux) | ||||||
| if: matrix.os == 'ubuntu-latest' | ||||||
| run: wget -O $RUNNER_TEMP/${{ matrix.jextract_archive }} ${{ matrix.jextract_url }} | ||||||
| - name: Download jextract (Windows) | ||||||
| if: matrix.os == 'windows-latest' | ||||||
| run: | | ||||||
| Invoke-WebRequest -Uri "${{ matrix.jextract_url }}" -OutFile "$env:RUNNER_TEMP\${{ matrix.jextract_archive }}" | ||||||
| shell: pwsh | ||||||
| - name: Extract jextract (Linux) | ||||||
| if: matrix.os == 'ubuntu-latest' | ||||||
| run: tar -xf $RUNNER_TEMP/${{ matrix.jextract_archive }} | ||||||
| - name: Extract jextract (Windows) | ||||||
| if: matrix.os == 'windows-latest' | ||||||
| run: tar -xf $env:RUNNER_TEMP\${{ matrix.jextract_archive }} | ||||||
| shell: pwsh | ||||||
| - name: Set JEXTRACT_HOME (Linux) | ||||||
| if: matrix.os == 'ubuntu-latest' | ||||||
| run: echo "JEXTRACT_HOME=$(pwd)/jextract-25" >> $GITHUB_ENV | ||||||
| - name: Set JEXTRACT_HOME (Windows) | ||||||
| if: matrix.os == 'windows-latest' | ||||||
| run: echo "JEXTRACT_HOME=$((Get-Location).Path)\jextract-25" >> $env:GITHUB_ENV | ||||||
| shell: pwsh | ||||||
| - uses: actions/setup-java@v4 | ||||||
| id: install-jdk | ||||||
| with: | ||||||
| @@ -35,25 +78,25 @@ jobs: | ||||||
| gradle-version: wrapper | ||||||
| - name: Download natives | ||||||
| run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :natives:download | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" :natives:download | ||||||
| - name: Extract natives | ||||||
| run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :natives:unzip | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" :natives:unzip | ||||||
| - name: Copy headers | ||||||
| run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} ':natives:copyWgpuHeaders' | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" ':natives:copyWgpuHeaders' | ||||||
| - name: Generate bindings | ||||||
| run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }}-Pjextract.home=${{ env.JEXTRACT_HOME }} :lib:bindings | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pjextract.home=${{ env.JEXTRACT_HOME }}" :lib:bindings | ||||||
| - name: Publish bindings as artifact | ||||||
| uses: actions/upload-artifact@v4 | ||||||
| with: | ||||||
| name: webgpu-bindings | ||||||
| name: webgpu-bindings-${{ matrix.os_name }} | ||||||
| path: lib/build/webgpu.jar | ||||||
| - name: Publish bindings to GH packages | ||||||
| run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :lib:publish | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" :lib:publish | ||||||
CopilotAI | ||||||
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" :lib:publish | |
| run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" :lib:publish |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -12,19 +12,24 @@ def wgpuVersion = project.findProperty('wgpuVersion') | ||||||||
| def os = project.hasProperty('os') ? project.findProperty('os') : 'linux' | ||||||||
| def arch = project.hasProperty('arch') ? project.findProperty('arch') : 'x86_64' | ||||||||
| def type = project.hasProperty('type') ? project.findProperty('type') : 'debug' | ||||||||
| def toolchain = project.hasProperty('toolchain') ? project.findProperty('toolchain') : (os == 'windows' ? 'msvc' : null) | ||||||||
CopilotAI | ||||||||
| deftoolchain= project.hasProperty('toolchain') ? project.findProperty('toolchain') : (os =='windows'?'msvc':null) | |
| deftoolchainProperty= project.findProperty('toolchain') | |
| def toolchain = (toolchainProperty !=null) ? toolchainProperty : (os =='windows'?'msvc':null) |
CopilotAIJan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
-Posparameter is passed without a corresponding-Ptoolchainparameter for Windows builds. While the Gradle file defaults to 'msvc' when OS is Windows, it would be more explicit and maintainable to pass-Ptoolchain=msvcfor Windows builds in the matrix configuration to ensure the correct toolchain is always used.