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

fix back migration of default compatibility.py #16405

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Jun 5, 2024

Changelog: Fix: Implement a back migration to <2.3 for default compatibility.py plugin.
Docs: Omit

@memsharded memsharded added this to the 2.4.0 milestone Jun 5, 2024
@czoido czoido merged commit 5b5015e into conan-io:release/2.4 Jun 5, 2024
2 checks passed
@memsharded memsharded deleted the fix/back_migration_cstd branch June 5, 2024 14:13
@craigscott-crascit
Copy link

I don't think this is working as expected. We started seeing the error below in cases where we do some things with Conan 2.4.0, then switch to 2.2.1 and do some more things (the error is from the part after downgrading the conan cache from 2.4.0 to 2.2.1):

  ======== Computing necessary packages ========
ERROR: Unable to load conanfile in /<redacted>/.conan2/extensions/plugins/compatibility/compatibility.py
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/<redacted>/.conan2/extensions/plugins/compatibility/compatibility.py", line 3, in <module>
    from cppstd_compat import cppstd_compat
  File "/<redacted>/.conan2/extensions/plugins/compatibility/cppstd_compat.py", line 3, in <module>
    from conan.tools.build import supported_cppstd, supported_cstd
ImportError: cannot import name 'supported_cstd' from 'conan.tools.build' (/<redacted>/lib/python3.10/site-packages/conan/tools/build/__init__.py)

@memsharded
Copy link
Member Author

That is indeed unexpected, thanks for reporting.

Could you please try to reproduce and share the traces after the downgrade? Conan should show information about the back-migration.

Any detail about and do some more things? Maybe there is another concurrent installation using the same cache?

We have tested down to Conan 2.0.17 and it seemed to work, I don't think the specific 2.2.1 version should be related.

@craigscott-crascit
Copy link

Could you please try to reproduce and share the traces after the downgrade? Conan should show information about the back-migration.

Any detail about and do some more things? Maybe there is another concurrent installation using the same cache?

I'm unlikely to be able to share traces due to confidentiality reasons, and no access to the CI system where these were seen. The project involved also had to put in a hot fix to block updating to 2.4.0, so I can't re-run it either.

The scenario was a CI job that used tox to create controlled environments and switch between them. I don't recall the exact order of things, but the last two steps were running in a tox environment with conan 2.4.0, then the last step in a tox environment with conan 2.2.1. It's possible that one or both used custom locations for the local conan cache. I think the conan commands were just the usual conan install ... type of thing. Sorry I can't be more specific, but it looks like @czoido may have found the underlying problem anyway, judging by #16417.

@memsharded
Copy link
Member Author

Thanks for the feedback @craigscott-crascit

Yes, we have identified the possible issue: The back-migrations were designed as activated when there was a forward migration first, but not unconditionally. So mostly installing a fresh 2.4 in a new machine and downgrading it to 2.3 later was not possible, it was only enabled for users that first upgraded from 2.3 or lower to 2.4, and then decided to downgrade.

The PR #16417 is doing that, activating the back migrations uncondtionally. It is planned for next patch release 2.4.1, most likely next Monday or Tuesday.

Thanks very much again for the report, and sorry for the inconvenience.

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.

3 participants