Skip to content

Commit db0a709

Browse files
authored
Don't break build when git is missing (#856)
If git is missing, the build script will fail. This changes it so that it uses the string `unknown` instead of the version. This version is currently only used to log a warning if there is a version mismatch between the client and server. We should switch to using only the version number for this soon anyway now that the protocol is more stable.
1 parent 9480135 commit db0a709

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plane-common"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
edition = "2021"
55
description = "Client library and common utilities for the Plane session backend orchestrator."
66
license = "MIT"

common/build.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use std::process::Command;
22

33
fn main() {
4-
let output = Command::new("git")
4+
let git_hash = Command::new("git")
55
.args(["rev-parse", "HEAD"])
66
.output()
7-
.expect("Failed to execute git command");
8-
9-
let git_hash = String::from_utf8_lossy(&output.stdout).trim().to_string();
10-
let git_hash: String = git_hash.chars().take(8).collect();
7+
.map(|output| {
8+
let hash = String::from_utf8_lossy(&output.stdout).trim().to_string();
9+
hash.chars().take(8).collect::<String>()
10+
})
11+
.unwrap_or_else(|_| String::from("unknown"));
1112

1213
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
1314
}

dynamic-proxy/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plane-dynamic-proxy"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
edition = "2021"
55
description = "Dynamic proxy crate for Plane"
66
repository = "https://github.com/jamsocket/plane"

plane/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plane"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
edition = "2021"
55
default-run = "plane"
66
description = "Session backend orchestrator for ambitious browser-based apps."

0 commit comments

Comments
 (0)