-
Notifications
You must be signed in to change notification settings - Fork 847
Extract logic and hardcoded values about compiler's TFM into a single source of truth #19251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
T-Gro
wants to merge
28
commits into
main
Choose a base branch
from
extract-tfm-logic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+173
−95
Conversation
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
- Create eng/productTfm.txt as single source of truth for product TFM (net10.0) - Update Directory.Build.props to read TFM from file and derive major version - Update FSharpBuild.Directory.Build.targets to emit fsProductTfm and fsProductTfmMajorVersion constants in generated buildproperties.fs
…mework) in MSBuild files - Update UseLocalCompiler.Directory.Build.props to use TFM property - Add TFM property reading to buildtools/checkpackages/Directory.Build.props - Update checkpackages fsproj files to use the property Part of TFM centralization effort - Sprint 2
- eng/Build.ps1: Read TFM from productTfm.txt for coreclrTargetFramework, bootstrapTfm, and fsharpNetCoreProductTfm variables - eng/build.sh: Read TFM using cat and tr -d to strip whitespace - eng/build-utils.ps1: Read TFM from productTfm.txt for fsharpNetCoreProductTfm This removes hardcoded 'net10.0' from these script files, enabling centralized TFM management through eng/productTfm.txt.
- eng/Build.ps1: Read TFM from productTfm.txt for coreclrTargetFramework, bootstrapTfm, and fsharpNetCoreProductTfm variables - eng/build.sh: Read TFM using cat and tr -d to strip whitespace - eng/build-utils.ps1: Read TFM from productTfm.txt for fsharpNetCoreProductTfm This removes hardcoded 'net10.0' from these script files, enabling centralized TFM management through eng/productTfm.txt.
Replace hardcoded TFM list in toolingCompatibleVersions with dynamically
computed list based on FSharp.BuildProperties.fsProductTfmMajorVersion.
- Generate net{N}.0 from major version down to 5
- Append legacy netcoreapp/netstandard versions
- List automatically updates when eng/productTfm.txt changes
Replace hardcoded TFM list in toolingCompatibleVersions with dynamically
computed list based on FSharp.BuildProperties.fsProductTfmMajorVersion.
- Generate net{N}.0 from major version down to 5
- Append legacy netcoreapp/netstandard versions
- List automatically updates when eng/productTfm.txt changes
- TestFramework.fs: Add productTfm that reads from eng/productTfm.txt - TestFramework.fs: Update dotnetArchitecture to use productTfm - CompilerAssert.fs: Use TestFramework.productTfm in runtimeconfig generation - ProjectGeneration.fs: Use TestFramework.productTfm in fsproj template - Utilities.fs: Use TestFramework.productTfm for target framework
- TestFramework.fs: Add productTfm that reads from eng/productTfm.txt - TestFramework.fs: Update dotnetArchitecture to use productTfm - CompilerAssert.fs: Use TestFramework.productTfm in runtimeconfig generation - ProjectGeneration.fs: Use TestFramework.productTfm in fsproj template - Utilities.fs: Use TestFramework.productTfm for target framework
- Update tests/fsharp/single-test.fs to use productTfm (3 occurrences) - Update DependencyManagerInteractiveTests.fs to use TestFramework.productTfm (18 occurrences) - Both test projects build successfully with 0 errors - Remaining net10.0 in tests/ are only in utility scripts, MSBuild config, and comments
- Update tests/fsharp/single-test.fs to use productTfm (3 occurrences) - Update DependencyManagerInteractiveTests.fs to use TestFramework.productTfm (18 occurrences) - Both test projects build successfully with 0 errors - Remaining net10.0 in tests/ are only in utility scripts, MSBuild config, and comments
- tests/ILVerify/ilverify.ps1: Use $default_tfm instead of hardcoded net10.0 - EndToEndBuildTests fsproj files: Use $(FSharpNetCoreProductDefaultTargetFramework) - BasicProvider/*.fsproj - ComboProvider/*.fsproj - DesignTimeProviderPackaging/*.fsproj
- tests/ILVerify/ilverify.ps1: Use $default_tfm instead of hardcoded net10.0 - EndToEndBuildTests fsproj files: Use $(FSharpNetCoreProductDefaultTargetFramework) - BasicProvider/*.fsproj - ComboProvider/*.fsproj - DesignTimeProviderPackaging/*.fsproj
- TestBasicProvider.cmd: Read TFM from productTfm.txt - TestComboProvider.cmd: Read TFM from productTfm.txt - Equality.fsproj: Use $(FSharpNetCoreProductDefaultTargetFramework) - FSharpMetadataResource_Trimming_Test.fsproj: Use MSBuild property - SelfContained_Trimming_Test.fsproj: Use MSBuild property - StaticLinkedFSharpCore_Trimming_Test.fsproj: Use MSBuild property - FSharpCoreVersionTest.props: Read TFM from productTfm.txt - identifierAnalysisByType.fsx: Document as dev utility (F# scripts require hardcoded path) All functional test code now uses centralized TFM source.
- TestBasicProvider.cmd: Read TFM from productTfm.txt - TestComboProvider.cmd: Read TFM from productTfm.txt - Equality.fsproj: Use $(FSharpNetCoreProductDefaultTargetFramework) - FSharpMetadataResource_Trimming_Test.fsproj: Use MSBuild property - SelfContained_Trimming_Test.fsproj: Use MSBuild property - StaticLinkedFSharpCore_Trimming_Test.fsproj: Use MSBuild property - FSharpCoreVersionTest.props: Read TFM from productTfm.txt - identifierAnalysisByType.fsx: Document as dev utility (F# scripts require hardcoded path) All functional test code now uses centralized TFM source.
- Add eng/productTfm.txt as single source of truth for product TFM - Update Directory.Build.props to read TFM from file - Update FSharpBuild.Directory.Build.targets to generate F# constants - Update UseLocalCompiler.Directory.Build.props to use TFM property - Update buildtools/checkpackages to use TFM property - Update eng/Build.ps1, eng/build.sh, eng/build-utils.ps1, eng/test-determinism.ps1 - Update eng/templates/regression-test-jobs.yml - Update CompilerLocation.fs to use generated constants - Update TestFramework.fs with productTfm constant - Update test files to use centralized TFM - Add release notes
- Add eng/productTfm.txt as single source of truth for product TFM - Update Directory.Build.props to read TFM from file - Update FSharpBuild.Directory.Build.targets to generate F# constants - Update UseLocalCompiler.Directory.Build.props to use TFM property - Update buildtools/checkpackages to use TFM property - Update eng/Build.ps1, eng/build.sh, eng/build-utils.ps1, eng/test-determinism.ps1 - Update eng/templates/regression-test-jobs.yml - Update CompilerLocation.fs to use generated constants - Update TestFramework.fs with productTfm constant - Update test files to use centralized TFM - Add release notes
…into extract-tfm-logic
- Add eng/productTfm.txt as single source of truth for product TFM (net10.0) - Expose via MSBuild: $(FSharpNetCoreProductDefaultTargetFramework), $(FSharpNetCoreProductMajorVersion) - Expose via F# build properties: fsProductTfm, fsProductTfmMajorVersion - Expose via test framework: TestFramework.productTfm - Update build scripts (bash/powershell) to read TFM dynamically - Update test projects to use centralized TFM value - Update ILVerify to read product TFM from eng/productTfm.txt
…into extract-tfm-logic
Contributor
❗ Release notes required
|
- Exclude fsProductTfm and fsProductTfmMajorVersion from FSharp.Core's buildproperties.fs since the 'int' type isn't defined yet during FSharp.Core compilation (bootstrapping issue) - Fix array yield syntax in CompilerLocation.fs to use yield! for combining arrays instead of yield with semicolon-separated values
…ProductDefaultTargetFramework
… artifact The UseLocalCompiler.Directory.Build.props now reads FSharpNetCoreProductDefaultTargetFramework from productTfm.txt. For regression tests, this file needs to be co-located with the props file. Changes: - UseLocalCompiler.Directory.Build.props: Add logic to read productTfm.txt from either co-located path (regression tests) or eng/ subdirectory (local usage) - azure-pipelines-PR.yml: Stage both UseLocalCompiler.Directory.Build.props and eng/productTfm.txt together before publishing as UseLocalCompilerProps artifact This fixes MSB4057 errors in FSharpPlus regression tests where the target '_GetRestoreSettingsPerFramework' was not found due to undefined TFM property.
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.
No description provided.