Problem/Motivation
I changed mininal.info.yml to use core: 9.x and it installed fine.
found this in #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning where we changed all the core keys in all *.info.yml files to core: ^8
While Drupal
Proposed resolution
Change to check if the core key is equal to \Drupal::CORE_COMPATIBILITY and actually check in #2313917 as version constraint as we are for modules and themes which would allow profile to be compatible with multiple versions of Drupal
Remaining tasks
Do it
Open a follow to determine if profiles should be able to declare compatibility with multiple core versions in the same way we are going to allow in #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning
User interface changes
NOne
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3070401-23-9.0.x.patch | 2.45 KB | wim leers |
| #23 | interdiff-d9.txt | 2.12 KB | wim leers |
| #23 | 3070401-23-8.8.x_and_8.9.x.patch | 2.45 KB | wim leers |
| #23 | interdiff-d8.txt | 2.12 KB | wim leers |
| #20 | 3070401-8.8-20.patch | 3.26 KB | alexpott |
Comments
Comment #2
tedbowHere are two patches that prove the problem
\Drupal\FunctionalTests\Installer\DistributionProfileTestto use a nonsense key forcore. This should still pass\Drupal\FunctionalTests\Installer\InstallerTest::testInstallerwill pass which it shouldn't.Comment #3
tedbowTagging this with
Drupal 9and bumping to major because this seems it should be solved before drupal 9.Comment #5
MixologicShould this be postponed on https://www.drupal.org/project/drupal/issues/2313917 first, so that it can expect semver compat strings too.
Comment #6
tedbowchange to mention 9.x instead of 7.x in the summary. since this is the real problem
Comment #7
xjmI think this issue should be fixed in a minor release only; while it's definitely a bug, there's a small risk of breaking an existing profile that's valid other than having the wrong key here. So since that's a small but nonzero potential disruption, we won't backport it to the production branch.
Comment #8
tedbow#5
yes, @Mixologic seems like a good idea to postpone this on #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning
Comment #9
wim leersComment #10
wim leersComment #11
xjmThe blocker has been fixed.
Comment #13
alexpottInterestingly if you apply #3072702: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed and try and install Drupal on 9.0.x using Drush you get "Unable to install modules: module 'minimal' is incompatible with this version of Drupal core."
Note I get the same problem if I try via the UI...
I think maybe profiles need to support the
core_version_requirement: VERSIONtoo.Comment #14
dwwNot sure if this is duplicate with, or blocked by #3087416: Core version key in profile's .info.yml doesn't respect core semantic versioning, but that seems to be the issue to explicitly address @alexpott's concern in #13:
Meanwhile, the patches here are nonsense patches to prove we have a problem, so 'Needs review' isn't accurate.
Given my (limited) understanding of all these issues, seems the simplest path forward is to put this one back on hold, concentrate effort at #3087416: Core version key in profile's .info.yml doesn't respect core semantic versioning, and that'll fix this bug. Re-calling it postponed for now, but maybe duplicate is better.
Cheers,
-Derek
p.s. See also #3087420: [PP-1] Update core's profile info.yml files to the new version compatibility syntax for the follow-up to actually change the core profiles to use the new info key. Not clear to me why we're not planning to include that directly as part of #3087416 but it's there if folks want to keep it separate.
Comment #15
xjmI think this is the issue that describes the original bug we need to solve in all core branches for profiles, so I don't think it makes sense to postpone it.
Comment #16
xjmClearer title; 8.x was just an example in the original title.
Comment #17
mikelutzNear as I can tell, originally, this issue described a bug in how the extension handler checked the 'core' key for profiles, and it seems like due to this bug, they chose not to enable 'core_version_requirement' for profiles. Locally, and from reading the code, The only thing I see that prevents core_version_requirement from working for profiles is the fact that we explictly check for and throw an exception in InfoParserDynamic if we see that key in a profile, but I assume there must be some other problem that it will cause that is why we added that check and exception in the first place.
Comment #18
shaalWhen I tested the possibility to install Drupal 9, I noticed that profiles do not work with
core_version_requirement,I thought 2 new issues were needed - 1 to make a decision if/how to get profiles to support it, and another follow up issue to implement that decision.
Yet somehow I missed this existing issue in the process...
Comment #19
alexpottHere's a patch to enable core_version_requirement for profiles. And it adds the VERSION support seen in #3072702: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed. Both patches are necessary to have an installable Drupal.
Comment #20
alexpottI guess we could only remove the profile restriction here and then set
core_version_requirementeverywhere in 9.0.x and 8.9.x in #3072702: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed. So this patch could be as attached.Comment #23
wim leersYay for addressing the
@todoin the intended issue 🥳I was going to ask why we even want this. Why not set
core_version_requirement: ^8.8in the8.8.xbranch,core_version_requirement: ^8.9in the8.9.xbranch andcore_version_requirement: ^9in the9.0.xbranch?Therein lies the answer: we don't want to update this all the time. Specifying
core_version_requirement: VERSIONinstead and making that magic work is a nicer solution.But … this is a special time. The only reason we need to commit three different values to three different branches is that we're on the verge of making the shift to Drupal 9.
Once
core_version_requirement: ^9is committed to the9.0.xbranch, we won't need to make further changes. I think doing that would be preferable, because it doesn't introduce new magic. We're introducing this magic in an issue that is critical and trying to unbreak Drupal 9's automated testing. I think thecore_version_requirement: VERSIONfeature deserves an issue with a dedicated discussion.Besides, we don't even need to commit
core_version_requirement: ^8.9to the8.9.xbranch — we can commitcore_version_requirement: ^8.8to both the8.8.xand8.9.xbranches, and commitcore_version_requirement: ^9to the9.0.xbranch.Comment #24
wim leers🤓 We still need to rename this from
invalid_profileto justprofile, but that's a nit.We first need to agree about the approach here.
Comment #25
alexpottVERSION is not magic it just keeps us from doing a lot of unnecessary work. See #3072702: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed - also Drupal 10 with happen and we don't want to be always upping this thing.
Comment #26
wim leersI agree with you in the general case, but not for install profiles. The danger with allowing this
VERSIONmagic constant is that all contrib/custom install profiles use that too, which allows them to claim (pretend, really) to be compatible with all Drupal majors ever. That's overshooting our goal here.I do completely agree with you that for extensions in Drupal core, this
VERSIONmagic constant is valuable. But for that I have a simpler counterproposal: #3072702-55: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed — which you already indicated you like :)We'll see where this takes us!
Comment #27
mikelutzComment #28
wim leersThis is being fixed as part of #3072702: Core extensions should not need to specify the new core_version_requirement in *.info.yml files so that 9.0.x can be installed.
Comment #29
alexpottSo going back to how this issue was originally opened i.e. #2. We should consider either re-opening or filing a new issue.
That comment says:
So the tests should that the first part of that is right if you change
coresomething meaningless like:Drupal will continue to install. That's because we have no validation that on that value.
However the second part is wrong with the patch that did
in install profiles you get fails like
Which is exactly as it should be.