Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ jobs:
toolchain: stable
override: true

- name: Add Windows GNU target
if: matrix.os == 'windows-latest'
run: rustup target add x86_64-pc-windows-gnu

- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -137,7 +141,12 @@ jobs:
- name: Build Rust Core
run: |
cd attest-rs
cargo build --release
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cargo build --release --target x86_64-pc-windows-gnu
else
cargo build --release
fi
shell: bash

- name: Build release binary
shell: bash
Expand All @@ -149,15 +158,17 @@ jobs:

# Link against the release build of the Rust core
export CGO_ENABLED=1
export RUST_RELEASE_PATH="$(pwd)/attest-rs/target/release"

if [ "$GOOS" = "linux" ]; then
export RUST_RELEASE_PATH="$(pwd)/attest-rs/target/release"
export CGO_LDFLAGS="-L${RUST_RELEASE_PATH} -lattest_rs -lssl -lcrypto -ltss2-esys -ltss2-mu -ltss2-tctildr"
elif [ "$GOOS" = "darwin" ]; then
export RUST_RELEASE_PATH="$(pwd)/attest-rs/target/release"
export CGO_LDFLAGS="-L${RUST_RELEASE_PATH} -lattest_rs -framework Security -framework CoreFoundation"
else
# Windows linking via MSVC/CNG
export CGO_LDFLAGS="-L${RUST_RELEASE_PATH} -lattest_rs -lbcrypt -lncrypt"
# Windows linking via MinGW/GNU target
export RUST_RELEASE_PATH="$(pwd)/attest-rs/target/x86_64-pc-windows-gnu/release"
export CGO_LDFLAGS="-L${RUST_RELEASE_PATH} -lattest_rs -lbcrypt -lws2_32 -luserenv -lntdll -lole32"
fi

go build -o "$BINARY_NAME" ./cmd/attest
Expand Down
6 changes: 3 additions & 3 deletions pkg/bridge/config_windows.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// +build windows
// go:build windows
//go:build windows && cgo
// +build windows,cgo

package bridge

/*
#cgo LDFLAGS: -L${SRCDIR}/../../attest-rs/target/release -lattest_rs -lbcrypt -lws2_32 -luserenv -lntdll
#cgo LDFLAGS: -Wl,-rpath,${SRCDIR}/../../attest-rs/target/x86_64-pc-windows-gnu/release -L${SRCDIR}/../../attest-rs/target/x86_64-pc-windows-gnu/release -lattest_rs -lbcrypt -lws2_32 -luserenv -lntdll -lole32
*/
import "C"
Loading