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

move try_sig_mask to separate file to avoid always loading POSIX #1023

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

haarg
Copy link
Member

@haarg haarg commented Jan 22, 2025

POSIX is an extra module to load which many test scripts don't need themselves. Test2::Util was loading it for the try_sig_mask function, but this is only used in one place for the IPC mechanism. If the script isn't loading Test2::IPC or running with threads, it is not needed.

Move the try_sig_mask function to a separate module, and use the new module in Test2::IPC::Driver::Files. For backwards compatibility, maintain a try_sig_mask function in Test2::Util, but have it load and call the function in the new module. A new module is used rather than just delay loading POSIX, because for something involving threads or forks, loading at process start is preferrable.

POSIX is an extra module to load which many test scripts don't need
themselves. Test2::Util was loading it for the try_sig_mask function,
but this is only used in one place for the IPC mechanism. If the script
isn't loading Test2::IPC or running with threads, it is not needed.

Move the try_sig_mask function to a separate module, and use the new
module in Test2::IPC::Driver::Files. For backwards compatibility,
maintain a try_sig_mask function in Test2::Util, but have it load and
call the function in the new module. A new module is used rather than
just delay loading POSIX, because for something involving threads or
forks, loading at process start is preferrable.
@haarg haarg force-pushed the seperate-sig-util branch from 6ff343d to 11754ec Compare January 22, 2025 07:59
@exodist exodist merged commit bd55b87 into Test-More:master Jan 22, 2025
19 checks passed
@haarg haarg deleted the seperate-sig-util branch January 22, 2025 16:20
exodist added a commit that referenced this pull request Jan 22, 2025
    - #1021 don't use base (Thanks Haarg)
    - #1022 use PerlIO::get_layers without loading PerlIO.pm (Thanks Haarg)
    - #1023 move try_sig_mask to separate file to avoid always loading POSIX (Thanks Haarg)
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