Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Fix how test find the ref pack to compile test cases against - #2610

Merged
vitek-karas merged 1 commit into
dotnet:mainfrom
vitek-karas:FixRefPackSearch
Feb 15, 2022
Merged

vitek-karas merged 1 commit into
dotnet:mainfrom
vitek-karas:FixRefPackSearch

Conversation

@vitek-karas

Copy link
Copy Markdown
Member

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.
@vitek-karas

Copy link
Copy Markdown
Member Author

Without this fix it's tedious to run tests on Windows. It requires using the .\eng\dotnet.ps1 test ... command to force the usage of the repo-local SDK/runtime (which is 6.0.0 so doesn't have this problem). Running tests from VS would require a custom environment to force VS to use the repo-local runtime as well.

@vitek-karas
vitek-karas requested a review from tlakollo February 15, 2022 14:48
@vitek-karas

Copy link
Copy Markdown
Member Author

I'm going to merge this to unblock local development. Please leave any feedback you might have and I'll fix it in a subsequent PR.

@vitek-karas
vitek-karas merged commit 76ffc18 into dotnet:main Feb 15, 2022
@vitek-karas
vitek-karas deleted the FixRefPackSearch branch February 15, 2022 14:49
vitek-karas added a commit to vitek-karas/linker that referenced this pull request Feb 15, 2022
…2610)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.
vitek-karas added a commit that referenced this pull request Feb 15, 2022
…2611)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

Co-authored-by: Vitek Karas <[email protected]>
@marek-safar

Copy link
Copy Markdown
Contributor

This is surprising. Are you sure the ref pack can lag and is it only at the minor version?

@vitek-karas

Copy link
Copy Markdown
Member Author

I don't see a reason why they would need to be in sync. If the runtime ships a patch for functionality, but no impact on public API, then there's no reason to release a new ref pack. I coded it for patch version only because that feels very safe (the public API surface should barely change in patch releases, and it's good enough for our tests). Technically it could be made for both minor and patch, but then there's higher risk of discrepancies in the API surfaces.

@tlakollo

Copy link
Copy Markdown
Contributor

@jtschuster was having trouble with this, we though it was a bad install or similar. Thanks for fixing it! Changes look good to me :D

@marek-safar

Copy link
Copy Markdown
Contributor

I don't see a reason why they would need to be in sync.

In theory yes but there is usually some ref pack change as well like dotnet/runtime#62859

@vitek-karas

Copy link
Copy Markdown
Member Author

I'm trying to ask some other people about this - apparently it happened to me and Jakson through VS update, but it didn't happen to Andy who installed it manually - so there's something fishy.

I still think it's a good idea to keep this code in the linker as it makes the tests robust to these kind of changes - and I don't see anything wrong with it in the first place.

@MichalStrehovsky

Copy link
Copy Markdown
Member

Other people are running into this too: dotnet/installer#13237

@vitek-karas

Copy link
Copy Markdown
Member Author

Thanks @MichalStrehovsky for the link - my problem is kind of the opposite (I'm missing the new ref pack, but have the old one), but I guess it's the same underlying problem.

vitek-karas added a commit that referenced this pull request Feb 16, 2022
* Fix how test find the ref pack to compile test cases against (#2610)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

* Specify SDK version in global.json (#2592)

Co-authored-by: Vitek Karas <[email protected]>
Co-authored-by: Sven Boemer <[email protected]>
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…linker#2610)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

Commit migrated from dotnet/linker@76ffc18
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…linker#2610) (dotnet/linker#2611)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

Co-authored-by: Vitek Karas <[email protected]>

Commit migrated from dotnet/linker@a8783ba
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* Fix how test find the ref pack to compile test cases against (dotnet/linker#2610)

With latest VS we get a 6.0.2 runtime but only 6.0.1 ref pack. The tests so far expected to use the exact same version, but there's no hard rule that it will be the case.

Change the algorithm to search for highest available major.minor.* ref pack if the matching one doesn't exist.

* Specify SDK version in global.json (dotnet/linker#2592)

Co-authored-by: Vitek Karas <[email protected]>
Co-authored-by: Sven Boemer <[email protected]>

Commit migrated from dotnet/linker@f7e921c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants