Skip to content

Failed to load source for dependency #13

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

Closed
ArneVogel opened this issue Sep 3, 2021 · 1 comment
Closed

Failed to load source for dependency #13

ArneVogel opened this issue Sep 3, 2021 · 1 comment

Comments

@ArneVogel
Copy link

I am trying to use Rudra on a project structured in a workspace. In this workspace there are libraries that have dependencies to libraries from the same workspace. These are specified with relative paths. This causes Rudra to fail. The problem seems to be the dependencies that are specified by a path.

This might be related to #11

Minimal example:
cargo new library --lib ; cargo new user
In user/Cargo.toml add

[dependencies]
 library = { path = "../library" }

Running Rudra causes this error where erroneously library is assumed to be in /tmp?

vogel@cloud1:/opt/tmp/vogel/static-analysis/Rudra/docker-helper$ ./docker-cargo-rudra /opt/tmp/vogel/static-analysis/hello_world/user/

2021-09-03 11:25:52.536262 |INFO | [rudra-progress] Running cargo rudra
2021-09-03 11:25:52.871481 |ERROR| [rudra-progress] Could not obtain Cargo metadata
Error during execution of `cargo metadata`: error: failed to get `library` as a dependency of package `user v0.1.0 (/tmp/rudra)`

Caused by:
  failed to load source for dependency `library`

Caused by:
  Unable to update /tmp/library

Caused by:
  failed to read `/tmp/library/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

When specifying the library dependency as a absolute path (library = { path = "/opt/tmp/vogel/static-analysis/hello_world/library" }) I get the same error without the /tmp issue. It still fails to read the library Cargo.toml, even though it should exist (see cat output).

vogel@cloud1:/opt/tmp/vogel/static-analysis/Rudra/docker-helper$ ./docker-cargo-rudra /opt/tmp/vogel/static-analysis/hello_world/user/

2021-09-03 11:21:57.305532 |INFO | [rudra-progress] Running cargo rudra
2021-09-03 11:21:57.973875 |ERROR| [rudra-progress] Could not obtain Cargo metadata
Error during execution of `cargo metadata`: error: failed to get `library` as a dependency of package `user v0.1.0 (/tmp/rudra)`

Caused by:
  failed to load source for dependency `library`

Caused by:
  Unable to update /opt/tmp/vogel/static-analysis/hello_world/library

Caused by:
  failed to read `/opt/tmp/vogel/static-analysis/hello_world/library/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

vogel@cloud1:/opt/tmp/vogel/static-analysis/Rudra/docker-helper$ cat /opt/tmp/vogel/static-analysis/hello_world/library/Cargo.toml
[package]
name = "library"
version = "0.1.0"
authors = ["Arne Vogel <>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
@ammaraskar
Copy link
Member

Hmm, docker-cargo-rudra is not really meant to handle relative dependencies (it only mounts the crate folder under Docker). For this use case I'd suggest installing rudra on the host machine as per these instructions and trying with that: https://github.com/sslab-gatech/Rudra/blob/master/DEV.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants