Skip to content

Please honour CARGO_NET_OFFLINE for implicit installs #4289

Open
@ijackson

Description

@ijackson

Steps

  1. Don't have +nightly-2023-12-19 installed
  2. In any project, CARGO_NET_OFFLINE=true cargo +nightly-2023-12-19 check --locked --offline

Expected behaviour

Error message saying +nightly-2023-12-19 is not installed, mentioning CARGO_NET_OFFLINE

Actual behaviour

Starts to download the requested toolchain.

Discussion

CARGO_NET_OFFLINE is a way that cargo has provided for some time now to allow disabling network access. This can be very useful in a number of circumstances.

A user might set this because:

  • The network is unavailable or very slow and they don't want to wait for it to time out
  • The network is very expensive, or rationed, so they need to control downloads
  • They want to prevent downloads for security or software-supply-chain reasons

See also #4264. I'm hoping that honouring CARGO_NET_OFFLINE will be uncontroversial, and won't be blocked on those wider discussions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions