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

Enforce a global "offline" setting #6252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ehmry
Copy link
Contributor

@ehmry ehmry commented Mar 13, 2022

Do not attempt to fetch anything when the "--offline" flag is
passed on the command line or when "offline" is set to true in
a configuration file.

Copy link
Member

@dtzWill dtzWill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fix for no internet case where --offline isn't set, flipped bool.

src/nix/main.cc Outdated Show resolved Hide resolved
@ehmry
Copy link
Contributor Author

ehmry commented Mar 14, 2022

BTW, I'd like the offline flag/setting to make all caches valid rather than stale to fix #2022, but that can be a seperate PR.

Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments but looks good overall.

There’s also a few places where the cache still can expire in offline mode, I guess that’s what you meant to add as a follow-up in #6252 (comment)

src/libfetchers/fetchers.cc Outdated Show resolved Hide resolved
src/libfetchers/tarball.cc Outdated Show resolved Hide resolved
src/libstore/globals.hh Outdated Show resolved Hide resolved
@stale stale bot added the stale label Oct 29, 2022
@stale stale bot removed the stale label Jun 23, 2023
@Ericson2314 Ericson2314 marked this pull request as draft June 23, 2023 00:34
@Ericson2314
Copy link
Member

Draft because changes requested.

@github-actions github-actions bot added fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command labels Jun 28, 2023
Do not attempt to fetch anything when the "--offline" flag is
passed on the command line or when "offline" is set to true in
a configuration file.
@ehmry ehmry marked this pull request as ready for review June 28, 2023 21:38
@ehmry ehmry requested a review from edolstra as a code owner June 28, 2023 21:38
@thufschmitt thufschmitt self-assigned this Jun 29, 2023
@ehmry
Copy link
Contributor Author

ehmry commented Jul 6, 2023

I­ should point out that I don't see any way to guarantee that an offline flag is being enforced everywhere. I'm probably missing some cases and it would be an iterative process to fully implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants