-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Set dogfood script working directory #50895
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
base: main
Are you sure you want to change the base?
Conversation
…(Windows) and Home (Linux/Mac).
This PR is targeting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the dogfood script (used for testing the built SDK) would incorrectly resolve to the repo's global.json and use the wrong SDK version when run from the eng folder. The fix changes the working directory to the user's home directory to avoid SDK resolution conflicts.
Key changes:
- Modifies dogfood scripts to change working directory to user home
- Prevents incorrect SDK resolution when scripts are run from their location in the eng folder
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
eng/dogfood.sh | Adds cd command to change to home directory |
eng/dogfood.ps1 | Modifies prompt function to set location to USERPROFILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to do this, can we change the directory to artifacts\tmp\Debug instead? That's where most of the tests are run from and usually when I use the dogfood script it's to investigate / debug a project created by tests.
It seems like we would need an empty global.json in that folder to stop the tests from using the wrong SDK version. It doesn't seem like there is one so I'm not really sure how everything is working now.
@dsplaisted I haven't tested it, but would using |
Yeah I'm confused because I thought we had to put an empty global.json in that folder or the tests wouldn't use the right version of the SDK. |
Great observation, I think that folder makes more sense than the user profile. It will allow us to configure the experience more and reduce risk of breaking changes from devs having some json file in HOME. Note that this folder does disable CPM. |
@nagilson @dsplaisted I've updated the path to ![]() |
This change requires this change: #51020 |
Summary
With the addition of
sdk.paths
to theglobal.json
, the dogfood script (used for testing the built SDK in the repo) if ran from theeng
folder (the location of the script) won't use the correct SDK. What happens is it'll walk up fromeng
and find theglobal.json
. Then it will default to the SDK in the.dotnet
folder, which is downloaded during the build of the SDK itself, instead of the-dev
version:So, what I did to avoid this problem is made the dogfood script change from the current working directory to the UserProfile (Windows) and Home (Linux/Mac). This means that if you run the dogfood script in the folder it is located, you'll no longer resolve to the
global.json
of the repo, and thus no longer use the SDK in the.dotnet
folder: