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
When building dmg files for apps that use some specific characters in their productName (for example "Å") - electron-builder fails due to an error in the python package mac_alias (hard copy stored here), which is a dependency of dmg-builder.
This problem occurs when mac_alias reads the path of the newly mounted dmg volume ("/Volumes/Å") using libc statfs in OSX (here is where it happens). The file path that is returned (which is used here) is a unicode NFD string, which is incompatible with other unicode strings used in mac_alias that are in the NFC format. When comparing NFD strings with NFC strings to calculate file paths, things go wrong which leads to this error.
Add the following to package.json to make sure only dmg is built for mac
"build": {
...
"mac": {
"target": "dmg"
},
...
Modify build.productName in package.json to "Å"
"build": {
...
"productName": "Å",
Run npm install
Run npm run package
Expected result
Success
Actual result
Failure:
• building target=DMG arch=x64 file=release/Å-1.1.0.dmg
⨯ Exit code: 1. Command failed: /usr/bin/python /Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/dmgbuild/core.py
Traceback (most recent call last):
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/dmgbuild/core.py", line 282, in <module>
build_dmg()
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/dmgbuild/core.py", line 253, in build_dmg
icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/mac_alias/alias.py", line 589, in to_bytes
self._to_fd(b)
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/mac_alias/alias.py", line 476, in _to_fd
*self.target.cnid_path)
struct.error: 'I' format requires 0 <= number <= 4294967295
Traceback (most recent call last):
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/dmgbuild/core.py", line 282, in <module>
build_dmg()
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/dmgbuild/core.py", line 253, in build_dmg
icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/mac_alias/alias.py", line 589, in to_bytes
self._to_fd(b)
File "/Users/inera/Repositories/electron-react-boilerplate/node_modules/dmg-builder/vendor/mac_alias/alias.py", line 476, in _to_fd
*self.target.cnid_path)
struct.error: 'I' format requires 0 <= number <= 4294967295
stackTrace=
vol_path = st.f_mntonname
# File and folder names in HFS+ are normalized to a form similar to NFD.
# Must be normalized (NFD->NFC) before use to avoid unicode string comparison issues.
vol_path = normalize("NFC", vol_path.decode('utf-8')).encode('utf-8')
The same issue have been posted on dmgbuild/mac_alias#6 which I think is where you have copied your code from.
The text was updated successfully, but these errors were encountered:
Problem
When building dmg files for apps that use some specific characters in their productName (for example "Å") -
electron-builder
fails due to an error in the python packagemac_alias
(hard copy stored here), which is a dependency of dmg-builder.This problem occurs when
mac_alias
reads the path of the newly mounted dmg volume ("/Volumes/Å") using libc statfs in OSX (here is where it happens). The file path that is returned (which is used here) is a unicode NFD string, which is incompatible with other unicode strings used inmac_alias
that are in the NFC format. When comparing NFD strings with NFC strings to calculate file paths, things go wrong which leads to this error.Steps to reproduce
package.json
to reference the latest versions of electron and electron-builderpackage.json
to make sure onlydmg
is built for macbuild.productName
inpackage.json
to "Å"npm install
npm run package
Expected result
Success
Actual result
Failure:
Solution
In alias.py on line 13, add:
In alias.py on line 347, replace
with
The same issue have been posted on dmgbuild/mac_alias#6 which I think is where you have copied your code from.
The text was updated successfully, but these errors were encountered: