-
Notifications
You must be signed in to change notification settings - Fork 879
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
Linux support #205
Linux support #205
Conversation
b928e50
to
69884eb
Compare
69884eb
to
91bb69b
Compare
Brave support four different user dir depends on channel. * Brave-Browser for stable release * Brave-Browser-Beta for beta release * Brave-Browser-Dev for dev release * Brave-Development for unofficial build Canary channel isn't supported on linux. Channel suffixes are determined from $CHROME_VERSION_EXTRA, which is passed by the launch wrapper script. For more detail, see src/docs/user_data_dir.md#Linux
+#include "brave/common/brave_channel_info_linux.h" | ||
+#endif | ||
+ | ||
namespace chrome { | ||
|
||
using base::nix::GetXDGDirectory; | ||
@@ -87,10 +91,18 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) { | ||
@@ -87,10 +91,14 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do a method override here instead of patch as discussed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
common/brave_channel_info_linux.cc
Outdated
@@ -16,11 +17,18 @@ std::string GetChannelSuffixForDataDir() { | |||
|
|||
// Chrome doesn't support canary channel on linux. | |||
if (modifier == "unstable") // linux version of "dev" | |||
modifier = "dev"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we use defines in a gni config as suggested https://github.com/brave/brave-core/pull/208/files#r199649672 we can remove some or all of this logic and just return the value from the gn define
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise I'm concerned about the two getting out of sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many unit test and browser test that uses this modifier.
So, if someone make inconsistency between c++ and gn, it can be easily detected. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unified all linux channel infos to brave/build/linux and used it in c++.
PTAL.
13dd130
to
0486495
Compare
cf3b194
to
031183a
Compare
5de783a
to
5e65f49
Compare
Sorry, additional nightly channel support commit is added to this PR because nightly supports depends on this PR. |
I think preparing nightly build release is almost done with this PR. |
Set parest user dir - .../BraveSoftware/Brave-Browser/... Added unit test - BraveChannelInfoTest
Channel determining logic is unified to brave::GetChannelImpl().
…Linux They are subclass of ChromeViewsDelegate and ChromeBrowserMainExtraPartsViewsLinux. They are introduced to override ChromeViewsDelegate::GetWindowIcon() in chrome_views_delegate_linux.cc.
BraveViewsDelegateLinuxBrowserTest.GetDefaultWindowIconTest checks whether proper image is returned from ViewsDelegate::GetDefaultWindowIcon()
build/linux/channels.gni
Outdated
linux_channel_stable = "stable" | ||
linux_channel_beta = "beta" | ||
linux_channel_dev = "unstable" | ||
linux_channel_nightly = "nightly" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change this to brave_linux_channel_nightly
which is not in upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
build/linux/channels.gni
Outdated
linux_channel_nightly = "nightly" | ||
|
||
# Our channel name and upstream linux channel name is different. | ||
linux_channel_name = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. forgot to delete. done.
Define channel in brave/build/linux/BUILD.gn and use it in C++ world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#include "chrome/services/file_util/public/mojom/constants.mojom.h" | ||
#endif | ||
|
||
+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OS_LINUX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonhong can you remove these patches in a follow-up? The chromium_src subclass override I mentioned on slack would work well here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact in this case you subclass the ViewsDelegateLinux and you won't even need BraveBrowserMainExtraPartsViewLinux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #230
linux_package("unstable") { | ||
channel = "unstable" | ||
} | ||
+linux_package("nightly") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be added in a brave build file or does it have to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add this in a brave build, we need to copy linux_package
template in here to us.
So, I added this here to avoid copy.
@@ -25,3 +25,13 @@ index 261faeaf26f34f2e89229579ae7933e23e4299e6..201aacd532ea70067279ec970134f3b2 | |||
mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ | |||
"${OUTPUTDIR}" | |||
# Make sure the package is world-readable, otherwise it causes problems when | |||
@@ -146,6 +150,9 @@ verify_channel() { | |||
unstable|dev|alpha ) | |||
CHANNEL=unstable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually can we use unstable as nightly or do we need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need both - linux uses unstable
and dev
both for dev
channel.
Issue: brave/brave-browser#10
Close brave/brave-browser#340
Close brave/brave-browser#461
TODO: image files should be checked by design team.
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
yarn test brave_browser_tests --filter=BraveResourcesBrowserTest.*
yarn test brave_browser_tests --filter=BraveViewsDelegateLinuxBrowserTest.*
yarn test brave_unit_tests --filter=BraveChannelInfoTest.*
Reviewer Checklist: