You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mac Arm and Intel builds are generating different brave_resources.pak resource files. This results in an error when creating a Universal app for distribution. To get around this error, we have been copying one platform's brave_resources.pak over the other. This can result in catastrophic runtime errors.
The priority is to make sure filenames are the same, then the catastrophic errors will be removed.
The secondary goal is to make sure that brave_resources.pak is identical every time it's generated. Then we will be able to keep the file as part of the Universal app creation and will receive a build-time error if they are different.
Items preventing this from occuring:
Webpack references from different architectures' output directories (e.g. Release and Release_arm64) creates different output file names. File names are based on a generated hash / ID of all the paths. This can be observed by comparing file names in e.g. gen/brave/components/web-ui-brave_new_tab/.
Webpack file content also differs from different architectures' output directories since when concatenating modules, the module paths and its dependencies paths are used to generate the module ID which is used as a reference to "require" the concatenated module. This can be observed by comparing file contents in e.g. gen/brave/components/web-ui-brave_new_tab/.
WDP builds occur in a different temp directory each time. This temp directory path is used to create the chunk file name and the concatenated module IDs. WDP uses the broccoli build system. This can be observed by comparing file contents in gen/brave/web-discovery-project.
Some helpful commands I've used to assess results after changing webpack configuration:
Compile the NTP using Webpack at both ./out/Release and ./out/Release_arm64 paths
Create a symlink to pretend there's another build config
Compare the real brave_resources.pak file from actual intel and arm builds
# First do a Release build on each machine
# Then have the intel machine accessible from the arm machine (mine is at /Volumes/petemill)
# pak_util.py doesn't currently work with brave patches, so I'm using a different chromium dir to find that util
cd ~/Downloads/tmp/pak-compare
rm -rf arm && mkdir arm && cd arm && ~/Development/Brave/brave-browser-chromium-upgrade/src/tools/grit/pak_util.py extract "/Users/petemill/Development/Brave/brave-browser/src/out/Release_arm64/Brave Browser.app/Contents/Frameworks/Brave Browser Framework.framework/Versions/125.1.68.0/Resources/brave_resources.pak" && cd ..
rm -rf intel && mkdir intel && cd intel && ~/Development/Brave/brave-browser-chromium-upgrade/src/tools/grit/pak_util.py extract "/Volumes/petemill/Development/Brave/brave-browser/src/out/Release/Brave Browser.app/Contents/Frameworks/Brave Browser Framework.framework/Versions/125.1.68.0/Resources/brave_resources.pak" && cd ..
opendiff ./arm ./intel
The text was updated successfully, but these errors were encountered:
Description
Mac Arm and Intel builds are generating different
brave_resources.pak
resource files. This results in an error when creating a Universal app for distribution. To get around this error, we have been copying one platform'sbrave_resources.pak
over the other. This can result in catastrophic runtime errors.The priority is to make sure filenames are the same, then the catastrophic errors will be removed.
The secondary goal is to make sure that
brave_resources.pak
is identical every time it's generated. Then we will be able to keep the file as part of the Universal app creation and will receive a build-time error if they are different.Items preventing this from occuring:
Release
andRelease_arm64
) creates different output file names. File names are based on a generated hash / ID of all the paths. This can be observed by comparing file names in e.g.gen/brave/components/web-ui-brave_new_tab/
.gen/brave/components/web-ui-brave_new_tab/
.gen/brave/web-discovery-project
.Some helpful commands I've used to assess results after changing webpack configuration:
Compile the NTP using Webpack at both
./out/Release
and./out/Release_arm64
pathsCreate a symlink to pretend there's another build config
Build NTP for
./Release
Compare the output
Compare the real
brave_resources.pak
file from actual intel and arm buildsThe text was updated successfully, but these errors were encountered: