fix#101
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes Docker build issues related to copying shared libraries and handling the CIRCE native library dependency. The changes ensure proper library placement and add fallback handling for missing CIRCE components.
- Adds CIRCE native library extraction and copying with fallback mechanisms
- Fixes the ONNX runtime library copy destination path
- Implements CIRCE revision tracking for better dependency management
| mv /usr/src/trex/target/${PROFILE}/trex /root | ||
| mv /usr/src/trex/target/${PROFILE}/trex /root && \ | ||
| cp /usr/src/trex/target/${PROFILE}/build/circe-rust-wrapper-*/out/libcirce-native.so /root/ || true && \ | ||
| CIRCE_REV=$(grep -A1 'circe.*git.*circe-be' ext/trex/Cargo.toml | grep 'rev' | sed 's/.*rev = "\([^"]*\)".*/\1/' | cut -c1-7) && \ |
There was a problem hiding this comment.
This complex shell pipeline for extracting the CIRCE revision is fragile and hard to maintain. Consider using a more robust approach like cargo metadata or breaking this into multiple steps with intermediate validation.
| cp /usr/local/cargo/git/checkouts/circe-be-*/${CIRCE_REV}*/native-libs/linux-x86_64/libcirce-native.so /root/libcirce-native.so || \ | ||
| echo "Warning: Could not find CIRCE native library for revision $CIRCE_REV" |
There was a problem hiding this comment.
The path pattern with multiple wildcards (/usr/local/cargo/git/checkouts/circe-be-/${CIRCE_REV}/) is brittle and may match unintended directories or fail unexpectedly. Consider using a more specific path resolution or add validation to ensure the correct directory is found.
| cp /usr/local/cargo/git/checkouts/circe-be-*/${CIRCE_REV}*/native-libs/linux-x86_64/libcirce-native.so /root/libcirce-native.so || \ | |
| echo "Warning: Could not find CIRCE native library for revision $CIRCE_REV" | |
| CIRCE_PATH=$(find /usr/local/cargo/git/checkouts/ -type d -path "*/circe-be-*" -path "*/${CIRCE_REV}*" -print -quit) && \ | |
| if [ -n "$CIRCE_PATH" ] && [ -f "$CIRCE_PATH/native-libs/linux-x86_64/libcirce-native.so" ]; then \ | |
| cp "$CIRCE_PATH/native-libs/linux-x86_64/libcirce-native.so" /root/libcirce-native.so; \ | |
| else \ | |
| echo "Warning: Could not find CIRCE native library for revision $CIRCE_REV"; \ | |
| fi |
No description provided.