sway icon indicating copy to clipboard operation
sway copied to clipboard

Forc doesn't automatically try to build in `--offline` mode if there is no active internet connection

Open sezna opened this issue 3 years ago • 4 comments

I was banging out some proper LOC on the airplane, as one does, and I ran the sway test suite. I didn't pass --offline, although, on the airplane, I indeed had no network.

Creating a new `Forc.lock` file
    Cause: Manifest dependencies do not match
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: failed to clone package 'core' from 'http://github.com/FuelLabs/sway-lib-core': failed to resolve address for github.com: nodename nor servname provided, or not known; class=Net (12)', test/src/e2e_vm_tests/harness.rs:69:46

I think we should either:

  1. Automatically try --offline if no network is present
  2. Provide a message instead of a panic, e.g. Unable to connect to Github. Is your computer connected to the internet?

sezna avatar Mar 07 '22 19:03 sezna

Good call @sezna - I've opened #900 which I think we might want to solve first. I might remove "good first issue" as it could be a little more involved than a newcomer might expect.

mitchmindtree avatar Mar 08 '22 01:03 mitchmindtree

#900's almost addressed now in #1686.

Next blocker is #1787.

mitchmindtree avatar Jun 01 '22 03:06 mitchmindtree

Before #1778 has a solution we cannot handle removed dependencies as we wanted with #1686. So I guess that is also a blocker.

kayagokalp avatar Jun 02 '22 07:06 kayagokalp

As https://github.com/FuelLabs/sway/pull/2366 is about to finalize, I am considering tackling this to offer a complete offline support. For detecting the internet connectivity the most straightforward way seems like checking if we can ping a specific website (it can be github or something else) but this also means we are limited by the uptime of the selected target(s).

kayagokalp avatar Sep 23 '22 09:09 kayagokalp