Skip to content

Commit 01fbf4f

Browse files
authored
Merge pull request #1382 from benesch/materialized-build
materialized: avoid build script
2 parents b64c33f + 8ec395d commit 01fbf4f

File tree

4 files changed

+30
-68
lines changed

4 files changed

+30
-68
lines changed

Cargo.lock

Lines changed: 24 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/materialized/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ path = "bin/materialized.rs"
1616
[dependencies]
1717
backtrace = { version = "0.3.40", features = ["coresymbolication"] }
1818
comm = { path = "../comm" }
19+
compile-time-run = "0.2.8"
1920
coord = { path = "../coord" }
2021
dataflow = { path = "../dataflow" }
2122
dataflow-types = { path = "../dataflow-types" }
@@ -40,7 +41,3 @@ itertools = "0.8.2"
4041
postgres = { version = "0.17", features = ["with-chrono-0_4"] }
4142
pretty_assertions = "0.6.1"
4243
tokio-postgres = { version = "0.5", features = ["with-chrono-0_4"] }
43-
44-
[build-dependencies]
45-
chrono = "0.4"
46-
duct = "0.13.3"

src/materialized/build.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/materialized/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::sync::Arc;
1919
use std::thread;
2020
use std::time::{Duration, Instant};
2121

22+
use compile_time_run::run_command_str;
2223
use failure::format_err;
2324
use futures::channel::mpsc::{self, UnboundedSender};
2425
use futures::future::TryFutureExt;
@@ -42,10 +43,11 @@ mod http;
4243
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
4344

4445
/// The SHA identifying the Git commit at which the crate was built.
45-
pub const BUILD_SHA: &str = env!("MZ_GIT_SHA");
46+
pub const BUILD_SHA: &str = run_command_str!("git", "rev-parse", "--verify", "HEAD");
4647

47-
/// When this materialized binary was built
48-
pub const BUILD_TIME: &str = env!("MZ_BUILD_TIME");
48+
/// The time in UTC at which the crate was built as an ISO 8601-compliant
49+
/// string.
50+
pub const BUILD_TIME: &str = run_command_str!("date", "-u", "+%Y-%m-%dT%H:%M:%SZ");
4951

5052
/// Returns a human-readable version string.
5153
pub fn version() -> String {

0 commit comments

Comments
 (0)