microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.2.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

compiler/qsc/build.rs

18lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#![warn(clippy::mod_module_files, clippy::pedantic, clippy::unwrap_used)]
5#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
6
7use std::process::Command;
8
9fn main() {
10 let git_hash = Command::new("git")
11 .args(["rev-parse", "--short=8", "HEAD"])
12 .output()
13 .map_or_else(
14 |_| "unknown".to_string(),
15 |o| String::from_utf8(o.stdout).expect("output should be parsable string"),
16 );
17 println!("cargo:rustc-env=QSHARP_GIT_HASH={git_hash}");
18}
19