Skip to content

Commit 185f526

Browse files
authored
Fixes incorrect read/write permissions on Flutter.framework and FlutterMacOS.framework (#148580)
Fixes flutter/flutter#148354 Fixes flutter/flutter#147142 Closes flutter/flutter#147144 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
1 parent b2e5ab2 commit 185f526

6 files changed

Lines changed: 25 additions & 3 deletions

File tree

packages/flutter_tools/lib/src/build_system/targets/ios.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ abstract class UnpackIOS extends Target {
314314
'--delete',
315315
'--filter',
316316
'- .DS_Store/',
317+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
317318
basePath,
318319
environment.outputDir.path,
319320
]);

packages/flutter_tools/lib/src/build_system/targets/macos.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ abstract class UnpackMacOS extends Target {
6060
'--delete',
6161
'--filter',
6262
'- .DS_Store/',
63+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
6364
basePath,
6465
environment.outputDir.path,
6566
]);

packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ void main() {
541541
'--delete',
542542
'--filter',
543543
'- .DS_Store/',
544+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
544545
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.physical',
545546
outputDir.path,
546547
]);
@@ -597,6 +598,7 @@ void main() {
597598
'--delete',
598599
'--filter',
599600
'- .DS_Store/',
601+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
600602
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator',
601603
outputDir.path,
602604
],

packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void main() {
7373
'--delete',
7474
'--filter',
7575
'- .DS_Store/',
76+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
7677
'Artifact.flutterMacOSFramework.debug',
7778
environment.outputDir.path,
7879
],
@@ -133,6 +134,7 @@ void main() {
133134
'--delete',
134135
'--filter',
135136
'- .DS_Store/',
137+
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
136138
// source
137139
'Artifact.flutterMacOSFramework.debug',
138140
// destination

packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,16 @@ void main() {
422422
.whereType<Directory>()
423423
.singleWhere((Directory directory) => fileSystem.path.extension(directory.path) == '.app');
424424

425+
final Directory flutterFrameworkDir = fileSystem.directory(
426+
fileSystem.path.join(
427+
appBundle.path,
428+
'Frameworks',
429+
'Flutter.framework',
430+
),
431+
);
432+
425433
final String flutterFramework = fileSystem.path.join(
426-
appBundle.path,
427-
'Frameworks',
428-
'Flutter.framework',
434+
flutterFrameworkDir.path,
429435
'Flutter',
430436
);
431437

@@ -456,6 +462,11 @@ void main() {
456462
],
457463
);
458464
expect(appCodesign, const ProcessResultMatcher());
465+
466+
// Check read/write permissions are being correctly set
467+
final String rawStatString = flutterFrameworkDir.statSync().modeString();
468+
final String statString = rawStatString.substring(rawStatString.length - 9);
469+
expect(statString, 'rwxr-xr-x');
459470
});
460471
}, skip: !platform.isMacOS, // [intended] only makes sense for macos platform.
461472
timeout: const Timeout(Duration(minutes: 10))

packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ void main() {
164164
),
165165
);
166166

167+
// Check read/write permissions are being correctly set
168+
final String rawStatString = outputFlutterFramework.statSync().modeString();
169+
final String statString = rawStatString.substring(rawStatString.length - 9);
170+
expect(statString, 'rwxr-xr-x');
171+
167172
// Check complicated macOS framework symlink structure.
168173
final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');
169174

0 commit comments

Comments
 (0)