Skip to content

Commit 4c3347b

Browse files
authored
Build from Azure Pipelines (#147)
1 parent 12f5cb1 commit 4c3347b

File tree

10 files changed

+186
-5
lines changed

10 files changed

+186
-5
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[profile.release]
6-
strip = true
6+
# Enable all optimizations
7+
opt-level = 3
8+
# Enable full link-time-optimizations
79
lto = true
810
codegen-units = 1
911
# Enable full debug info for optimized builds.

azure-pipelines/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pre-release.yml: This should build from the `main` branch and publish to the Azure Pipeline feed. This will be consumed by extensions that are also doing pre-release builds. Signing is required on this build.
2+
3+
stable.yml: This should build from the `release/*` branch and publish to the Azure Pipeline feed. This will be consumed by extensions when publishing stable builds. Signing is required on this build.
4+
5+
playground.yml: This pipeline is for engineering/testing purposes so we can do fixes and tests without affecting the pipeline feeds. This will not publish to the Azure Pipeline feed. Signing is not required on this build.

azure-pipelines/playground.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
trigger: none
2+
pr: none
3+
# Should only ever be manually run.
4+
5+
resources:
6+
repositories:
7+
- repository: templates
8+
type: github
9+
name: microsoft/vscode-engineering
10+
ref: main
11+
endpoint: Monaco
12+
13+
extends:
14+
template: azure-pipelines/rust-package/pipeline.yml@templates
15+
parameters:
16+
ghCreateTag: false
17+
binaryName: "pet"
18+
signing: false
19+
buildWasm: false
20+
apiScanSoftwareVersion: 2024 # major version of `pet` for internal reporting
21+
22+
buildPlatforms:
23+
- name: Linux
24+
vsceTarget: "web"
25+
- name: Linux
26+
packageArch: arm64
27+
vsceTarget: linux-arm64
28+
- name: Linux
29+
packageArch: arm
30+
vsceTarget: linux-armhf
31+
- name: Linux
32+
packageArch: x64
33+
vsceTarget: linux-x64
34+
- name: Linux
35+
packageArch: arm64
36+
vsceTarget: alpine-arm64
37+
- name: Linux
38+
packageArch: x64
39+
vsceTarget: alpine-x64
40+
- name: MacOS
41+
packageArch: arm64
42+
vsceTarget: darwin-arm64
43+
- name: MacOS
44+
packageArch: x64
45+
vsceTarget: darwin-x64
46+
- name: Windows
47+
packageArch: arm
48+
vsceTarget: win32-arm64
49+
- name: Windows
50+
packageArch: x64
51+
vsceTarget: win32-x64
52+
53+
preBuildSteps:
54+
- pwsh: Rename-Item -Path "./.cargo/config.toml.disabled" -NewName "config.toml"
55+
displayName: "Enable Azure Build config for Rust"

azure-pipelines/pre-release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Run on a schedule
2+
trigger: none
3+
pr: none
4+
5+
schedules:
6+
- cron: "0 10 * * 1-5" # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT)
7+
displayName: Nightly Pre-Release Schedule
8+
always: false # only run if there are source code changes
9+
branches:
10+
include:
11+
- main
12+
13+
resources:
14+
repositories:
15+
- repository: templates
16+
type: github
17+
name: microsoft/vscode-engineering
18+
ref: main
19+
endpoint: Monaco
20+
21+
extends:
22+
template: azure-pipelines/rust-package/pipeline.yml@templates
23+
parameters:
24+
ghCreateTag: false
25+
binaryName: "pet"
26+
signing: true
27+
buildWasm: false
28+
apiScanSoftwareVersion: 2024 # major version of `pet` for internal reporting
29+
30+
buildPlatforms:
31+
- name: Linux
32+
vsceTarget: "web"
33+
- name: Linux
34+
packageArch: arm64
35+
vsceTarget: linux-arm64
36+
- name: Linux
37+
packageArch: arm
38+
vsceTarget: linux-armhf
39+
- name: Linux
40+
packageArch: x64
41+
vsceTarget: linux-x64
42+
- name: Linux
43+
packageArch: arm64
44+
vsceTarget: alpine-arm64
45+
- name: Linux
46+
packageArch: x64
47+
vsceTarget: alpine-x64
48+
- name: MacOS
49+
packageArch: arm64
50+
vsceTarget: darwin-arm64
51+
- name: MacOS
52+
packageArch: x64
53+
vsceTarget: darwin-x64
54+
- name: Windows
55+
packageArch: arm
56+
vsceTarget: win32-arm64
57+
- name: Windows
58+
packageArch: x64
59+
vsceTarget: win32-x64
60+
61+
preBuildSteps:
62+
- pwsh: Rename-Item -Path "./.cargo/config.toml.disabled" -NewName "config.toml"
63+
displayName: "Enable Azure Build config for Rust"

azure-pipelines/stable.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
trigger: none
2+
pr: none
3+
# Should only ever be manually run.
4+
5+
resources:
6+
repositories:
7+
- repository: templates
8+
type: github
9+
name: microsoft/vscode-engineering
10+
ref: main
11+
endpoint: Monaco
12+
13+
extends:
14+
template: azure-pipelines/rust-package/pipeline.yml@templates
15+
parameters:
16+
ghCreateTag: false
17+
binaryName: "pet"
18+
signing: true
19+
buildWasm: false
20+
apiScanSoftwareVersion: 2024 # major version of `pet` for internal reporting
21+
22+
buildPlatforms:
23+
- name: Linux
24+
vsceTarget: "web"
25+
- name: Linux
26+
packageArch: arm64
27+
vsceTarget: linux-arm64
28+
- name: Linux
29+
packageArch: arm
30+
vsceTarget: linux-armhf
31+
- name: Linux
32+
packageArch: x64
33+
vsceTarget: linux-x64
34+
- name: Linux
35+
packageArch: arm64
36+
vsceTarget: alpine-arm64
37+
- name: Linux
38+
packageArch: x64
39+
vsceTarget: alpine-x64
40+
- name: MacOS
41+
packageArch: arm64
42+
vsceTarget: darwin-arm64
43+
- name: MacOS
44+
packageArch: x64
45+
vsceTarget: darwin-x64
46+
- name: Windows
47+
packageArch: arm
48+
vsceTarget: win32-arm64
49+
- name: Windows
50+
packageArch: x64
51+
vsceTarget: win32-x64
52+
53+
preBuildSteps:
54+
- pwsh: Rename-Item -Path "./.cargo/config.toml.disabled" -NewName "config.toml"
55+
displayName: "Enable Azure Build config for Rust"

crates/pet-core/src/os_environment.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ impl Environment for EnvironmentApi {
5050
if self.global_search_locations.lock().unwrap().is_empty() {
5151
let mut paths =
5252
env::split_paths(&self.get_env_var("PATH".to_string()).unwrap_or_default())
53-
.into_iter()
5453
.filter(|p| p.exists())
5554
.collect::<Vec<PathBuf>>();
5655
trace!("Env PATH: {:?}", paths);

crates/pet-windows-registry/src/environments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn get_registry_pythons_from_key_for_company(
101101
Ok(install_path_key) => {
102102
let env_path: String =
103103
install_path_key.get_value("").ok().unwrap_or_default();
104-
let env_path = norm_case(&PathBuf::from(env_path));
104+
let env_path = norm_case(PathBuf::from(env_path));
105105
if is_windows_app_folder_in_program_files(&env_path) {
106106
trace!(
107107
"Found Python ({}) in {}\\Software\\Python\\{}\\{}, but skipping as this is a Windows Store Python",
@@ -144,7 +144,7 @@ fn get_registry_pythons_from_key_for_company(
144144
);
145145
continue;
146146
}
147-
let executable = norm_case(&PathBuf::from(executable));
147+
let executable = norm_case(PathBuf::from(executable));
148148
if !executable.exists() {
149149
warn!(
150150
"Python executable ({}) file not found for {}\\Software\\Python\\{}\\{}",

crates/pet-windows-store/src/environments.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ lazy_static! {
3232
}
3333

3434
#[derive(Default)]
35+
#[allow(dead_code)]
3536
struct PotentialPython {
3637
#[allow(dead_code)]
3738
path: Option<PathBuf>,

crates/pet-windows-store/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Locator for WindowsStore {
7474
}
7575
let list_of_possible_exes = vec![env.executable.clone()]
7676
.into_iter()
77-
.chain(env.symlinks.clone().unwrap_or_default().into_iter())
77+
.chain(env.symlinks.clone().unwrap_or_default())
7878
.collect::<Vec<PathBuf>>();
7979
if let Some(environments) = self.find_with_cache() {
8080
for found_env in environments {

crates/pet/src/locators.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ fn find_symlinks(executable: &PathBuf) -> Option<Vec<PathBuf>> {
200200
}
201201

202202
#[cfg(windows)]
203+
#[allow(clippy::ptr_arg)]
203204
fn find_symlinks(_executable: &PathBuf) -> Option<Vec<PathBuf>> {
204205
// In windows we will need to spawn the Python exe and then get the exes.
205206
// Lets wait and see if this is necessary.

0 commit comments

Comments
 (0)