Skip to content

Commit 2f6d2dc

Browse files
committed
fix(ci): resolve all CI failures for v2.1.0
- Fix trinity_constants.zig type error (u32 * f64 in phiLrSchedule) - Fix CMakeLists.txt // comment (CMake only supports #) - Bump rust/gf16 dependency to goldenfloat-sys 2.0.0 - Update Cargo.lock versions - Fix root Cargo.toml cfg(unix) target predicate - Add LD_LIBRARY_PATH and GOLDENFLOAT_LIB_DIR to CI workflow - Pass CGO_CFLAGS/CGO_LDFLAGS for Go binding tests - Pass GOLDENFLOAT_LIB_DIR to cmake for C++ tests
1 parent fc24611 commit 2f6d2dc

6 files changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/test-bindings.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
- name: Build shared library
3939
run: zig build shared
4040

41+
- name: Set library environment
42+
run: |
43+
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/zig-out/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
44+
echo "GOLDENFLOAT_LIB_DIR=$GITHUB_WORKSPACE/zig-out/lib" >> $GITHUB_ENV
45+
4146
- name: Test Zig
4247
if: matrix.language == 'zig'
4348
run: zig build test
@@ -64,6 +69,8 @@ jobs:
6469
cd python
6570
pip install -e . -q
6671
python -m goldenfloat.tests.test_gf16
72+
env:
73+
GOLDENFLOAT_LIB_DIR: ${{ github.workspace }}/zig-out/lib
6774

6875
- name: Install CMake
6976
if: matrix.language == 'cpp'
@@ -78,9 +85,9 @@ jobs:
7885
run: |
7986
cd cpp
8087
mkdir -p build
81-
cmake -S . -B build
88+
cmake -S . -B build -DGOLDENFLOAT_LIB_DIR=$GITHUB_WORKSPACE/zig-out/lib
8289
cmake --build build --target test_gf16
83-
./build/test_gf16
90+
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/zig-out/lib ./build/test_gf16
8491
8592
- name: Install Go
8693
if: matrix.language == 'go'
@@ -92,4 +99,6 @@ jobs:
9299
if: matrix.language == 'go'
93100
run: |
94101
cd go/goldenfloat
95-
go test -v ./...
102+
CGO_CFLAGS="-I$GITHUB_WORKSPACE/src/c" CGO_LDFLAGS="-L$GITHUB_WORKSPACE/zig-out/lib -lgoldenfloat" go test -v ./...
103+
env:
104+
LD_LIBRARY_PATH: ${{ github.workspace }}/zig-out/lib

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ readme = "README.md"
1414
reqwest = { version = "0.12", features = ["blocking"] }
1515

1616
[dependencies]
17-
[target.'cfg(unix(all(not(target_os = "windows")))'.dependencies]
17+
[target.'cfg(unix)'.dependencies]
1818
libc = "0.2"
1919

2020
[[bin]]

cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ endif()
8080

8181
# ============================================================================
8282
# Configuration Summary
83-
// ============================================================================
83+
# ============================================================================
8484

8585
message(STATUS "")
8686
message(STATUS "GoldenFloat C++ Bindings Configuration:")

rust/Cargo.lock

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

rust/gf16/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gf16"
3-
version = "1.1.0"
3+
version = "2.0.0"
44
edition = "2021"
55
authors = ["Trinity Project"]
66
license = "MIT"
@@ -20,5 +20,4 @@ c-abi = ["goldenfloat-sys"]
2020

2121
[dependencies]
2222

23-
# C-FFI bindings (optional, workspace member)
24-
goldenfloat-sys = { version = "1.1.0", optional = true, path = "../goldenfloat-sys" }
23+
goldenfloat-sys = { version = "2.0.0", optional = true, path = "../goldenfloat-sys" }

src/trinity_constants.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn phiLrSchedule(step: u32, total_steps: u32) f64 {
3434
return LR_INIT * @as(f64, @floatFromInt(step)) / @as(f64, @floatFromInt(LR_WARMUP_STEPS));
3535
}
3636
const t = @as(f64, @floatFromInt(step - LR_WARMUP_STEPS)) / @as(f64, @floatFromInt(total_steps));
37-
return LR_INIT * std.math.pow(f64, PHI, -t / LR_TAU * total_steps / LR_TAU);
37+
return LR_INIT * std.math.pow(f64, PHI, -t / LR_TAU * @as(f64, @floatFromInt(total_steps)) / LR_TAU);
3838
}
3939

4040
pub fn trinityInitStd(layer_kind: enum { gauge, higgs, lepton, cosmology }) f64 {

0 commit comments

Comments
 (0)