microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
76e91f14a9d330a29358b45692e7530a3ccae10d

Branches

Tags

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

Clone

HTTPS

Download ZIP

compiler/qsc/build.rs

17lines · 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
6use std::process::Command;
7
8fn main() {
9 let git_hash = Command::new("git")
10 .args(["rev-parse", "--short=8", "HEAD"])
11 .output()
12 .map_or_else(
13 |_| "unknown".to_string(),
14 |o| String::from_utf8(o.stdout).expect("output should be parsable string"),
15 );
16 println!("cargo:rustc-env=QSHARP_GIT_HASH={git_hash}");
17}