Files
greptimedb/src/servers/build.rs
T
shuiyisongandevenyag 0effc30778 chore: update the opendal to 0.56 rc2 (#8003)
* chore: update opendal version

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: update opendal version

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: fix test

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: grpc init

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: dep versions

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: remove aws-lc-rs in reqwest

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: rebase main and fix compile

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: remove unused deps

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* Revert "fix: remove aws-lc-rs in reqwest"

This reverts commit 90bfafca06f877befb36f3e54bb72fcfc4c56778.

* chore: remove aws-lc-sys from blacklist

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: fix sqlness

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: add tls deps

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: idemptent install in rds

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: test

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: use aws-lc-sys as possible

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: lint

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: address comments

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: address CR issue

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: sync opendal compat adapter with upstream

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: address compat clippy warnings

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
Signed-off-by: evenyag <realevenyag@gmail.com>
Co-authored-by: evenyag <realevenyag@gmail.com>
2026-04-26 09:59:48 +00:00

90 lines
2.7 KiB
Rust

// Copyright 2023 Greptime Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
fn main() {
#[cfg(feature = "dashboard")]
fetch_dashboard_assets();
}
#[cfg(feature = "dashboard")]
fn fetch_dashboard_assets() {
use std::path::PathBuf;
use std::process::{Command, Stdio};
let message = "Failed to fetch dashboard assets";
let help = r#"
You can manually execute "fetch-dashboard-assets.sh" to see why,
or it's a network error, just try again or enable/disable some proxy."#;
// It's very unlikely to be failed to get the current dir here, see `current_dir`'s docs.
let mut dir = std::env::current_dir().unwrap();
dir.pop();
dir.pop();
let scripts_dir = dir.join("scripts");
let dashboard_dist = dir.join(PathBuf::from("src/servers/dashboard/dist"));
if dashboard_dist.join("index.html").exists() {
println!("cargo:rerun-if-changed=dashboard/VERSION");
println!("cargo:rerun-if-changed=dashboard/dist");
return;
}
dir = scripts_dir;
let out_dir = std::env::var("OUT_DIR").unwrap();
#[cfg(windows)]
let (program, args) = (
"bash",
[
format!(
"/mnt/{}/fetch-dashboard-assets.sh",
dir.display()
.to_string()
.to_lowercase()
.replace(':', "")
.replace('\\', "/")
),
format!(
"/mnt/{}",
out_dir.to_lowercase().replace(':', "").replace('\\', "/")
),
],
);
#[cfg(not(windows))]
let (program, args) = ("./fetch-dashboard-assets.sh", [out_dir]);
let output = Command::new(program)
.args(args)
.current_dir(dir)
.stdout(Stdio::piped())
.spawn()
.and_then(|p| p.wait_with_output());
match output {
Ok(output) => {
let script_output = String::from_utf8_lossy(&output.stdout);
assert!(
output.status.success(),
"{message}.\n{script_output}\n{help}"
);
}
Err(e) => {
let e = format!("{message}: {e}.\n{help}");
panic!("{}", e);
}
}
println!("cargo:rerun-if-changed=dashboard/VERSION");
}