-
Notifications
You must be signed in to change notification settings - Fork 257
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
Do not export PMS variables in EAPI 9 #1407
Open
Flowdalic
wants to merge
1
commit into
gentoo:master
Choose a base branch
from
Flowdalic:pass-env-via-file-dont-export-pms-vars
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Do not export PMS variables in EAPI 9 #1407
Flowdalic
wants to merge
1
commit into
gentoo:master
from
Flowdalic:pass-env-via-file-dont-export-pms-vars
+128
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
from
December 30, 2024 15:44
13610de
to
6753aea
Compare
Flowdalic
changed the title
WIP: Do not export PMS variables in EAPI 9
Do not export PMS variables in EAPI 9
Dec 30, 2024
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
5 times, most recently
from
December 30, 2024 18:40
879a6fb
to
67106ed
Compare
zmedico
reviewed
Dec 30, 2024
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
2 times, most recently
from
December 31, 2024 09:20
4ba182a
to
a8e44e3
Compare
Flowdalic
commented
Dec 31, 2024
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
from
January 1, 2025 14:24
a8e44e3
to
834f78c
Compare
Flowdalic
added a commit
to Flowdalic/gentoo
that referenced
this pull request
Jan 1, 2025
Once a future EAPI does no longer export PMS variables (bug #721088 and [1]), we need to explicitly ensure that those are exported to helper commands which expect certain PMS variables in their process environment. While the portage ebuild is usually deliberately not using the latest EAPI, it may be a good idea to make it explicit that the _compat_upgrade helpers expect ED in their process environment. 1: gentoo/portage#1407 Signed-off-by: Florian Schmaus <[email protected]>
gentoo-bot
pushed a commit
to gentoo/gentoo
that referenced
this pull request
Jan 1, 2025
Once a future EAPI does no longer export PMS variables (bug #721088 and [1]), we need to explicitly ensure that those are exported to helper commands which expect certain PMS variables in their process environment. While the portage ebuild is usually deliberately not using the latest EAPI, it may be a good idea to make it explicit that the _compat_upgrade helpers expect ED in their process environment. 1: gentoo/portage#1407 Signed-off-by: Florian Schmaus <[email protected]> Closes: #39934 Signed-off-by: Sam James <[email protected]>
zmedico
approved these changes
Jan 2, 2025
zmedico
reviewed
Jan 5, 2025
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
2 times, most recently
from
January 7, 2025 13:19
bed117b
to
7ef309a
Compare
zmedico
reviewed
Jan 7, 2025
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
5 times, most recently
from
January 8, 2025 18:37
5562b8e
to
ba9955e
Compare
Flowdalic
commented
Jan 8, 2025
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
4 times, most recently
from
January 9, 2025 10:18
c3264d6
to
b4201dd
Compare
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
2 times, most recently
from
January 9, 2025 12:32
7e3bcb2
to
6e5e977
Compare
Instead of passing PMS variables as part of the process environment, we pass them via a file that is later sourced by the ebuild's bash. Since, for example, A is usually the greatest contributor to the process environment, removing it from the process environment significantly avoids running into MAX_ARG_STRLEN when spawning a new child process. This means that A and other PMS variables are no longer exported in the ebuild and hence unavaiable to child processes. However, A is mostly used as part of the default_src_unpack function and there A does not need to be exported. This started as a change that only unexported A, but was later extended to most PMS variables as suggested by ulm in https://bugs.gentoo.org/721088#c23. Thanks to Zac Medico for helpful input on this change, and to Eli Schwartz for suggesting that (bash) helpers should simply source the environment file introduced by this change. Closes: https://bugs.gentoo.org/721088 Signed-off-by: Florian Schmaus <[email protected]>
Flowdalic
force-pushed
the
pass-env-via-file-dont-export-pms-vars
branch
from
January 9, 2025 12:35
6e5e977
to
4f097cd
Compare
zmedico
reviewed
Jan 9, 2025
# exists if we are processing a phase that is in | ||
# _phase_func_map. But better safe than sorry. | ||
if mysettings.get("EBUILD_PHASE") in _phase_func_map.keys() and os.path.isdir( | ||
t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably make this just mysettings.get("EBUILD_PHASE") != "depend"
.
zmedico
reviewed
Jan 9, 2025
@@ -8,6 +8,15 @@ if ___eapi_has_version_functions; then | |||
source "${PORTAGE_BIN_PATH}/eapi7-ver-funcs.sh" || exit 1 | |||
fi | |||
|
|||
if [[ -v PORTAGE_EBUILD_EXTRA_SOURCE ]]; then | |||
source "${PORTAGE_EBUILD_EXTRA_SOURCE}" || exit 1 | |||
# We delierbately do not unset PORTABE_EBUILD_EXTRA_SOURCE, so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/delierbately/deliberately/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of passing PMS variables as part of the process environment, we pass them via a file that is later sourced by the ebuild's bash.
Since, for example, A is usually the greatest contributor to the process environment, removing it from the process environment significantly avoids running into MAX_ARG_STRLEN when spawning a new child process.
This means that A and other PMS variables are no longer exported in the ebuild and hence unavaiable to child processes. However, A is mostly used as part of the default_src_unpack function and there A does not need to be exported.
This started as a change that only unexported A, but was later extended to most PMS variables as suggested by ulm in https://bugs.gentoo.org/721088#c23.
Thanks to Zac Medico for helpful input on this change.
Closes: https://bugs.gentoo.org/721088