If I'm riding the bus and not connected to the internet, or just want to toggle in < 0.1s rather than ~10s, it would be lovely to be able to switch between the add and dev versions of a package without also updating the registry.
Sorry if this is a duplicate, but I did search.
In general, it would be nice to be smarter about not being connected and do as well as we can offline under such circumstance. Is there a programmatic way of knowing that you're not connected to any networks? Even if it's per-operating-system?
I don't know and am not the right person to ask, but for windows there is https://stackoverflow.com/questions/15778404/programmatically-check-whether-my-machine-has-internet-access-or-not.
We could just make a registry update non-fatal? I think that would just be catching the Net error for libgit and returning early.
It should be non-fatal... But it still takes a bit of time.
As a workaround, there is Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true.
Similar, but slightly different scenario: I'm on the bus, and I have internet but via WWAN (i.e. slow and expensive), it would also be nice if it didn't trigger network trips.
Last night I lost internet connection and couldn't work since most package functions would error trying to get online to update a dependency. Nice to know about the workaround for now.
...if only you could look it up again once you've lost your internet connection...
We could start by introducing Pkg.network(::Bool) which will initially just set Pkg.UPDATED_REGISTRY_THIS_SESSION[]? This would give us something to document, so that you can still find it with pkg> ? when offline. It would also give us a point to iterate from.
Instead of trying to figure out if there is internet access or not we can just have an offline mode, similar to https://www.ncameron.org/blog/cargo-offline/
have an offline mode
We have this now.
Most helpful comment
Instead of trying to figure out if there is internet access or not we can just have an offline mode, similar to https://www.ncameron.org/blog/cargo-offline/