-
Notifications
You must be signed in to change notification settings - Fork 226
Compilation errors in ONNX ML Inference guest code: "could not find unix in os" from filetime dependency #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@grandchildrice |
@grandchildrice were you able to resolve this issue? |
I tried this on a Mac M4 and it works fine. @grandchildrice what are the machine specs? |
Sorry, I have modified the relevant command to execute a different code. The error can be reproduced from this PR. |
The filetime is imported from trac_onnx used by guest, and for some reason the os library used by this library is attempting to import unix. |
tract-onnx depends on:
All of these require full Unix host capabilities — none of them are compatible with Jolt’s guest environment, which is:
We need to alter this to work in host. |
Context:
We are collaborating with the Novanet team to implement zkML using Jolt. As a first step, we are writing Jolt guest code to load a simple Gradient Boosting model from an ONNX file and execute inference. However, during compilation of our guest code, we are encountering errors related to the
filetime
crate.Steps to Reproduce:
Expected Behavior:
The code should compile without issues and perform inference using the ONNX model.
Actual Behavior:
Compilation fails with errors originating from the
filetime
crate. Key error messages include:libc
and missing methods (e.g.,as_raw_fd
,mtime
,atime
):Workarounds Attempted:
Default Features Disabled:
We set
filetime = { version = "0.2", default-features = false }
in our guest project’s Cargo.toml to disable Unix-specific code. However, the error still occurs.Patching filetime via [patch.crates-io]:
We attempted to override filetime using a patch in our guest project’s Cargo.toml and then in the workspace root. The patch was rejected with the message:
This indicates that patching the filetime crate in this way isn’t working because it points to the same source as crates.io.
Target Configuration:
We considered whether our build target might be causing the issue (i.e., a non-Unix or custom target environment where
std::os::unix
is unavailable). However, it is unclear whether adjusting target specifications alone can resolve the issue.Additional Information:
filetime
crate’s own Cargo.toml uses conditional dependencies to includelibc
on Unix platforms. It appears that on our target, the#[cfg(unix)]
condition is being incorrectly evaluated, leading to compilation of Unix-specific code on a non-Unix target.jolt-core
, which does not seem to modify the dependency onfiletime
directly.Request:
Could you please advise on how to resolve these compilation issues?
Thank you for your assistance.
found very similar issue on RISC0 space: risc0/risc0#2401
The text was updated successfully, but these errors were encountered: