0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
618 stars 156 forks source link

docs.rs build is failling because of stdlib masl compilation #1208

Closed hackaugusto closed 3 months ago

hackaugusto commented 7 months ago

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 commented 7 months ago

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

bobbinth commented 7 months ago

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).

mFragaBA commented 3 months ago

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?

bobbinth commented 3 months ago

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.

mFragaBA commented 3 months ago

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

bobbinth commented 3 months ago

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

bobbinth commented 3 months ago

Closed by #1341.