Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update android build instructions for macOS #5085

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

Rawa
Copy link
Contributor

@Rawa Rawa commented Sep 1, 2023

This PR splits out and updates the build instructions for macOS.

The current instructions branch depending on if the user have Linux or macOS, which gets confusing for the user. It was also not able to run on a ARM based macbook for several reasons:

  • Updated environmental variables caused AVD in Android Studio to crash
  • Links to ndk would pull the Linux version of ndk for mac user that would not work.
  • ./build-apk --dev-build spits out error optional_android_credentials_volume[@]: unbound variable and the image wouldn't work on ARM-based macbook if it proceeded.

The new instructions are a bit more opinionated by requiring android studio, and not using stand-alone sdkmanager. Considering android-studio basically the only IDE android developer's I don't believe this is too controversial. Linux users/CI/CD can still use container builds to continue to build headless.

The steps have been tested on a clean VM of macOS.

Caveat: The new instructions does not apply the patch for wireguard-go, noted here: https://github.com/mullvad/mullvadvpn-app/compare/update-build-instructions-for-macos?expand=1#diff-d99ff3a97afdf0546e736e895eb02af6d19cf941f4cfec80ffe42932c1ae2038R6 we should consider looking into how this build step can be added for a mac user as well.


This change is Reviewable

@Rawa Rawa requested a review from albin-mullvad September 1, 2023 11:59
@Pururun Pururun added the Android Issues related to Android label Sep 1, 2023
Copy link
Contributor

@Pururun Pururun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Rawa)


android/docs/macos-build-instructions.md line 0 at r1 (raw file):
I suggest renaming to either BuildInstructions.macos.md or BuildInstructions-macos.md to keep the name more similar to the other document (BuildInstructions.md). It would also make sure they are listed together in terminals or GUIs when listing files (ordered by name).


android/docs/macos-build-instructions.md line 45 at r1 (raw file):

Export the following environmental variables, and possibly store them for example in your
`~/.zprofile` or `~/zshrc` file:

typo: should probably be ~/.zshrc (?)

Code quote:

~/zshrc

@Rawa Rawa force-pushed the update-build-instructions-for-macos branch from 9ccfbcd to 952e727 Compare September 8, 2023 07:02
Copy link
Contributor Author

@Rawa Rawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @albin-mullvad and @Pururun)


android/docs/macos-build-instructions.md line 45 at r1 (raw file):

Previously, albin-mullvad wrote…

typo: should probably be ~/.zshrc (?)

Thanks! Fixed


android/docs/macos-build-instructions.md line at r1 (raw file):

Previously, albin-mullvad wrote…

I suggest renaming to either BuildInstructions.macos.md or BuildInstructions-macos.md to keep the name more similar to the other document (BuildInstructions.md). It would also make sure they are listed together in terminals or GUIs when listing files (ordered by name).

@albin-mullvad With the intent of storing it directly under android/? I used similar pattern to https://github.com/mullvad/mullvadvpn-app/tree/main/docs for macos-signing.md, and since we want people to read the original BuildInstructions.md first it is hidden away under android/docs/

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)


android/docs/macos-build-instructions.md line at r1 (raw file):
Yeah, right, forgot about this being under docs, but I still believe it would be best to keep it consistent with the other BuildInstructions.md and just add a suffix like suggested above. It's quite neat to easily find all instructions like this imo (including macos and windows examples):

> find . -name "BuildInstructions*"

./android/docs/BuildInstructions.macos.md
./android/docs/BuildInstructions.windows.md
./android/BuildInstructions.md
./ios/BuildInstructions.md
./BuildInstructions.md

It's always nice to compare with existing files, like macos-signing.md, but I don't believe that one specifically was named to set a pattern for other platform specific stuff in the project.

@Rawa Rawa force-pushed the update-build-instructions-for-macos branch from 952e727 to fefaeae Compare September 11, 2023 08:33
Copy link
Contributor Author

@Rawa Rawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @albin-mullvad and @Pururun)


android/docs/macos-build-instructions.md line at r1 (raw file):

Previously, albin-mullvad wrote…

Yeah, right, forgot about this being under docs, but I still believe it would be best to keep it consistent with the other BuildInstructions.md and just add a suffix like suggested above. It's quite neat to easily find all instructions like this imo (including macos and windows examples):

> find . -name "BuildInstructions*"

./android/docs/BuildInstructions.macos.md
./android/docs/BuildInstructions.windows.md
./android/BuildInstructions.md
./ios/BuildInstructions.md
./BuildInstructions.md

It's always nice to compare with existing files, like macos-signing.md, but I don't believe that one specifically was named to set a pattern for other platform specific stuff in the project.

I agree that it is a clearer pattern of naming the documents, and have updated it. We should consider notifying the other teams so they are aware of the pattern.

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


android/docs/macos-build-instructions.md line at r1 (raw file):

Previously, Rawa (David Göransson) wrote…

I agree that it is a clearer pattern of naming the documents, and have updated it. We should consider notifying the other teams so they are aware of the pattern.

Sounds like a good idea 👍

@albin-mullvad albin-mullvad force-pushed the update-build-instructions-for-macos branch from fefaeae to 72aea45 Compare September 13, 2023 15:28
@albin-mullvad albin-mullvad merged commit 0207bb3 into main Sep 13, 2023
1 check passed
@albin-mullvad albin-mullvad deleted the update-build-instructions-for-macos branch September 13, 2023 15:31
@Rawa Rawa self-assigned this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants