@@ -434,7 +434,6 @@ class NativeAssetsBuildRunner {
434
434
null ,
435
435
hookKernelFile,
436
436
packageLayout! ,
437
- _filteredEnvironment (_environmentVariablesFilter),
438
437
),
439
438
);
440
439
if (buildOutput == null ) return null ;
@@ -490,7 +489,6 @@ class NativeAssetsBuildRunner {
490
489
final environmentFile = File .fromUri (
491
490
config.outputDirectory.resolve ('../environment.json' ),
492
491
);
493
- final environment = _filteredEnvironment (_environmentVariablesFilter);
494
492
if (buildOutputFile.existsSync () &&
495
493
dependenciesHashFile.existsSync () &&
496
494
environmentFile.existsSync ()) {
@@ -514,7 +512,7 @@ ${e.message}
514
512
! const MapEquality <String , String >().equals (
515
513
(json.decode (await environmentFile.readAsString ()) as Map )
516
514
.cast <String , String >(),
517
- environment);
515
+ Platform . environment);
518
516
if (! dependenciesOutdated && ! environmentChanged) {
519
517
logger.info (
520
518
[
@@ -537,15 +535,14 @@ ${e.message}
537
535
resources,
538
536
hookKernelFile,
539
537
packageLayout,
540
- environment,
541
538
);
542
539
if (result == null ) {
543
540
if (await dependenciesHashFile.exists ()) {
544
541
await dependenciesHashFile.delete ();
545
542
}
546
543
} else {
547
544
await environmentFile.writeAsString (
548
- json.encode (environment),
545
+ json.encode (Platform . environment),
549
546
);
550
547
final modifiedDuringBuild = await dependenciesHashes.hashFiles (
551
548
[
@@ -564,18 +561,6 @@ ${e.message}
564
561
);
565
562
}
566
563
567
- /// Limit the environment that hook invocations get to see.
568
- ///
569
- /// This allowlist lists environment variables needed to run mainstream
570
- /// compilers.
571
- static const _environmentVariablesFilter = {
572
- 'ANDROID_HOME' ,
573
- 'PATH' ,
574
- 'SYSTEMROOT' ,
575
- 'TEMP' ,
576
- 'TMP' ,
577
- };
578
-
579
564
Future <HookOutput ?> _runHookForPackage (
580
565
Hook hook,
581
566
HookConfig config,
@@ -585,7 +570,6 @@ ${e.message}
585
570
Uri ? resources,
586
571
File hookKernelFile,
587
572
PackageLayout packageLayout,
588
- Map <String , String > environment,
589
573
) async {
590
574
final configFile = config.outputDirectory.resolve ('../config.json' );
591
575
final configFileContents =
@@ -610,8 +594,6 @@ ${e.message}
610
594
executable: dartExecutable,
611
595
arguments: arguments,
612
596
logger: logger,
613
- includeParentEnvironment: false ,
614
- environment: environment,
615
597
);
616
598
617
599
var deleteOutputIfExists = false ;
@@ -668,12 +650,6 @@ ${e.message}
668
650
}
669
651
}
670
652
671
- Map <String , String > _filteredEnvironment (Set <String > allowList) => {
672
- for (final entry in Platform .environment.entries)
673
- if (allowList.contains (entry.key.toUpperCase ()))
674
- entry.key: entry.value,
675
- };
676
-
677
653
/// Compiles the hook to kernel and caches the kernel.
678
654
///
679
655
/// If any of the Dart source files, or the package config changed after
@@ -776,8 +752,6 @@ ${e.message}
776
752
executable: dartExecutable,
777
753
arguments: compileArguments,
778
754
logger: logger,
779
- includeParentEnvironment: false ,
780
- environment: _filteredEnvironment ({'HOME' , 'PUB_CACHE' }),
781
755
);
782
756
var success = true ;
783
757
if (compileResult.exitCode != 0 ) {
0 commit comments