Skip to content
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

Improve handling of preferences for sandboxes used in Pkg #2920

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Jan 5, 2022

Fixes #2500, when we set up the preferences for test/build we want
to propagate the preferences from either test/LocalPreferences.toml if test/Project.toml exists
or from Project.toml if the old style is being used. We gather the dependencies up and then write
them out to the temp directory.

Similarily for the .pkg/select_artifacts.jl functionality we need to make the current preferences
available so that we can augment the platform we are downloading.

Co-authored-by: @staticfloat

@vchuravy vchuravy added artifacts build sandbox New test/Project.toml testing framework test labels Jan 5, 2022
@vchuravy
Copy link
Member Author

vchuravy commented Jan 5, 2022

52a2b4c depends on JuliaLang/julia@0b7827a

We might be able to backport 78963ef to 1.7

@vchuravy vchuravy added this to the 1.8 milestone Jan 5, 2022
@vchuravy
Copy link
Member Author

vchuravy commented Jan 6, 2022

Depends on JuliaLang/julia#43684

src/Operations.jl Outdated Show resolved Hide resolved
src/Operations.jl Outdated Show resolved Hide resolved
@KristofferC
Copy link
Member

KristofferC commented Jan 6, 2022

I don't really get why this is not just as simple as just not removing existing preferences from the Project file when creating the temp project file and copy an existing LocalPreferences.toml to the temp environment. Is it because the temp Project does not have the same UUID as the original one?

@staticfloat
Copy link
Member

I don't really get why this is not just as simple as just not removing existing preferences from the Project file when creating the temp project file and copy an existing LocalPreferences.toml to the temp environment.

It's because Preferences merge across stacked environments. E.g. if you have MPIBackend = "foo" set in your ~/.julia/environments/v1.X/LocalPreferences.toml, that needs to be reflected in the LocalPreferences.toml you set up in the temp environment as well. The easiest way to do that is to use Base.get_preferences() to flatten everything down into a single Dict, then just write that out as a TOML.

@vchuravy
Copy link
Member Author

Ok this now passes tests :)

@staticfloat
Copy link
Member

IMO this is ready to merge. Any objections?

@vchuravy vchuravy force-pushed the vc/fix_sandbox branch 2 times, most recently from 3680209 to 621a99b Compare February 1, 2022 16:44
@staticfloat staticfloat merged commit e7f1659 into master Feb 9, 2022
@staticfloat staticfloat deleted the vc/fix_sandbox branch February 9, 2022 23:25
@timholy
Copy link
Member

timholy commented Feb 15, 2022

Thanks for fixing this, @staticfloat!

@staticfloat
Copy link
Member

It's not me, it was @vchuravy! He's the one with the patience and panache to push this through, and he deserves all the credit.

@timholy
Copy link
Member

timholy commented Feb 15, 2022

Ahh, fooled by the "merged by" again! (Though I see you did help out.) Thanks @vchuravy!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifacts build sandbox New test/Project.toml testing framework test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pkg.test() drops Preferences
5 participants