Trouble during building github project offline

Hello. I try build github project offline and get fail Who know how to fix it [look uploaded listing]):

To be able to build with the --offline flag, Cargo must cache the dependencies while online first. Run cargo fetch when you're online.

In your case the error says that Cargo hasn't cached the atty package yet, so it's unable to build the project without having the dependency.

Your cargo fetch is failing, because the machine is cut off from the network. To fetch the dependencies you have to have network access.


BTW: please don't use screenshots for text. Use ``` blocks and copy-paste it.

2 Likes

So would you full format of command
is it (in the directory of the unpacked project), or not (please put your variant to build project, if my wrong)

cargo build --release --offline

P.S I haven't online pc with linux and rust int is on the offline pc.
By the way I also try copy unpacked dependencies in the directory of the project I try build (as spare directories in mail project) but rust don't see them

The --offline flag will not work on an always-offline machine.

The procedure is:

  1. You must be online
  2. run cargo fetch
  3. You can go offline
  4. cargo build --offline (you can add other flags)

If the machine is never online, then don't use the --offline flag, and instead check out cargo vendor to convert your project to have a local copy of dependencies.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.