Fixes incorrect read/write permissions on Flutter.framework and FlutterMacOS.framework (#148580)
Fixes https://github.com/flutter/flutter/issues/148354 Fixes https://github.com/flutter/flutter/issues/147142 Closes https://github.com/flutter/flutter/pull/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.
This commit is contained in:
@@ -314,6 +314,7 @@ abstract class UnpackIOS extends Target {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
basePath,
|
||||
environment.outputDir.path,
|
||||
]);
|
||||
|
||||
@@ -60,6 +60,7 @@ abstract class UnpackMacOS extends Target {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
basePath,
|
||||
environment.outputDir.path,
|
||||
]);
|
||||
|
||||
@@ -541,6 +541,7 @@ void main() {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.physical',
|
||||
outputDir.path,
|
||||
]);
|
||||
@@ -597,6 +598,7 @@ void main() {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator',
|
||||
outputDir.path,
|
||||
],
|
||||
|
||||
@@ -73,6 +73,7 @@ void main() {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
'Artifact.flutterMacOSFramework.debug',
|
||||
environment.outputDir.path,
|
||||
],
|
||||
@@ -133,6 +134,7 @@ void main() {
|
||||
'--delete',
|
||||
'--filter',
|
||||
'- .DS_Store/',
|
||||
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
|
||||
// source
|
||||
'Artifact.flutterMacOSFramework.debug',
|
||||
// destination
|
||||
|
||||
@@ -422,10 +422,16 @@ void main() {
|
||||
.whereType<Directory>()
|
||||
.singleWhere((Directory directory) => fileSystem.path.extension(directory.path) == '.app');
|
||||
|
||||
final Directory flutterFrameworkDir = fileSystem.directory(
|
||||
fileSystem.path.join(
|
||||
appBundle.path,
|
||||
'Frameworks',
|
||||
'Flutter.framework',
|
||||
),
|
||||
);
|
||||
|
||||
final String flutterFramework = fileSystem.path.join(
|
||||
appBundle.path,
|
||||
'Frameworks',
|
||||
'Flutter.framework',
|
||||
flutterFrameworkDir.path,
|
||||
'Flutter',
|
||||
);
|
||||
|
||||
@@ -456,6 +462,11 @@ void main() {
|
||||
],
|
||||
);
|
||||
expect(appCodesign, const ProcessResultMatcher());
|
||||
|
||||
// Check read/write permissions are being correctly set
|
||||
final String rawStatString = flutterFrameworkDir.statSync().modeString();
|
||||
final String statString = rawStatString.substring(rawStatString.length - 9);
|
||||
expect(statString, 'rwxr-xr-x');
|
||||
});
|
||||
}, skip: !platform.isMacOS, // [intended] only makes sense for macos platform.
|
||||
timeout: const Timeout(Duration(minutes: 10))
|
||||
|
||||
@@ -164,6 +164,11 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
// Check read/write permissions are being correctly set
|
||||
final String rawStatString = outputFlutterFramework.statSync().modeString();
|
||||
final String statString = rawStatString.substring(rawStatString.length - 9);
|
||||
expect(statString, 'rwxr-xr-x');
|
||||
|
||||
// Check complicated macOS framework symlink structure.
|
||||
final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user