Skip to content

Commit 4b9e0ae

Browse files
authored
Merge pull request #1476 from SteveL-MSFT/3.2-rc.1
Backport fixes to 3.2-rc.1
2 parents 5ef68a5 + e1bacf8 commit 4b9e0ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+629
-533
lines changed

.vscode/schemas/definitions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"Kind": { "$ref": "#/$defs/ProjectKind" },
2424
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
2525
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
26+
"RustPackageName": { "$ref": "#/$defs/ProjectRustPackageName" },
2627
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
2728
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
2829
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
@@ -70,6 +71,7 @@
7071
"Kind": { "$ref": "#/$defs/ProjectKind" },
7172
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
7273
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
74+
"RustPackageName": { "$ref": "#/$defs/ProjectRustPackageName" },
7375
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
7476
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
7577
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
@@ -190,6 +192,11 @@
190192
"title": "Is Rust Crate",
191193
"markdownDescription": "Indicates whether the project is a Rust crate."
192194
},
195+
"ProjectRustPackageName": {
196+
"type": "string",
197+
"title": "Rust package name",
198+
"markdownDescription": "Defines the name of the rust project for the `-p` option on cargo commands."
199+
},
193200
"ProjectTestOnly": {
194201
"type": "boolean",
195202
"default": false,

Cargo.lock

Lines changed: 15 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ tempfile = { version = "3.27" }
223223
# dsc, dsc-lib, registry, dsc-lib-registry, sshdconfig
224224
thiserror = { version = "2.0" }
225225
# dsc, dsc-lib, dsc-bicep-ext
226-
tokio = { version = "1.50" }
226+
tokio = { version = "1.51" }
227227
# dsc-bicep-ext
228228
tokio-stream = { version = "0.1" }
229229
# dsc

build.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ process {
200200
Install-Clippy -UseCFS:$UseCFS -Architecture $Architecture @VerboseParam
201201
}
202202

203+
if (!$SkipBuild -and !$SkipLinkCheck -and $IsWindows) {
204+
Write-BuildProgress @progressParams -Status "Ensuring Windows C++ build tools are available"
205+
Install-WindowsCPlusPlusBuildTools @VerboseParam
206+
}
207+
203208
if (-not ($SkipBuild -and $Test -and $ExcludeRustTests)) {
204209
Write-BuildProgress @progressParams -Status 'Ensuring Protobuf is available'
205210
Install-Protobuf @VerboseParam
@@ -212,10 +217,6 @@ process {
212217
}
213218
}
214219

215-
if (!$SkipBuild -and !$SkipLinkCheck -and $IsWindows) {
216-
Write-BuildProgress @progressParams -Status "Ensuring Windows C++ build tools are available"
217-
Install-WindowsCPlusPlusBuildTools @VerboseParam
218-
}
219220
#endregion Setup
220221

221222
if (!$SkipBuild) {

dsc-bicep-ext/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl BicepExtension for BicepExtensionService {
213213
resource: Some(proto::Resource {
214214
r#type: resource_type,
215215
api_version: version,
216-
identifiers: identifiers,
216+
identifiers,
217217
properties: result.actual_state.to_string(),
218218
status: None,
219219
}),
@@ -270,7 +270,7 @@ impl BicepExtension for BicepExtensionService {
270270
resource: Some(proto::Resource {
271271
r#type: resource_type,
272272
api_version: version,
273-
identifiers: identifiers,
273+
identifiers,
274274
properties: "{}".to_string(),
275275
status: None,
276276
}),
@@ -367,9 +367,7 @@ async fn run_server(
367367
impl Connected for NamedPipeConnection {
368368
type ConnectInfo = ();
369369

370-
fn connect_info(&self) -> Self::ConnectInfo {
371-
()
372-
}
370+
fn connect_info(&self) -> Self::ConnectInfo {}
373371
}
374372

375373
impl AsyncRead for NamedPipeConnection {

dsc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dsc"
3-
version = "3.2.0-preview.14"
3+
version = "3.2.0-rc.1"
44
edition = "2024"
55

66
[dependencies]

dsc/src/resource_command.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub fn get(dsc: &mut DscManager, resource_type: &FullyQualifiedTypeName, version
3434

3535
match resource.get(input) {
3636
Ok(result) => {
37-
if let GetResult::Resource(response) = &result {
38-
if format == Some(&GetOutputFormat::PassThrough) {
37+
if let GetResult::Resource(response) = &result
38+
&& format == Some(&GetOutputFormat::PassThrough) {
3939
let json = match serde_json::to_string(&response.actual_state) {
4040
Ok(json) => json,
4141
Err(err) => {
@@ -46,7 +46,6 @@ pub fn get(dsc: &mut DscManager, resource_type: &FullyQualifiedTypeName, version
4646
write_object(&json, Some(&OutputFormat::Json), false);
4747
return;
4848
}
49-
}
5049

5150
// convert to json
5251
let json = match serde_json::to_string(&result) {

dsc/src/subcommand.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte
322322

323323
configurator.context.dsc_version = Some(env!("CARGO_PKG_VERSION").to_string());
324324

325-
if let ConfigSubCommand::Set { what_if , .. } = subcommand {
326-
if *what_if {
327-
configurator.context.execution_type = ExecutionKind::WhatIf;
328-
}
325+
if let ConfigSubCommand::Set { what_if , .. } = subcommand && *what_if {
326+
configurator.context.execution_type = ExecutionKind::WhatIf;
329327
}
330328

331329
let parameters: Option<serde_json::Value> = match if new_parameters.is_some() {
@@ -499,7 +497,7 @@ pub fn validate_config(config: &Configuration, progress_format: ProgressFormat)
499497
let type_name = &FullyQualifiedTypeName::parse(type_name)?;
500498
let require_version = resource_block["requireVersion"]
501499
.as_str()
502-
.map(|r| ResourceVersionReq::parse(r))
500+
.map(ResourceVersionReq::parse)
503501
.transpose()?;
504502
resource_types.push(DiscoveryFilter::new(type_name, require_version, None));
505503
}
@@ -512,7 +510,7 @@ pub fn validate_config(config: &Configuration, progress_format: ProgressFormat)
512510
let type_name = &FullyQualifiedTypeName::parse(type_name)?;
513511
let require_version = resource_block["requireVersion"]
514512
.as_str()
515-
.map(|r| ResourceVersionReq::parse(r))
513+
.map(ResourceVersionReq::parse)
516514
.transpose()?;
517515

518516
trace!("{} '{}'", t!("subcommand.validatingResource"), resource_block["name"].as_str().unwrap_or_default());

dsc/src/util.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -350,18 +350,16 @@ pub fn enable_tracing(trace_level_arg: Option<&TraceLevel>, trace_format_arg: Op
350350
}
351351

352352
// override with DSC_TRACE_LEVEL env var if permitted
353-
if tracing_setting.allow_override {
354-
if let Ok(level) = env::var(DSC_TRACE_LEVEL) {
355-
tracing_setting.level = match level.to_ascii_uppercase().as_str() {
356-
"ERROR" => TraceLevel::Error,
357-
"WARN" => TraceLevel::Warn,
358-
"INFO" => TraceLevel::Info,
359-
"DEBUG" => TraceLevel::Debug,
360-
"TRACE" => TraceLevel::Trace,
361-
_ => {
362-
warn!("{}: '{level}'", t!("util.invalidTraceLevel"));
363-
TraceLevel::Warn
364-
}
353+
if tracing_setting.allow_override && let Ok(level) = env::var(DSC_TRACE_LEVEL) {
354+
tracing_setting.level = match level.to_ascii_uppercase().as_str() {
355+
"ERROR" => TraceLevel::Error,
356+
"WARN" => TraceLevel::Warn,
357+
"INFO" => TraceLevel::Info,
358+
"DEBUG" => TraceLevel::Debug,
359+
"TRACE" => TraceLevel::Trace,
360+
_ => {
361+
warn!("{}: '{level}'", t!("util.invalidTraceLevel"));
362+
TraceLevel::Warn
365363
}
366364
}
367365
}

0 commit comments

Comments
 (0)