miden-vm icon indicating copy to clipboard operation
miden-vm copied to clipboard

docs.rs build is failling because of stdlib masl compilation

Open hackaugusto opened this issue 1 year ago • 2 comments

These are the relevant log lines from the docs.rs build:

[INFO] [stderr] error: failed to run custom build command for `miden-stdlib v0.6.0`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/miden-stdlib-eca886afdf6dc443/build-script-build` (exit status: 101)
[INFO] [stderr]   --- stdout
[INFO] [stderr]   cargo:rerun-if-changed=asm
[INFO] [stderr]   cargo:rerun-if-changed=../assembly/src
[INFO] [stderr] 
[INFO] [stderr]   --- stderr
[INFO] [stderr]   thread 'main' panicked at /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/miden-stdlib-0.6.0/build.rs:62:36:
[INFO] [stderr]   called `Result::unwrap()` on an `Err` value: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }
[INFO] [stderr]   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[INFO] running `Command { std: "docker" "inspect" "747083e6431f405446f9cd3cac138e0777497f1d13cc009914f725d839374e2e", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "747083e6431f405446f9cd3cac138e0777497f1d13cc009914f725d839374e2e", kill_on_drop: false }`
[INFO] [stdout] 747083e6431f405446f9cd3cac138e0777497f1d13cc009914f725d839374e2e

Currently failing at this line:

https://github.com/0xPolygonMiden/miden-vm/blob/c097af7ca53da2026cec10d9245a006b42186643/stdlib/build.rs#L62

hackaugusto avatar Jan 23 '24 13:01 hackaugusto

Maybe instead of deleting the folder, deleting only the folder's content would work?

hackaugusto avatar Jan 23 '24 13:01 hackaugusto

Do you mean running cargo doc fails? I just tried this on the next branch and seems to work (gives a bunch of warnings though).

bobbinth avatar Jan 23 '24 18:01 bobbinth

Hi! I'm looking into this issue. Apparently docs.rs documentation talks about this issue and mentions the environment where it builds the docs is mostly read only, and that the directory pointed by OUT_DIR should be used. I'll be trying that so documentation gets built into $(OUT_DIR)/docs/.

One thing I'm wondering is if we needed the output to be in ./docs by any reason. I noticed that the stdlib's README has some links into that directory (though the links are outdated). Should I make it so unless it's docs.rs building the documentation, the docs dir is /docs?

mFragaBA avatar May 22 '24 18:05 mFragaBA

The initial idea was that we'd have auto-generated docs in the docs directory - but we haven't been too diligent with this. We may still come back to this at some point - so, I'd prefer to keep the general structure as is, unless it makes things much more complicated.

So, if we can detect whether the crate is being built for docs.rs purposes and if so, skip building of the MASM docs, that would probably be an ideal solution.

bobbinth avatar May 22 '24 19:05 bobbinth

And are MASM docs suposed to get built in the docs.rs site?

mFragaBA avatar May 22 '24 19:05 mFragaBA

No - we don't need MASM docs built in docs.rs site (they are mostly for Github).

bobbinth avatar May 22 '24 19:05 bobbinth

Closed by #1341.

bobbinth avatar May 22 '24 20:05 bobbinth