Created attachment 918886 [details] Related discussion in #gentoo-qa Current EAPIs declare EBUILD_PHASE (since EAPI 0) and EBUILD_PHASE_FUNC (since EAPI 5). Both variables are very similar; their only difference is that EBUILD_PHASE contains the "non-namespaced" phase function name, whereas EBUILD_PHASE_FUNC contains the "namespaced" version: | EBUILD_PHASE | EBUILD_PHASE_FUNC | |--------------+-------------------| | config | pkg_config | | setup | pkg_setup | | nofetch | pkg_nofetch | | unpack | src_unpack | | prepare | src_prepare | | configure | src_configure | | compile | src_compile | | test | src_test | | install | src_install | | preinst | pkg_preinst | | postinst | pkg_postinst | | prerm | pkg_prerm | | postrm | pkg_postrm | | info | pkg_info | | pretend | pkg_pretend | The existence of two variables has the potential to confuse ebuild authors. When should EBUILD_PHASE be used, and when EBUILD_PHASE_FUNC? Therefore, future EAPIs should no longer export one of those variables. Keeping EBUILD_PHASE_FUNC and dropping EBUILD_PHASE allows us to introduce phase functions like pkg_test (bug #402581), which would be ambiguous in EBUILD_PHASE.
As I said in the IRC discussion, I see little incentive for removal of these variables. Probably we wouldn't have added EBUILD_PHASE_FUNC if we had known in advance that 13 years later it was used by only 7 packages. Then again, supporting both is trivial, and removal would just add additional complexity to both the spec and package managers (with less complexity when removing EBUILD_PHASE_FUNC because we already have an EAPI conditional for it). Another option would be to label one of them as deprecated in the documentation but keep them both in the spec (similar as we did for useq and hasq, which were later removed for a different reason).
Thinking about it, these variable names are somewhat irregular because functions and variables that contain the string "ebuild" (ignoring case) are reserved for package manager use by section 12.3.17 of the spec: https://dev.gentoo.org/~ulm/pms/head/pms.html#section-12.3.17 Apparently these two are the only exceptions: https://devmanual.gentoo.org/ebuild-writing/variables/index.html#variables-reserved-for-the-package-manager So if we would decide to touch this, then maybe we should seize the opportunity and drop _both_ variables. We could then introduce a new one with a more regular name like PHASE_FUNCTION.