microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
alex/pythontelem

Branches

Tags

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

Clone

HTTPS

Download ZIP

compiler/qsc/build.rs

15lines · modecode

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