Skip to content

Commit 70a7529

Browse files
committed
Pass in various compression tool path prefixes via taskflow variables
1 parent 4741ef9 commit 70a7529

File tree

5 files changed

+43
-14
lines changed

5 files changed

+43
-14
lines changed

integration-tests/.pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ env =
1010
D:CLP_BUILD_DIR=../build
1111
D:CLP_CORE_BINS_DIR=../build/core
1212
D:CLP_DEPS_CORE_DIR=../build/deps/core
13+
D:CLP_LIBLZMA_ROOT=../build/deps/core/LibLZMA-install
14+
D:CLP_LZ4_ROOT=../build/deps/core/lz4-install
1315
D:CLP_PACKAGE_DIR=../build/clp-package
16+
D:CLP_ZSTD_ROOT=../build/deps/core/zstd-install
1417
log_cli = True
1518
log_cli_date_format = %Y-%m-%d %H:%M:%S,%f
1619
log_cli_format = %(name)s %(asctime)s [%(levelname)s] %(message)s

integration-tests/tests/fixtures/integration_test_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ def integration_test_config() -> IntegrationTestConfig:
2020
clp_core_bins_dir=Path(get_env_var("CLP_CORE_BINS_DIR")).expanduser().resolve()
2121
)
2222
deps_config = DepsConfig(
23-
clp_deps_core_dir=Path(get_env_var("CLP_DEPS_CORE_DIR")).expanduser().resolve()
23+
clp_deps_core_dir=Path(get_env_var("CLP_DEPS_CORE_DIR")).expanduser().resolve(),
24+
clp_liblzma_root=Path(get_env_var("CLP_LIBLZMA_ROOT")).expanduser().resolve(),
25+
clp_lz4_root=Path(get_env_var("CLP_LZ4_ROOT")).expanduser().resolve(),
26+
clp_zstd_root=Path(get_env_var("CLP_ZSTD_ROOT")).expanduser().resolve(),
2427
)
2528
package_config = PackageConfig(
2629
clp_package_dir=Path(get_env_var("CLP_PACKAGE_DIR")).expanduser().resolve()

integration-tests/tests/utils/config.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,38 @@ def clp_s_binary_path(self) -> Path:
4949

5050
@dataclass(frozen=True)
5151
class DepsConfig:
52-
"""The configuration for dependencies used by clp."""
52+
"""The configuration for dependencies used by CLP package and binaries."""
5353

54-
#:
54+
#: Install directory for all core CLP dependencies.
5555
clp_deps_core_dir: Path
56+
#: Install prefix of LibLZMA used by CLP.
57+
clp_liblzma_root: Path
58+
#: Install prefix of lz4 used by CLP.
59+
clp_lz4_root: Path
60+
#: Install prefix of zstd used by CLP.
61+
clp_zstd_root: Path
5662

5763
def __post_init__(self) -> None:
58-
"""Validates that the core dependency directory exists."""
64+
"""Validates that dependency directories exist."""
5965
validate_dir_exists_and_is_absolute(self.clp_deps_core_dir)
66+
validate_dir_exists_and_is_absolute(self.clp_liblzma_root)
67+
validate_dir_exists_and_is_absolute(self.clp_lz4_root)
68+
validate_dir_exists_and_is_absolute(self.clp_zstd_root)
6069

6170
@property
6271
def lz4_binary_path(self) -> Path:
6372
""":return: The absolute path to the lz4 compression tool."""
64-
return self.clp_deps_core_dir / "lz4-install" / "bin" / "lz4"
65-
66-
@property
67-
def zstd_binary_path(self) -> Path:
68-
""":return: The absolute path to the zstd compression tool."""
69-
return self.clp_deps_core_dir / "zstd-install" / "bin" / "zstd"
73+
return self.clp_lz4_root / "bin" / "lz4"
7074

7175
@property
7276
def xz_binary_path(self) -> Path:
7377
""":return: The absolute path to the LibLZMA xz compression tool."""
74-
return self.clp_deps_core_dir / "LibLZMA-static-install" / "bin" / "xz"
78+
return self.clp_liblzma_root / "bin" / "xz"
79+
80+
@property
81+
def zstd_binary_path(self) -> Path:
82+
""":return: The absolute path to the zstd compression tool."""
83+
return self.clp_zstd_root / "bin" / "zstd"
7584

7685

7786
@dataclass(frozen=True)

taskfiles/deps/main.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ vars:
2121
G_BOOST_LIB_NAME: "Boost"
2222
G_FMT_LIB_NAME: "fmt"
2323
G_GSL_LIB_NAME: "Microsoft.GSL"
24+
G_LIBLZMA_LIB_NAME: "LibLZMA"
25+
G_LZ4_LIB_NAME: "lz4"
26+
G_ZSTD_LIB_NAME: "zstd"
27+
28+
# Library install prefixes
29+
G_LZ4_INSTALL_PREFIX: "{{.G_DEPS_CORE_DIR}}/{{.G_LZ4_LIB_NAME}}-install"
30+
G_ZSTD_INSTALL_PREFIX: "{{.G_DEPS_CORE_DIR}}/{{.G_ZSTD_LIB_NAME}}-install"
31+
G_LIBLZMA_STATIC_INSTALL_PREFIX: "{{.G_DEPS_CORE_DIR}}/{{.G_LIBLZMA_LIB_NAME}}-static-install"
2432

2533
# Antlr
2634
G_ANTLR_VERSION: "4.13.2"
@@ -296,7 +304,8 @@ tasks:
296304
- "-DBUILD_SHARED_LIBS={{ if .BUILD_SHARED_LIBS }}ON{{ else }}OFF{{ end }}"
297305
- >-
298306
{{ join " " .COMMON_CMAKE_GEN_ARGS }}
299-
LIB_NAME: "LibLZMA-{{ if .BUILD_SHARED_LIBS }}shared{{ else }}static{{ end }}"
307+
LIB_NAME: >-
308+
{{.G_LIBLZMA_LIB_NAME}}-{{ if .BUILD_SHARED_LIBS }}shared{{ else }}static{{ end }}
300309
TARBALL_SHA256: "{{.TARBALL_SHA256}}"
301310
TARBALL_URL: "{{.TARBALL_URL}}"
302311

@@ -331,7 +340,8 @@ tasks:
331340
- "-DCMAKE_BUILD_TYPE=Release"
332341
- "-DCMAKE_INSTALL_MESSAGE=LAZY"
333342
CMAKE_SOURCE_DIR: "build/cmake"
334-
LIB_NAME: "lz4"
343+
INSTALL_PREFIX: "{{.G_LZ4_INSTALL_PREFIX}}"
344+
LIB_NAME: "{{.G_LZ4_LIB_NAME}}"
335345
TARBALL_SHA256: "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b"
336346
TARBALL_URL: "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz"
337347

@@ -557,6 +567,7 @@ tasks:
557567
- "-DZSTD_BUILD_STATIC=ON"
558568
- "-DZSTD_BUILD_TESTS=OFF"
559569
CMAKE_SOURCE_DIR: "build/cmake"
560-
LIB_NAME: "zstd"
570+
INSTALL_PREFIX: "{{.G_ZSTD_INSTALL_PREFIX}}"
571+
LIB_NAME: "{{.G_ZSTD_LIB_NAME}}"
561572
TARBALL_SHA256: "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3"
562573
TARBALL_URL: "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz"

taskfiles/tests/integration.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ tasks:
2424
CLP_BUILD_DIR: "{{.G_BUILD_DIR}}"
2525
CLP_CORE_BINS_DIR: "{{.G_CORE_COMPONENT_BUILD_DIR}}"
2626
CLP_DEPS_CORE_DIR: "{{.G_DEPS_CORE_DIR}}"
27+
CLP_LIBLZMA_ROOT: "{{.G_LIBLZMA_STATIC_INSTALL_PREFIX}}"
28+
CLP_LZ4_ROOT: "{{.G_LZ4_INSTALL_PREFIX}}"
2729
CLP_PACKAGE_DIR: "{{.G_PACKAGE_BUILD_DIR}}"
30+
CLP_ZSTD_ROOT: "{{.G_ZSTD_INSTALL_PREFIX}}"
2831
cmd: "uv run python -m pytest -m core"

0 commit comments

Comments
 (0)