Skip to content

Commit 434eb45

Browse files
committed
use Darwin::InitObjC
1 parent c49b88e commit 434eb45

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

META.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"CPAN::Meta::Requirements" : "2.130",
4242
"CPAN::Meta::YAML" : "0",
4343
"Command::Runner" : "0.100",
44+
"Darwin::InitObjC" : "0",
4445
"ExtUtils::Install" : "2.20",
4546
"ExtUtils::InstallPaths" : "0.002",
4647
"File::Copy::Recursive" : "0",
@@ -179,8 +180,8 @@
179180
"Will Sheppard <[email protected]>",
180181
"yoshikazusawa <[email protected]>"
181182
],
182-
"x_generated_by_perl" : "v5.40.0",
183-
"x_serialization_backend" : "Cpanel::JSON::XS version 4.38",
183+
"x_generated_by_perl" : "v5.40.1",
184+
"x_serialization_backend" : "Cpanel::JSON::XS version 4.39",
184185
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later",
185186
"x_static_install" : 1
186187
}

author/copyrights-and-licenses.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
"name" : "Command-Runner",
6060
"url" : "https://metacpan.org/dist/Command-Runner"
6161
},
62+
{
63+
"copyright" : "Shoichi Kaji",
64+
"license" : "the same as Perl 5",
65+
"name" : "Darwin-InitObjC",
66+
"url" : "https://metacpan.org/dist/Darwin-InitObjC"
67+
},
6268
{
6369
"copyright" : "Yuval Kogman",
6470
"license" : "the same as Perl 5",

dist.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'CPAN::Meta::Requirements' => '2.130',
2222
'CPAN::Meta::YAML' => '0',
2323
'Command::Runner' => '0.100',
24+
'Darwin::InitObjC' => '0',
2425
'ExtUtils::Install' => '2.20',
2526
'ExtUtils::InstallPaths' => '0.002',
2627
'File::Copy::Recursive' => '0',

lib/App/cpm/CLI.pm

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use CPAN::Meta;
2020
use Command::Runner;
2121
use Config;
2222
use Cwd ();
23+
use Darwin::InitObjC;
2324
use File::Copy ();
2425
use File::Path ();
2526
use File::Spec;
@@ -365,18 +366,7 @@ sub cmd_install {
365366
sub install {
366367
my ($self, $master, $worker, $num) = @_;
367368

368-
if ($num > 1
369-
&& $^O eq "darwin"
370-
&& ($^X eq "/usr/bin/perl" || $^X eq "perl")
371-
&& !exists $ENV{OBJC_DISABLE_INITIALIZE_FORK_SAFETY}
372-
&& !$self->{_darwin_fixed}
373-
) {
374-
my $lib = "/System/Library/Frameworks/Foundation.framework/Foundation";
375-
$master->{logger}->log("dlopen $lib to initialize Objective-C APIs before fork(2)");
376-
require DynaLoader;
377-
DynaLoader::dl_load_file $lib;
378-
$self->{_darwin_fixed} = 1;
379-
}
369+
Darwin::InitObjC::maybe_init();
380370

381371
my @task = $master->get_task;
382372
Parallel::Pipes::App->run(

0 commit comments

Comments
 (0)