application-services
application-services copied to clipboard
verify-desktop-environment not properly detecting M1 with rosetta
Right now there is an edge case we need to handle to help M1 users who are using rosetta and have built a-s in the past migrate a little easier by detecting if they are using rosetta and give a proper message accordingly.
Right now: https://github.com/mozilla/application-services/blob/main/libs/verify-desktop-environment.sh#L40-L52
Works fine for non-rosetta users. However, if their terminal is running rosetta (either because terminal is using rosetta or running the terminal via VSCode with rosetta) then it will tell them to use the x86-64
path which will cause problems with NSS/SQLCipher and other build issues down the line.
There are potentially two solutions:
- To detect if they are using an M1 (
uname -m
) and running rosetta (easiest way is probablyecho $CPUTYPE
) and give a message accordingly to not use rosetta. - Detect if they are using rosetta and adjust the scripts so that they stay on the x86-64 path
- While the second option may be seem a little better, they might not be intentionally using rosetta and they'll be running everything through the rosetta translation layer, which will have performance impact (but this was how it was before native M1 changes)
┆Issue is synchronized with this Jira Task