我目前正在考虑将Rust集成到我的工作流程中,并且现在遇到了一些问题。这是我的情况:
-
我有2个系统,系统A和系统B
-
B与Internet无连接
-
B的A和Copy-Pasta事物访问B是生锈的环境,将用于运行Rust和Cargo
a可以访问互联网,但无法运行任何货物/生锈命令
为例,假设我正在制作一个项目,而我依靠Rand 0.8.5板条箱为我的项目。理想情况下,我将使用货物供应商命令脱机依赖性,但由于点2)和4)我不能这样做。 但无法弄清楚如何做:
此外,这
,
是我认为我需要做的 兰德(Rand)从B中的A下载到供应商,但是……
因为GitHub上的Rand存储库在使用货物供应商的列兰特时与文件夹层次结构不匹配,所以当我将rand下载的副本放到供应商时,我会遇到错误。此外,我希望是否有人知道如何轻松使兰特存储库工作(不,“只匹配文件层次结构”不是我想要的答案能够成功运营货物供应商)或知道我是否没有正确地做某事。我了解我的情况特别不寻常,因此请随时要求任何澄清。谢谢!
I am currently looking into integrating Rust into my workflow and am running into a bit of an issue right now. This is my situation:
-
I have 2 systems, system A and system B
-
B has no connection to the internet but I can access B through A and copy-pasta things from A to B
-
B is the environment for Rust and will be used for running Rust and Cargo
-
A has access to the internet but cannot run any Cargo/Rust commands
As an example, let’s say I am making a project where I depend on the rand 0.8.5 crate for my project. Ideally I would use the cargo vendor command to offline the dependency but because of points 2) and 4) I cannot do that. Moreover, this is what I think I need to do but cannot figure out how to do it:
A) download the rand repository from GitHub on A
B) manually make a .cargo/config.toml and vendor/ on B
C) copy pasta rand download from A to vendor in B BUT…
Because the rand repository on GitHub doesn’t match with the folder hierarchy when off-lining rand using cargo vendor, I get errors when I do a copy of the rand download to vendor. Moreover, I was hoping if anyone knows how to easily get the rand repository to work (no, “ just match the file hierarchy” isn’t the answer I am looking for as I would not know what the hierarchy should be like due to not being able to successfully run cargo vendor) or know if I am not doing something correctly. I understand my situation is particularly unusual so please feel free to ask for any clarification. Thanks!
发布评论
评论(2)
您可以使用货物获取和预取
下载板条箱以供离线使用..
cargo prefetch
然后尝试将文件从a到b,然后
看看这些用于配置的文件:
You can use cargo fetch and prefetch
For downloading crates for offline use..
Cargo fetch
Cargo prefetch
Then Try moving the files from A to B
Take a look at these files for configuration:
我想我想了!
首先,我从github下载兰德,然后将其从A到B,然后将其移至货物中
。
rand = {path =“路径/to/rand/github/download”}}}}
实际上仍然不起作用,并且会引起问题,并且依赖关系具有依赖关系,值得庆幸的是,编译器告诉您需要什么,因此与其他人是相同的过程除了需要调整以外的货物。终于使用货物运行 - Offline和Boom Sauce,它有效
I think I figured it out!
First I download rand off of GitHub and move it from A to B and then in Cargo.toml I do the following:
[dependencies]
rand = { path = “path/to/rand/GitHub/download” }
This actually will still not work and will cause issues and turns out dependencies have dependencies and thankfully the compiler tells you what is needed so it’s the same process with those other ones except adjustments are needed to be done to the Cargo.toml for the dependency (rand in this example). Finally use cargo run —offline and boom sauce, it works