Skip to content

Commit 2fa8179

Browse files
committed
fix windows CI
1 parent e807e77 commit 2fa8179

File tree

8 files changed

+60
-61
lines changed

8 files changed

+60
-61
lines changed

.github/workflows/build.yaml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ jobs:
132132
fail-fast: false
133133
matrix:
134134
os:
135-
- ubuntu-22.04
136-
- macos-13
135+
# - ubuntu-22.04
136+
# - macos-13
137137
- windows-2022
138138
arch:
139139
- aarch64
@@ -149,6 +149,14 @@ jobs:
149149
arch: aarch64
150150

151151
steps:
152+
# - name: Enable longpath
153+
# run: |
154+
# New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
155+
# New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Command Processor' -Name 'DisableUNCCheck' -Force
156+
# Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Command Processor' -Name 'DisableUNCCheck' -Type DWord -Value 1
157+
# gpupdate /force
158+
# if: ${{ contains(matrix.os, 'windows') }}
159+
152160
- name: Checkout
153161
uses: actions/checkout@v4
154162

@@ -173,7 +181,35 @@ jobs:
173181

174182
- name: Python Build
175183
run: pnpm run build
184+
if: ${{ !contains(matrix.os, 'windows') }}
185+
env:
186+
# CARGO_TARGET_DIR: \\?\D:\psp-rust
187+
# CARGO_TARGET_DIR: \\?\D:\${{ github.workspace }}\target
188+
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
189+
PACKAGE: "perspective-python"
190+
PSP_USE_CCACHE: 1
191+
PSP_ARCH: ${{ matrix.arch }}
192+
CI: 1
193+
194+
- name: Python Build Pyodide
195+
run: pnpm run build
196+
if: ${{ contains(matrix.os, 'ubuntu') }}
197+
env:
198+
PSP_PYODIDE: 1
199+
PACKAGE: "perspective-python"
200+
PSP_USE_CCACHE: 1
201+
CI: 1
202+
203+
- name: Python Build (Windows)
204+
run: |
205+
New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force
206+
pnpm run build
207+
if: ${{ contains(matrix.os, 'windows') }}
208+
# working-directory: \\?\${{github.workspace}}
176209
env:
210+
CARGO_TARGET_DIR: D:\psp-rust
211+
PSP_ROOT_DIR: ${{ github.workspace }}
212+
# CARGO_TARGET_DIR: \\?\${{ github.workspace }}\target
177213
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
178214
PACKAGE: "perspective-python"
179215
PSP_USE_CCACHE: 1

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/perspective-python/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ cmake = "0.1.50"
5151
num_cpus = "1.16.0"
5252
pyo3-build-config = "0.20.2"
5353
python-config-rs = "0.1.2"
54+
tempfile = "3.10.1"
5455

5556
[dependencies]
5657
async-lock = "2.5.0"

rust/perspective-python/build.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ const { emscripten } = JSON.parse(
2323
fs.readFileSync(sh.path`${__dirname}/../../package.json`)
2424
);
2525

26-
const cmd = sh(process.argv.slice(2).join(" "));
26+
const cmd = sh();
2727

28-
cmd.env({
29-
PSP_ROOT_DIR: "../..",
30-
});
28+
// if not windows
29+
if (process.platform !== "win32") {
30+
cmd.env({
31+
PSP_ROOT_DIR: "../..",
32+
});
33+
}
3134

3235
if (is_pyodide) {
3336
cmd.sh`. ${emsdkdir}/emsdk_env.sh >/dev/null 2>&1`
@@ -67,7 +70,8 @@ function get_host_triple() {
6770
}
6871

6972
cmd.sh(
70-
`maturin ${maturin_command} --features=external-cpp --sdist ${maturin_flags}`
73+
`maturin ${maturin_command} --features=external-cpp --verbose ${maturin_flags}`
7174
);
7275

73-
await cmd();
76+
console.log("RUNNING_CMD: ", cmd.toString());
77+
cmd.runSync();

rust/perspective-python/build.mjs

Lines changed: 0 additions & 53 deletions
This file was deleted.

rust/perspective-python/build/psp.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ pub fn cmake_build() -> Result<PathBuf, std::io::Error> {
5454
}
5555

5656
let mut dst = Config::new("cpp/perspective");
57+
if cfg!(windows) {
58+
std::fs::create_dir_all("D:\\psp-build")?;
59+
dst.out_dir("D:\\psp-build");
60+
}
5761
let profile = std::env::var("PROFILE").unwrap();
5862
dst.always_configure(true);
5963
dst.define("CMAKE_BUILD_TYPE", profile.as_str());

rust/perspective-server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export-cpp-only = []
4141
cxx-build = "1.0.115"
4242
cmake = "0.1.50"
4343
num_cpus = "1.16.0"
44+
tempfile = "3.10.1"
4445

4546
[dependencies]
4647
async-lock = "2.5.0"

rust/perspective-server/build/psp.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ pub fn cmake_build() -> Result<PathBuf, std::io::Error> {
5454
}
5555

5656
let mut dst = Config::new("cpp/perspective");
57+
if cfg!(windows) {
58+
std::fs::create_dir_all("D:\\psp-build")?;
59+
dst.out_dir("D:\\psp-build");
60+
}
5761
let profile = std::env::var("PROFILE").unwrap();
5862
dst.always_configure(true);
5963
dst.define("CMAKE_BUILD_TYPE", profile.as_str());

0 commit comments

Comments
 (0)