Skip to content

Commit 902ba1f

Browse files
authored
Merge branch 'main' into zachg/llmobs_annotate_context_fix
2 parents eec2e5c + fd1f2f9 commit 902ba1f

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.github/workflows/pytorch_gpu_tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ jobs:
3232
run: rustup update stable && rustup default stable && rustup component add rustfmt clippy
3333

3434
- name: Install hatch
35-
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
36-
with:
37-
version: "1.12.0"
38-
35+
run: pip install hatch==1.12.0
36+
3937
- name: Install PyTorch
4038
run: pip install torch
4139

.github/workflows/unit_tests.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
- name: Install latest stable toolchain and rustfmt
3030
run: rustup update stable && rustup default stable && rustup component add rustfmt clippy
3131

32-
- name: Install hatch
33-
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
34-
with:
35-
version: "1.12.0"
36-
3732
- name: Install coreutils for MacOS to get sha256sum
3833
if: matrix.os == 'macos-latest'
3934
run: brew install coreutils
@@ -45,6 +40,9 @@ jobs:
4540
sudo apt-get update
4641
sudo apt-get install -y python3.14 python3.14-dev
4742
43+
- name: Install hatch
44+
run: pip install hatch==1.12.0
45+
4846
- name: Run tests
4947
run: hatch run +py=${{ matrix.python-version }} multiple_os_tests:test
5048

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,15 @@ def build_rust(self):
664664
if src_file.exists():
665665
newest_source_time = max(newest_source_time, src_file.stat().st_mtime)
666666

667-
# Only rebuild if source files are newer than the destination
668-
should_build = newest_source_time > library_mtime
667+
required_headers = ["common.h"]
668+
if "profiling" in rust_features:
669+
required_headers.append("profiling.h")
670+
671+
include_dir = CARGO_TARGET_DIR / "include" / "datadog"
672+
headers_exist = include_dir.exists() and all((include_dir / header).exists() for header in required_headers)
673+
674+
# Only rebuild if source files are newer than the destination OR if any required header is missing
675+
should_build = newest_source_time > library_mtime or not headers_exist
669676

670677
if should_build:
671678
# Create and run the CustomBuildRust command

0 commit comments

Comments
 (0)