Storm-WG / storm-stored

Storage daemon for Storm and other LNP/BP nodes - an embeddble microservice frontend for different storage backends
MIT License
6 stars 8 forks source link

store_daemon crate missing documentation #5

Closed nicbus closed 1 year ago

nicbus commented 1 year ago

currently store_daemon is missing the documentation link on crates.io

the documentation build fails on docs.rs, which also means packages depending on store_daemon experience the same failure and are left without documentation

here's an excerpt from the build log:

[INFO] [stderr] error: failed to run custom build command for `store_daemon v0.8.0 (/opt/rustwide/workdir)`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/store_daemon-e23b63f1c34f0995/build-script-build` (exit status: 1)
[INFO] [stderr]   --- stderr
[INFO] [stderr]   Error: I/O error: Read-only file system (os error 30)

I was able to reproduce it by running cargo rustdoc in docker with the project mounted read-only (and target/ mounted read-write) and confirm the issue seems to be in build.rs, as it tries to write to the hard-coded ./shell directory

according to the docs.rs documentation this should be dealt with by using the OUT_DIR environment variable to source the writable path for the build script

in the case of store_daemon, build.rs (and cli/build.rs using ../shell) could be updated to something like:

use std::env;

...
    let outdir = match env::var("OUT_DIR") {
        Ok(d) => d,
        Err(_) => "./shell".to_string(),
    };

but I'm not sure about other implications of this change

@dr-orlovsky could you please take a look at it?

dr-orlovsky commented 1 year ago

Sure, I will have a look; it is just this has the lowest priority: let's get v0.8 and v0.9 working first.

fedsten commented 1 year ago

Now that this has been fixed can we do a new release of store_daemon? It would be very helpful for rgb-lib and other projects using store_daemon.

dr-orlovsky commented 1 year ago

Sure, will do it! I just do not understand how the missing docs affects other libs or binaries...

zoedberg commented 1 year ago

I just do not understand how the missing docs affects other libs or binaries...

It seems that cargo requires building the whole library for generating documentation, but if a dependency build requires a writable filesystem the doc will fail building since cargo uses a protected environment for building doc. You can see the error yourself by giving a look to these logs

@dr-orlovsky Thanks for doing the release :)

dr-orlovsky commented 1 year ago

@zoedberg publlished