`directives.version` is checked against dsc-lib's crate version (3.2.0), not the running dsc version
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Bắt đầu tại lib/dsc-lib/src/configure/mod.rs quanh L1299-L1301 (validate_config), nơi env!("CARGO_PKG_VERSION") được phân tích, và so sánh với mã siêu dữ liệu tại L1253-L1257 dùng self.context.dsc_version — cách sửa là khiến phép kiểm tra chỉ mục (directive) dùng phiên bản dsc đang chạy thay vì phiên bản của crate. Sau đó mở rộng dsc/tests/dsc_version.tests.ps1, với các trường hợp hiện tại (=999.0.0, >=3.1) đều đạt ở cả hai cách, thêm một trường hợp phân biệt 3.2.0 với phiên bản đang chạy (ví dụ: ghim '='). Xong nghĩa là ghim phiên bản đang chạy thành công và ghim 3.2.0 thất bại trên dsc mới hơn, được xác minh bằng cách chạy bài kiểm tra Pester.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 532
- Fork
- 76
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/DSC
-
Issue-Enhancement Needs Triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PowerShell/DSC#1737 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PowerShell/DSC#1736 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Issue-Enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
PowerShell/DSC#1729 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature Request: Support dsc functions in executable argsCó thể đã có người làm @SteveL-MSFT đã nhận 12 ngày trước. Đang mởIssue-Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
PowerShell/DSC#1722 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Dev-UX Needs Triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PowerShell/DSC#1694 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của PowerShell/DSC
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
tauri-apps/tauri#16219 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ktuner keeps a stale ledger path and can never restore that entryCó thể đã có người làm @Frun1na đã nhận hôm nay. Đang mởcomponent:ktuner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
agentic-os-org/ANOLISA#6483 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày