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

Make different channel apps run simultaneously on MacOS #298

Merged
merged 7 commits into from
Aug 8, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Jul 30, 2018

To execute different channel apps simultaneously, each app should
have different app name and different id.
This PR added different BRANDING files for each channel because
Brave on MacOS refers BRANDING file to get unique app name and id.

Issue brave/brave-browser#469

Did all four channel apps installation and execution simultaneously.
screen shot 2018-07-31 at 20 53 31

screen shot 2018-07-31 at 19 46 10

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

Create multiple channel dmg and install/run them.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@simonhong simonhong self-assigned this Jul 30, 2018
@simonhong simonhong changed the title WIP: Use different BRANDING files for each channel on MacOS WIP: Make different channel apps run simultaneously on MacOS Jul 30, 2018
@simonhong simonhong changed the title WIP: Make different channel apps run simultaneously on MacOS Make different channel apps run simultaneously on MacOS Jul 31, 2018
"//printing/buildflags",
"//ui/base:ui_features",
]
+ if (brave_chromium_build) { configs += [ "//brave/common:constants_configs" ] }
Copy link
Member Author

Choose a reason for hiding this comment

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

Added to use BRAVE_PRODUCT_STRING define in chrome_constants.cc.
This define has different string for different channel.(Brave-Browser, Brave-Browser-Nightly)

Copy link
Collaborator

Choose a reason for hiding this comment

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

see comment below

"${xpc_plist}" "CFBundleIdentifier")"

+framework_plist="${framework}/Resources/Info"
+framework_bundle_id="$(__CFPREFERENCES_AVOID_DAEMON=1 defaults read \
Copy link
Member Author

Choose a reason for hiding this comment

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

Fetch id from plist because framework of different channel have different id.
(ex, org.brave.Brave.dev.framework)

Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't this also the case with chrome?

Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems like we're patching some of these files to the point that we might as well have our own version of them?

--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -10,11 +10,11 @@
#define FPL FILE_PATH_LITERAL

#if defined(OS_MACOSX)
-#define CHROMIUM_PRODUCT_STRING "Chromium"
+#define CHROMIUM_PRODUCT_STRING "Brave"
+#define CHROMIUM_PRODUCT_STRING BRAVE_PRODUCT_STRING
Copy link
Member Author

Choose a reason for hiding this comment

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

Framework/Helper app's name reflects PRODUCT_FULL_NAME in BRANDING file.
(Ex, Brave-Browser-Dev Framework.framework, Brave-Browser-Dev Helper.app).
Their framework/helper name is made by using CHROMIUM_PRODCUT_STRING and PRODUCT_STRING.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can't we just use a chromium_src override here to redefine?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm pretty sure this entire patch file can be replaced with overrides cc @bbondy

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@simonhong
Copy link
Member Author

@RyanJarv To sign each channel, I created cert for each channel like below because each channel has different id.
spctl --add --requirement '(identifier "org.brave.Brave.nightly") and (certificate leaf = H"40D43D0858B39D93BA0A5EEFCA57CE9D5E169526")' --label simon-dev

@simonhong simonhong force-pushed the multi_channel_install_on_mac branch from 0d042f9 to 92a2d1c Compare July 31, 2018 11:53
bbondy
bbondy previously approved these changes Jul 31, 2018

// Fetch the strings
NSString* name =
- LoadStringFromDataPack(branded_data_pack.get(), cur_lang,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this doesn't seem right to me because presumably this works with multi-channel chrome


executable("infoplist_strings_tool") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]
+ configs += [ "//brave/common:constants_configs" ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as other comments for BRAVE_PRODUCT_STRING

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

see comments

@bbondy
Copy link
Member

bbondy commented Jul 31, 2018

I was hoping to include this in the new dev-channel builds tonight, are these blockers @bridiver ?

@bbondy
Copy link
Member

bbondy commented Jul 31, 2018

I'll wait on it, FYI the patches are rebased for C69 in the branch channels if you want to use those as a base.

@simonhong
Copy link
Member Author

simonhong commented Aug 1, 2018

@bridiver , Chrome product has same problem with us. We can't run different channel chrome product simultaneously. They don't support it for now. Only one channel app(among stable, beta and dev) is visible in launch pad because they use same id(because of this, sign script patch is introduced). I'm not sure this is bug or intended behavior.
So, we can run only two channel(one of them(stable, beta and dev) and canary) chrome app simultenously. I think canary is treated as a different product. I assume they might use different branding, resources and etc internally for canary.

Without infoplist_string patch, there is no facility for using different product name. To do this, we might have different grd files(such as brave_strings.grd, brave_dev_strings.grd and etc.)

I think this PR is minimal change for supporting multi channel.

@simonhong simonhong force-pushed the multi_channel_install_on_mac branch 2 times, most recently from 64826d0 to a0bdef7 Compare August 1, 2018 23:20
@RyanJarv
Copy link
Contributor

RyanJarv commented Aug 8, 2018

I think we'll want to add "TEAM_ID=KL8N8XSYF4" in the branding files.

This was added recently for entitlements during signing upstream

Edit: Well I suppose they just added MAC_TEAM_ID=, not sure if we'll want to add our team id here or if that get's set somewhere else.

@simonhong
Copy link
Member Author

@RyanJarv Thanks for checking this. I added it to all BRANDING files.

To execute different channel apps simultaneously, each app should
have different app name and different id.
This PR added different BRANDING files for each channel because
Brave on MacOS refers BRANDING file to get unique app name and id.
Each channel app should have different bundle id to install/run
them simultaneously.
Brave browser should show product name that includes channel because
different channel apps can be run simultaneously.
To do this, BRAVE_PRODUCT_STRING is set to CFBundleDisplayName in localized
infoplist string instead of using IDS_PRODUCT_NAME only.
This property is newly introduced in C69.
@simonhong simonhong force-pushed the multi_channel_install_on_mac branch from 7a24535 to 061c53b Compare August 8, 2018 14:50
Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

lgtm
@bridiver if you have more comments pls just post an issue or ask @simonhong to here and he'll do them as a follow up.

@bbondy bbondy merged commit 1b5fd09 into master Aug 8, 2018
@simonhong simonhong deleted the multi_channel_install_on_mac branch August 19, 2018 23:22
petemill added a commit that referenced this pull request Dec 11, 2018
Changes:
```
*   cee363d - (44 minutes ago) Merge pull request #314 from brave/revert-sync-master — Pete Miller (HEAD -> master, origin/master, origin/HEAD)
|\
| * 0ca4b73 - (56 minutes ago) Revert "sync v2" — Cezar Augusto
| * a479cea - (56 minutes ago) Revert "Merge pull request #308 from brave/sync_img" — Cezar Augusto
|/
*   dd46eab - (19 hours ago) Merge pull request #247 from brave/c71-clock-period — Pete Miller
|\
| * 20d2a61 - (7 weeks ago) Fix NTP clock for c71 — petemill (origin/c71-clock-period, c71-clock-period)
* |   69a3399 - (19 hours ago) Merge pull request #305 from ryanml/android-rewards-title-fix — Pete Miller
|\ \
| |/
|/|
| * d92ce8f - (7 days ago) Fixing rewards toggle for long translations — ryanml (ryanml/android-rewards-title-fix, android-rewards-title-fix)
|/
* 4692dfd - (25 hours ago) readme typos — Ross Moody
*   ca3e285 - (29 hours ago) Merge pull request #312 from emerick/rewards-backup-wallet-notification — Nejc Zdovc
|\
| * 4dda1bc - (4 days ago) Add support for backupWallet notification — Emerick Rogul
* | 0a5f56e - (4 days ago) Emoji Life — Ross Moody
* | be16816 - (4 days ago) Readme formatting — Ross Moody
* | 35b166d - (4 days ago) Brave UI Logo — Ross Moody
* |   fddeb8a - (4 days ago) Merge pull request #311 from brave/now-deploy-static — Cezar Augusto
|\ \
| * | 6685301 - (5 days ago) Use new static deploy config for now instead of docker — petemill (origin/now-deploy-static, now-deploy-static)
* | | eb49e8b - (4 days ago) remove list from README file — Cezar Augusto
* | | 59eae8d - (4 days ago) remove outdated docs — Cezar Augusto
* | | f04fecc - (4 days ago) do not count first letter if space in textareaclipboard — Cezar Augusto
| |/
|/|
* |   7ea9178 - (5 days ago) Merge pull request #308 from brave/sync_img — Cezar Augusto
|\ \
| * | 470233f - (6 days ago) make sync images exportable — Cezar Augusto
| |/
* |   aa520cf - (5 days ago) Merge pull request #309 from brave/welcome_img — Pete Miller
|\ \
| * | 870d3ba - (6 days ago) animation dial in — Ross Moody (origin/welcome_img, welcome_img)
| * | 1c2525b - (6 days ago) make welcome page images exportable — Cezar Augusto
| |/
* |   96ccb12 - (6 days ago) Merge pull request #307 from kirkins/patch-1 — Ryan Lanese
|\ \
| * | f98a665 - (6 days ago) small typo — Philip Kirkbride
* | | f3c38e1 - (6 days ago) v0.36.0 — ryanml (tag: v0.36.0)
|/ /
* |   46b3501 - (6 days ago) Merge pull request #304 from ryanml/disabled-panel — Nejc Zdovc
|\ \
| * | 6be56a3 - (7 days ago) Adding disabledPanel component — ryanml (ryanml/disabled-panel)
|/ /
* |   79b16fb - (6 days ago) Merge pull request #299 from ryanml/fix-298 — Nejc Zdovc
|\ \
| |/
|/|
| * c79530c - (12 days ago) Fixes #298, uses string type for amount/tokens — ryanml (ryanml/fix-298, fix-298)
* 6bf8054 - (8 days ago) v0.35.0 — Cezar Augusto (tag: v0.35.0, now-deploy-reliable)
* 3535427 - (3 weeks ago) sync v2 — Cezar Augusto
*   10f07c0 - (9 days ago) Merge pull request #300 from brave/site-banner-icon — Ryan Lanese
|\
| * da3cc4b - (11 days ago) Site banner icon update — Ross Moody
* 9064f12 - (9 days ago) Merge pull request #301 from emerick/rewards-insufficient-funds-notification — Ryan Lanese
* 5300262 - (11 days ago) Add support for insufficientFunds notification — Emerick Rogul
```
NejcZdovc pushed a commit that referenced this pull request Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants