Skip to content

Commit b9af3bd

Browse files
authored
Merge pull request #2826 from tomjakubowski/sdist-ci-followups
CI sdist fixes, port conda patch, fix ODR violation
2 parents 00137e3 + 5b5f9ce commit b9af3bd

6 files changed

Lines changed: 40 additions & 77 deletions

File tree

.github/actions/install-deps/action.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ inputs:
4242
default: "false"
4343
description: "Don't use cache from previous builds"
4444

45-
outputs:
46-
VCPKG_INSTALLATION_ROOT:
47-
description: "The output of vcpkg install path"
48-
value: ${{ steps.vcpkg-step.outputs.VCPKG_INSTALLATION_ROOT }}
49-
5045
runs:
5146
using: "composite"
5247
steps:
@@ -111,23 +106,6 @@ runs:
111106
# with:
112107
# key: ${{ github.job }}-${{ matrix.os }}
113108

114-
- name: Windows init steps (vc143)
115-
id: vcpkg-step
116-
shell: pwsh
117-
run: |
118-
vcpkg.exe install boost-thread boost-algorithm boost-filesystem boost-multi-index boost-multiprecision boost-program-options boost-system boost-unordered boost-uuid
119-
vcpkg.exe integrate install
120-
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}"
121-
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_OUTPUT
122-
echo "${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_PATH
123-
echo "VCPKG_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_ENV
124-
dir env:
125-
env:
126-
PYTHON_VERSION: ${{ matrix.python-version }}
127-
VCPKG_DEFAULT_TRIPLET: x64-windows
128-
VCPKG_PLATFORM_TOOLSET: v143
129-
if: ${{ runner.os == 'Windows' && inputs.cpp == 'true' }}
130-
131109
# https://github.com/apache/arrow/issues/38391
132110
- if: ${{ runner.os == 'macOS' }}
133111
shell: bash

.github/workflows/build.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ jobs:
649649
test_python_sdist:
650650
needs: [build_and_test_jupyterlab]
651651
runs-on: ${{ matrix.os }}
652+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
653+
652654
strategy:
653655
fail-fast: false
654656
matrix:
@@ -677,28 +679,36 @@ jobs:
677679

678680
- uses: actions/download-artifact@v4
679681
with:
680-
name: perspective-metadata
681-
path: rust/
682+
name: perspective-rust
683+
path: crates/
682684

683685
- uses: actions/download-artifact@v4
684686
with:
685687
name: perspective-python-sdist
686688

687-
- name: Set up global perspective-server and perspective-client path overrides
688-
# this makes it so the sdist is tested against unreleased changes
689-
# made to perspective-client and perspective-server
689+
# The sdist depends on perspective-{client,server} crates published to
690+
# crates.io. Patch the build to instead use .crate artifacts built
691+
# previously in the workflow
692+
- name: Set up path overrides for perspective .crate contents
693+
shell: bash
690694
run: |
695+
(cd crates && tar xvf perspective-client-*.crate && tar xvf perspective-server-*.crate)
696+
CLIENT_CRATE_ROOT=$(ls -d "$PWD"/crates/perspective-client-*/ | head -n 1)
697+
SERVER_CRATE_ROOT=$(ls -d "$PWD"/crates/perspective-server-*/ | head -n 1)
698+
691699
mkdir -p $HOME/.cargo
692700
cat > $HOME/.cargo/config.toml <<EOF
693701
[patch.crates-io]
694-
perspective-client = { path = "$PWD/rust/perspective-client" }
695-
perspective-server = { path = "$PWD/rust/perspective-server" }
702+
perspective-client = { path = "$CLIENT_CRATE_ROOT" }
703+
perspective-server = { path = "$SERVER_CRATE_ROOT" }
696704
EOF
697705
698706
- name: Install perspective-python sdist
707+
shell: bash
699708
run: python -m pip install -vv ./perspective*.tar.gz
700709

701710
- name: Verify labextension
711+
shell: bash
702712
run: |
703713
jupyter labextension list --debug
704714
jupyter labextension list 2>&1 | grep '@finos/perspective-jupyterlab'
@@ -830,6 +840,7 @@ jobs:
830840
[
831841
build_and_test_jupyterlab,
832842
test_python,
843+
test_python_sdist,
833844
test_js,
834845
benchmark_js,
835846
benchmark_python,

cmake/arrow.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ ExternalProject_Add(apachearrow
2020
TEST_COMMAND ""
2121
# This patch is to work around https://github.com/apache/arrow/issues/44384
2222
# It can be removed when a version of Arrow is released with https://github.com/apache/arrow/pull/44385
23-
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> git apply ${CMAKE_SOURCE_DIR}/patches/fix_arrow_libtool.patch
23+
PATCH_COMMAND "${CMAKE_COMMAND}" -E chdir <SOURCE_DIR> git apply "${CMAKE_SOURCE_DIR}/patches/fix_arrow_libtool.patch"
2424
)

cpp/perspective/CMakeLists.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ endif()
5050

5151

5252
if(WIN32)
53-
set(CMAKE_CXX_FLAGS " /EHsc /MP /MT /c /bigobj")
53+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /MT /c /bigobj")
5454
else()
5555
# set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS}")
5656
endif()
@@ -301,24 +301,24 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD)
301301
endif()
302302
endif()
303303

304-
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Disable rapidjson tests")
305-
306-
307-
set(CMAKE_C_FLAGS " \
304+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
308305
-O3 \
309306
")
307+
310308
if (PSP_WASM_EXCEPTIONS)
311-
set(CMAKE_CXX_FLAGS " -fwasm-exceptions \
312-
-O3 \
313-
-g0 \
314-
")
309+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
310+
-fwasm-exceptions \
311+
-O3 \
312+
-g0 \
313+
")
315314
else()
316-
set(CMAKE_CXX_FLAGS " \
317-
-O3 \
318-
")
319-
315+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
316+
-O3 \
317+
")
320318
endif()
321319

320+
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Disable rapidjson tests")
321+
322322
if(PSP_PYODIDE)
323323
set(RELOCATABLE_FLAGS "-sRELOCATABLE=1 -sSIDE_MODULE=2 -sWASM_BIGINT=1")
324324

@@ -327,7 +327,7 @@ if(PSP_PYODIDE)
327327
string(APPEND CMAKE_CXX_FLAGS "${RELOCATABLE_FLAGS}")
328328
endif()
329329

330-
# Build header-only dependencies from external source
330+
# Build (read: download and extract) header-only dependencies from external sources
331331
set(all_deps_INCLUDE_DIRS "")
332332
psp_build_dep("date" "${PSP_CMAKE_MODULE_PATH}/date.txt.in")
333333
psp_build_dep("hopscotch" "${PSP_CMAKE_MODULE_PATH}/hopscotch.txt.in")
@@ -342,6 +342,10 @@ list(APPEND all_deps_INCLUDE_DIRS
342342
psp_build_dep("Boost" "${PSP_CMAKE_MODULE_PATH}/Boost.txt.in")
343343
list(APPEND all_deps_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
344344

345+
# Build dependencies as static libraries with add_subdirectory()
346+
# Note that values set above for CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, etc. will
347+
# apply to dependency cmake builds
348+
345349
# Arrow builds its own dependencies
346350
psp_build_message("${Cyan}Building Apache Arrow${ColorReset}")
347351
psp_build_dep("arrow" "${PSP_CMAKE_MODULE_PATH}/arrow.txt.in")
@@ -364,20 +368,16 @@ list(APPEND all_deps_INCLUDE_DIRS
364368
add_subdirectory(${PSP_CMAKE_MODULE_PATH}/../cpp/protos "${CMAKE_BINARY_DIR}/protos-build")
365369

366370
# ####################
367-
set(CMAKE_C_FLAGS_DEBUG "")
368-
set(CMAKE_C_FLAGS_RELEASE "")
369371
set(CMAKE_C_FLAGS " \
370372
${CMAKE_C_FLAGS} \
373+
${CMAKE_C_FLAGS_RELEASE} \
371374
${EXTENDED_FLAGS} \
372375
${OPT_FLAGS} \
373376
")
374377

375-
# prevents the default debug flags from overriding the debug flags we
376-
# set in OPT_FLAGS
377-
set(CMAKE_CXX_FLAGS_DEBUG "")
378-
set(CMAKE_CXX_FLAGS_RELEASE "")
379378
set(CMAKE_CXX_FLAGS " \
380379
${CMAKE_CXX_FLAGS} \
380+
${CMAKE_CXX_FLAGS_RELEASE} \
381381
${EXTENDED_FLAGS} \
382382
${OPT_FLAGS} \
383383
")
@@ -484,7 +484,7 @@ set(WASM_SOURCE_FILES ${SOURCE_FILES})
484484
message("${BUILD_MESSAGE}\n")
485485

486486
if(WIN32)
487-
set(CMAKE_CXX_FLAGS " /EHsc /MP /MT /c /bigobj")
487+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /MT /c /bigobj")
488488
else()
489489
# set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS}")
490490
endif()

cpp/perspective/src/cpp/utils.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ parse_all_date_time(
125125
);
126126
}
127127

128-
bool
129-
parse_all_date_time(std::tm& tm, std::string_view date_time_str) {
130-
std::chrono::system_clock::time_point tp;
131-
return parse_all_date_time(tm, tp, date_time_str);
132-
}
133-
134128
bool
135129
parse_all_date_time(
136130
std::chrono::system_clock::time_point& tp, std::string_view date_time_str

rust/perspective-server/build/psp.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,6 @@ pub fn cmake_build() -> Result<Option<PathBuf>, std::io::Error> {
5858
dst.define("PSP_WASM_BUILD", "0");
5959
}
6060

61-
if cfg!(windows) {
62-
match std::env::var("VCPKG_ROOT") {
63-
Ok(vcpkg_root) => {
64-
dst.define(
65-
"CMAKE_TOOLCHAIN_FILE",
66-
format!(
67-
"{}/scripts/buildsystems/vcpkg.cmake",
68-
vcpkg_root.replace("\\", "/")
69-
),
70-
);
71-
},
72-
Err(_) => {
73-
println!(
74-
"cargo:warning=MESSAGE VCPKG_ROOT not set in environment, not setting \
75-
CMAKE_TOOLCHAIN_FILE"
76-
)
77-
},
78-
}
79-
}
80-
8161
if std::env::var("CARGO_FEATURE_PYTHON").is_ok() {
8262
dst.define("CMAKE_POSITION_INDEPENDENT_CODE", "ON");
8363
dst.define("PSP_PYTHON_BUILD", "1");

0 commit comments

Comments
 (0)