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

config.environ: delay export of A and AA (bug 720180) #552

Conversation

zmedico
Copy link
Member

@zmedico zmedico commented May 26, 2020

Since variables like A and AA can contain extremely large values which
may trigger E2BIG errors during attempts to execute subprocesses, delay
export until the last moment, and unexport when appropriate.

Bug: https://bugs.gentoo.org/720180
Signed-off-by: Zac Medico [email protected]

@zmedico zmedico force-pushed the bug_720180_config_environ_delay_export_of_A_and_AA branch from 4cc531d to 69d3616 Compare May 26, 2020 04:31
Since variables like A and AA can contain extremely large values which
may trigger E2BIG errors during attempts to execute subprocesses, delay
export until the last moment, and unexport when appropriate.

Bug: https://bugs.gentoo.org/720180
Signed-off-by: Zac Medico <[email protected]>
@zmedico zmedico force-pushed the bug_720180_config_environ_delay_export_of_A_and_AA branch from 69d3616 to d275ba1 Compare November 23, 2021 00:12
@Flowdalic
Copy link
Member

Thanks for your work on this (and https://bugs.gentoo.org/833567 " [Future EAPI] src_fetch_extra phase the runs after src_unpack"). I really appreciate that.

However, I wonder if it would not be better to have future EAPIs export a variable pointing to a file that contains a list the archives instead. Such a file could be trivially be converted to a non-exported variable via bash's mapfile and then consumed by unpacker in the traditional fashion. See my example at https://bugs.gentoo.org/721088#c16.

I am also not sure how the changes of this PR are supposed to help. Sorry for my ignorance. But the issue that the environment is potentially too large to spawn a process could already happen once portage fork+execs ebuild.sh. Therefore, unexporting A in ebuild.sh is too late. But maybe I am missing something? For newbies like me, portage's code isn't easy to understand.

@zmedico
Copy link
Member Author

zmedico commented Mar 26, 2024

I am also not sure how the changes of this PR are supposed to help. Sorry for my ignorance. But the issue that the environment is potentially too large to spawn a process could already happen once portage fork+execs ebuild.sh. Therefore, unexporting A in ebuild.sh is too late. But maybe I am missing something? For newbies like me, portage's code isn't easy to understand.

The vars are written to a file so they can be sourced after exec. I'll close this PR though since it was more of a POC and I like your idea to use explicit files for this.

@zmedico zmedico closed this Mar 26, 2024
@Flowdalic
Copy link
Member

I like your idea to use explicit files for this.

Glad that you like it. Posted a first PoC at #1357

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.

2 participants