Merge remote-tracking branch 'origin/main' into connor4312/cli-self-update

This commit is contained in:
Connor Peet
2022-10-14 14:23:41 -07:00
1157 changed files with 24741 additions and 16508 deletions

View File

@@ -1,7 +1,7 @@
# Setup
0. Clone, and then run `git submodule update --init --recursive`
1. Get the extensions: [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
1. Get the extensions: [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
2. Ensure your workspace is set to the `launcher` folder being the root.
## Building the CLI on Windows

1315
cli/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,7 @@ serde_bytes = "0.11.5"
chrono = { version = "0.4", features = ["serde"] }
gethostname = "0.2.3"
libc = "0.2"
tunnels = { git = "https://github.com/connor4312/dev-tunnels", branch = "host-relay", features = ["connections", "vendored-openssl"] }
tunnels = { git = "https://github.com/microsoft/dev-tunnels", rev = "3870e9133dfb9557774521bb447827f19b26e55d", default-features = false, features = ["connections", "vendored-openssl"] }
keyring = "1.1"
dialoguer = "0.10"
hyper = "0.14"
@@ -56,6 +56,12 @@ windows-service = "0.5"
[target.'cfg(target_os = "linux")'.dependencies]
tar = { version = "0.4" }
[patch.crates-io]
russh = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
russh-cryptovec = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
russh-keys = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
secret-service = { git = "https://github.com/microsoft/vscode-secret-service-rs", rev = "ccef335714cdf3744ff85f812b8fba5b6194dcfa" }
[profile.release]
strip = true
lto = true

View File

@@ -419,7 +419,7 @@ mod tests {
.to_string_lossy()
.to_string();
assert_eq!(
RequestedVersion::try_from((&exe).as_str()).unwrap(),
RequestedVersion::try_from(exe.as_str()).unwrap(),
RequestedVersion::Path(exe),
);
}

View File

@@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize};
use std::sync::{Arc, Mutex};
use std::time::Duration;
use tokio::sync::{mpsc, watch};
use tunnels::connections::{ForwardedPortConnection, HostRelay};
use tunnels::connections::{ForwardedPortConnection, RelayTunnelHost};
use tunnels::contracts::{
Tunnel, TunnelPort, TunnelRelayTunnelEndpoint, PORT_TOKEN, TUNNEL_PROTOCOL_AUTO,
};
@@ -607,7 +607,7 @@ impl DevTunnels {
struct ActiveTunnelManager {
close_tx: Option<mpsc::Sender<()>>,
endpoint_rx: watch::Receiver<Option<Result<TunnelRelayTunnelEndpoint, WrappedError>>>,
relay: Arc<tokio::sync::Mutex<HostRelay>>,
relay: Arc<tokio::sync::Mutex<RelayTunnelHost>>,
}
impl ActiveTunnelManager {
@@ -620,7 +620,7 @@ impl ActiveTunnelManager {
let (endpoint_tx, endpoint_rx) = watch::channel(None);
let (close_tx, close_rx) = mpsc::channel(1);
let relay = Arc::new(tokio::sync::Mutex::new(HostRelay::new(locator, mgmt)));
let relay = Arc::new(tokio::sync::Mutex::new(RelayTunnelHost::new(locator, mgmt)));
let relay_spawned = relay.clone();
tokio::spawn(async move {
@@ -719,7 +719,7 @@ impl ActiveTunnelManager {
async fn spawn_tunnel(
log: log::Logger,
relay: Arc<tokio::sync::Mutex<HostRelay>>,
relay: Arc<tokio::sync::Mutex<RelayTunnelHost>>,
mut close_rx: mpsc::Receiver<()>,
endpoint_tx: watch::Sender<Option<Result<TunnelRelayTunnelEndpoint, WrappedError>>>,
access_token_provider: impl AccessTokenProvider + 'static,

View File

@@ -26,7 +26,7 @@ where
e,
format!(
"failed to execute command '{}'",
(&command_str).as_ref().to_string_lossy()
command_str.as_ref().to_string_lossy()
),
)
})

View File

@@ -19,9 +19,7 @@ where
/// Waits for the barrier to be closed, returning a value if one was sent.
pub async fn wait(&mut self) -> Result<T, RecvError> {
loop {
if let Err(e) = self.0.changed().await {
return Err(e);
}
self.0.changed().await?;
if let Some(v) = *(self.0.borrow()) {
return Ok(v);