Fix empty RPM dependency versions#20891
Open
NikolaMilosavljevic wants to merge 1 commit into
Open
Conversation
RPM dependency version tokens referenced MSBuild properties that were never defined (MicrosoftNETCoreAppRuntimeMajorMinorPatchVersion, MicrosoftNETCoreAppRefMajorMinorPatchVersion, AspNetCoreRuntimeMajorMinorPatchVersion, AspNetCoreRefMajorMinorPatchVersion), so generated RPMs had empty dependency versions and failed to install on some machines. Wire up the missing MajorMinorPatchVersion outputs in the shared LinuxNativeInstallerDependencyVersions.targets (also fixing a copy/paste bug where AspNetCoreMajorMinorPatchVersion was assigned the 2-part MajorMinorVersion) and point GenerateRPMs.targets at the correctly-named properties. The DEB path already worked because it consumes the WithTilde outputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes SDK RPM generation producing dependencies with empty package_version fields by ensuring the RPM token replacement properties are actually defined and correctly named in the shared Linux dependency-version calculation target.
Changes:
- Exposes missing
*MajorMinorPatchVersionoutputs for the NETCore targeting pack and ASP.NET targeting pack inLinuxNativeInstallerDependencyVersions.targets. - Fixes a copy/paste mistake where
AspNetCoreMajorMinorPatchVersionwas incorrectly populated fromMajorMinorVersion. - Updates
GenerateRPMs.targetstoken replacements to reference the now-correct, defined MSBuild properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/redist/targets/LinuxNativeInstallerDependencyVersions.targets | Adds/repairs MSBuild outputs for MajorMinorPatchVersion so RPM dependency versions are produced correctly. |
| src/redist/targets/GenerateRPMs.targets | Points RPM config token replacements at the correct properties (avoids empty dependency versions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The SDK RPM package was generated with empty dependency versions. In src/redist/targets/packaging/rpm/dotnet-config.json, each
rpm_dependenciesentry has apackage_versiontoken thatGenerateRPMs.targetssubstitutes using four MSBuild properties:MicrosoftNETCoreAppRuntimeMajorMinorPatchVersionMicrosoftNETCoreAppRefMajorMinorPatchVersionAspNetCoreRuntimeMajorMinorPatchVersionAspNetCoreRefMajorMinorPatchVersionNone of these properties were ever defined (dangling since at least 2019), so the produced RPM had empty dependency versions, causing install failures on some machines.
The DEB path was unaffected because it consumes the
*WithTildeoutputs that are computed in the sharedLinuxNativeInstallerDependencyVersions.targets.Fix
MajorMinorPatchVersionoutputs in the sharedLinuxNativeInstallerDependencyVersions.targetsfor the NETCore/ASP.NET targeting packs, and fix a copy/paste bug whereAspNetCoreMajorMinorPatchVersionwas assigned the 2-partMajorMinorVersioninstead of the 3-partMajorMinorPatchVersion.GenerateRPMs.targetsat the correctly-named, now-defined properties.Reuses the existing shared infrastructure rather than duplicating it; no impact on DEB/PKG paths.