`directives.version` is checked against dsc-lib's crate version (3.2.0), not the running dsc version
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず lib/dsc-lib/src/configure/mod.rs の L1299-L1301 (validate_config) 付近で env!("CARGO_PKG_VERSION") がパースされている箇所を確認し、L1253-L1257 の self.context.dsc_version を使うメタデータ用コードと比較してください — 修正は、ディレクティブのチェックでクレートのバージョンではなく実行中の dsc バージョンを使うようにすることです。次に、現在のケース (=999.0.0, >=3.1) はどちらでも通過してしまう dsc/tests/dsc_version.tests.ps1 を、実行中のバージョンと 3.2.0 を区別できるケース(例: '=' をピンする)で拡張してください。完了の条件は、実行中のバージョンをピンすると成功し、新しい dsc で 3.2.0 をピンすると失敗することであり、Pester テストを実行して検証します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Rust
- スター
- 532
- フォーク
- 76
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 15
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/DSC のほかの issue
-
Issue-Enhancement Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
PowerShell/DSC#1737 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
PowerShell/DSC#1736 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
PowerShell/DSC#1729 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Feature Request: Support dsc functions in executable args対応中かも @SteveL-MSFT が 12 日前に担当しました。 オープンIssue-Enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
PowerShell/DSC#1722 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Dev-UX Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
PowerShell/DSC#1694 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 5 日以内に返信
-
state:triage-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
ktuner keeps a stale ledger path and can never restore that entry対応中かも @Frun1na が今日担当しました。 オープンcomponent:ktuner
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
agentic-os-org/ANOLISA#6483 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Resource]: snapbackオープンresource-submission validation-passed
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
hesreallyhim/awesome-claude-code#3095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信