Skip to content
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

VS Plugin does not support dependancies in the same repo #70

Open
SWvheerden opened this issue Aug 28, 2024 · 4 comments
Open

VS Plugin does not support dependancies in the same repo #70

SWvheerden opened this issue Aug 28, 2024 · 4 comments

Comments

@SWvheerden
Copy link

I hope this is the correct place to put this, if not please move it to the correct repo.

Using the VS code plugin you cannot compile a rust ledger application that contains a dependency that's defined using a path

As far as I can pickup this is due to the plugin forcing you to open the folder where the cargo file for the ledger application is located and then load that into the docker container. That means folders higher up are not available to be accessed by the docker during the build process.
Doing this manually by loading the root project into the docker, and then browsing to the ledger folder, the project can be build successfully.

@bigspider
Copy link

Hi @SWvheerden, a solution to customize the docker commands was recently added in the VSCode extension, but it will require some manual tuning for your workspace. See the example in the linked PR, it was added exactly for the problem you're having!

@SWvheerden
Copy link
Author

Thanks, thats awesome.
I am having some trouble filling it in though.
I have this crate:
minotari_ledger_wallet_common = { path = "../common" }

And in the vs code extension settings, I filled this in:
-v '${workspaceFolder}/../common

But I can't see that it's passing that info onto the container. It's still complaining about the missing file:

Caused by:
  No such file or directory (os error 2)
thread 'main' panicked at /opt/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-ledger-1.5.1/src/main.rs:137:10:
Could not execute `cargo metadata`: CargoMetadata { stderr: "error: failed to load manifest for dependency `minotari_ledger_wallet_common`\n\nCaused by:\n  failed to read `/common/Cargo.toml`\n\nCaused by:\n  No such file or directory (os error 2)\n" }

@bigspider
Copy link

bigspider commented Aug 29, 2024

In the project where I'm using it (private repo, unfortunately), the setting in .vscode/settings.json looks like this:

        "dockerRunArgs": "-v '${workspaceFolder}/../common:/common'"

@SWvheerden
Copy link
Author

this is how it looks in my settings.json:

   "ledgerDevTools.dockerRunArgs": "-v '${workspaceFolder}/../common:/minotari_ledger_wallet_common",

I am playing around with the values here.
I take it the first ../common is the path to the folder, and the second one is the crate name?
I am familiar with the :/ notation except in network addresses.

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

2 participants