`directives.version` is checked against dsc-lib's crate version (3.2.0), not the running dsc version
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 74/100
Rechercherichtung
Beginne bei lib/dsc-lib/src/configure/mod.rs um L1299-L1301 (validate_config), wo env!("CARGO_PKG_VERSION") geparst wird, und vergleiche mit dem Metadaten-Code bei L1253-L1257, der self.context.dsc_version verwendet – die Korrektur besteht darin, dass die Directive-Prüfung die laufende dsc-Version statt der Crate-Version verwendet. Erweitere dann dsc/tests/dsc_version.tests.ps1, dessen aktuelle Fälle (=999.0.0, >=3.1) in beiden Fällen bestehen, um einen Fall, der 3.2.0 von der laufenden Version unterscheidet (z. B. Pin '='). Fertig bedeutet, dass das Pinnen der laufenden Version erfolgreich ist und das Pinnen von 3.2.0 auf einem neueren dsc fehlschlägt, verifiziert durch Ausführen des Pester-Tests.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Summary
directives.version always compares against 3.2.0, whatever dsc build is running. On dsc 3.3.0, pinning '=3.3.0' fails and pinning '=3.2.0' passes. 3.4.0-preview.1 behaves the same way.
In practice you can't require anything newer than 3.2.0 with the directive, and an upper bound such as '<3.3.0' is accepted by 3.3.0 and 3.4.0-preview.1.
The check in validate_config parses env!("CARGO_PKG_VERSION"), and inside dsc-lib that resolves to dsc-lib's own version (mod.rs L1299-L1301 at v3.3.0). lib/dsc-lib/Cargo.toml is still 3.2.0 on main, while dsc/Cargo.toml is 3.4.0-preview.1. The metadata code in the same file uses self.context.dsc_version (L1253-L1257), so the directive check could probably use that as well. The existing tests in dsc/tests/dsc_version.tests.ps1 use =999.0.0 and >=3.1, and both give the same result with 3.2.0 or 3.3.0, so they don't catch this.
Steps to reproduce
-
Save this as
repro.dsc.config.yaml:$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json directives: version: '=3.3.0' resources: - name: os type: Microsoft/OSInfo properties: {} -
Run it with dsc 3.3.0:
dsc --version dsc config test --file ./repro.dsc.config.yaml -
Change the directive to
'=3.2.0'and rundsc config testagain.
Expected behavior
PS> dsc --version
dsc 3.3.0
# version: '=3.3.0'
exit code 0, test results for the OSInfo instance
# version: '=3.2.0'
ERROR Error: Validation: Configuration requires DSC version '=3.2.0', but the current version is '3.3.0'
exit code 2
Actual behavior
PS> dsc --version
dsc 3.3.0
# version: '=3.3.0'
ERROR Error: Validation: Configuration requires DSC version '=3.3.0', but the current version is '3.2.0'
exit code 2
# version: '=3.2.0'
exit code 0, and the output reports executionInformation.version: 3.3.0
Same document, other requirements:
directives.version |
dsc 3.3.0 | dsc 3.4.0-preview.1 |
|---|---|---|
=<running version> |
exit 2 | exit 2 |
=3.2.0 |
exit 0 | exit 0 |
<3.3.0 |
exit 0 | exit 0 |
>=3.3.0 |
exit 2 | not run |
Error details
2026-10-04T10:25:47.660394Z ERROR Error: Validation: Configuration requires DSC version '=3.3.0', but the current version is '3.2.0'
Environment data
Name Value
---- -----
PSVersion 5.1.26100.9444
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.9444
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Windows 11 Pro for Workstations 25H2, build 26200. dsc 3.3.0 installed from the release msixbundle; 3.4.0-preview.1 run from the release zip.
Version
3.3.0 (also reproduced on 3.4.0-preview.1)
Visuals
No response
- Vorherrschende Sprache
- Rust
- Sterne
- 536
- Forks
- 76
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 15
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/DSC
-
"apt install dsc" will install the preview release instead of stableEvtl. vergeben @SteveL-MSFT hat das heute übernommen. OffenIssue-Bug Need-Review
PowerShell/DSC#1746 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Issue-Enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PowerShell/DSC#1737 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PowerShell/DSC#1736 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Make it impossible to accidentally define a nonfunctional secret extensionEvtl. vergeben @Gijsreyn hat das vor 1 Tag übernommen. OffenIssue-Enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
PowerShell/DSC#1729 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Feature Request: Support dsc functions in executable argsEvtl. vergeben @SteveL-MSFT hat das vor 14 Tagen übernommen. OffenIssue-Enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 62/100
PowerShell/DSC#1722 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
pact-foundation/pact-cli#154 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
antithesishq/bombadil#361 ·
Maintainer antworten meist innerhalb von 1 Tag
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcomeOffentype:debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
skaiy/wild_agentos#425 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Default-import note suggests `import * as process` for velt:process, which does not name the builtinOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug ticket
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
cratestack/cratestack#1154 ·
Maintainer antworten meist innerhalb von 1 Tag