Unverified Commit ec6611b3 authored by flutteractionsbot's avatar flutteractionsbot Committed by GitHub

[CP-stable]Fixes incorrect read/write permissions on Flutter.framework and...

[CP-stable]Fixes incorrect read/write permissions on Flutter.framework and FlutterMacOS.framework (#148717)

This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?
https://github.com/flutter/flutter/issues/148354
https://github.com/flutter/flutter/issues/147142

### Changelog Description:
Correct read/write permisions for FlutterMacOS.framework to allow MacOS developers to publish to the app store

### Impact Description:
MacOS developers.

### Workaround:
Is there a workaround for this issue?

Run chmod locally after building https://github.com/flutter/flutter/issues/148354#issuecomment-2116391118

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

1. `flutter build macos --release` any macos project
2. `ls -la macos/Build/Products/Release/test_create.app/Contents/Frameworks/`
3. Note that the permissions for FlutterMacOS.framework is `drwxr-xr-x`, NOT `dr-------`
(note that this is validated to work here https://github.com/flutter/flutter/issues/148354#issuecomment-2116447391)
parent 5dcb86f6
...@@ -314,6 +314,7 @@ abstract class UnpackIOS extends Target { ...@@ -314,6 +314,7 @@ abstract class UnpackIOS extends Target {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
basePath, basePath,
environment.outputDir.path, environment.outputDir.path,
]); ]);
......
...@@ -60,6 +60,7 @@ abstract class UnpackMacOS extends Target { ...@@ -60,6 +60,7 @@ abstract class UnpackMacOS extends Target {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
basePath, basePath,
environment.outputDir.path, environment.outputDir.path,
]); ]);
......
...@@ -541,6 +541,7 @@ void main() { ...@@ -541,6 +541,7 @@ void main() {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.physical', 'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.physical',
outputDir.path, outputDir.path,
]); ]);
...@@ -597,6 +598,7 @@ void main() { ...@@ -597,6 +598,7 @@ void main() {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator', 'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator',
outputDir.path, outputDir.path,
], ],
......
...@@ -73,6 +73,7 @@ void main() { ...@@ -73,6 +73,7 @@ void main() {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
'Artifact.flutterMacOSFramework.debug', 'Artifact.flutterMacOSFramework.debug',
environment.outputDir.path, environment.outputDir.path,
], ],
...@@ -133,6 +134,7 @@ void main() { ...@@ -133,6 +134,7 @@ void main() {
'--delete', '--delete',
'--filter', '--filter',
'- .DS_Store/', '- .DS_Store/',
'--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r',
// source // source
'Artifact.flutterMacOSFramework.debug', 'Artifact.flutterMacOSFramework.debug',
// destination // destination
......
...@@ -422,10 +422,16 @@ void main() { ...@@ -422,10 +422,16 @@ void main() {
.whereType<Directory>() .whereType<Directory>()
.singleWhere((Directory directory) => fileSystem.path.extension(directory.path) == '.app'); .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( final String flutterFramework = fileSystem.path.join(
appBundle.path, flutterFrameworkDir.path,
'Frameworks',
'Flutter.framework',
'Flutter', 'Flutter',
); );
...@@ -456,6 +462,11 @@ void main() { ...@@ -456,6 +462,11 @@ void main() {
], ],
); );
expect(appCodesign, const ProcessResultMatcher()); 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. }, skip: !platform.isMacOS, // [intended] only makes sense for macos platform.
timeout: const Timeout(Duration(minutes: 10)) timeout: const Timeout(Duration(minutes: 10))
......
...@@ -164,6 +164,11 @@ void main() { ...@@ -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. // Check complicated macOS framework symlink structure.
final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current'); final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment