Skip to content

Conversation

@AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Sep 4, 2025

Changelog: Fix: Fix compatibility.py migration overwrite when no changes were necessary.
Docs: Omit

Closes #18879 to ease pains like the reported one, even though Conan still needs write permissions to its home folder, as it will try to update the versions.txt file nevertheless

@AbrilRBS AbrilRBS added this to the 2.22.0 milestone Sep 4, 2025
if _should_migrate_file(compatibility_file) and _should_migrate_file(cppstd_compat_file):
if os.path.exists(compatibility_file) and load(compatibility_file) != _default_compat:
if _is_migratable(compatibility_file) and _is_migratable(cppstd_compat_file):
if not os.path.exists(compatibility_file) or load(compatibility_file) != _default_compat:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and indenting the save are the fixed logic - we want to overwrite the compatibility file only when it does not exist, or when it exsists (but it's guarded by the Conan comment, else we would not be here), and its contents are different. See the first added test for that case

@AbrilRBS AbrilRBS modified the milestones: 2.22.0, 2.21.0 Sep 5, 2025
@memsharded memsharded merged commit 01086d2 into conan-io:develop2 Sep 9, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission denied: 'C:\\ProgramData\\.conan2\\extensions\\plugins\\compatibility\\compatibility.py'

2 participants