-
Notifications
You must be signed in to change notification settings - Fork 921
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
Sparkle framework integration #91
Conversation
25d64a4
to
29424bc
Compare
5bd88c8
to
15419c5
Compare
@simonhong is the process for running the update working for you now or is that still a WIP? Seems to fetch the appcast file for me but doesn't download the update. We can use docker for testing against omaha-server (just |
browser/brave_app_controller_mac.mm
Outdated
|
||
- (void)initializeBraveUpdater { | ||
constexpr int kBraveUpdateCheckInterval = 60; | ||
NSURL* url = [NSURL URLWithString:@"https://example.com"]; |
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 get this changed to http://localhost:9090 for testing?
Or actually think it makes sense to just remove it for now (we can set these settings in the Info.plist file).
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. you can change feed url in the `src/brave/brave_init_settings.gni'
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.
browser/brave_app_controller_mac.mm
Outdated
|
||
- (void)initializeBraveUpdater { | ||
constexpr int kBraveUpdateCheckInterval = 60; | ||
NSURL* url = [NSURL URLWithString:@"https://example.com"]; |
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. you can change feed url in the `src/brave/brave_init_settings.gni'
e3db07a
to
2a34f0a
Compare
@RyanJarv I implemented SUUpdateDelegate protocol to see error log.
Also When I request update with latest PR by update menu, it complains three things. |
40c409e
to
ce865d3
Compare
Ok cool this seems to work for me. On second thought go ahead and ping me if your going to try testing with docker since there would be a few changes that need to be made, going to see if I can make this a bit easier. |
@simonhong don't think you need to make a subrepo for sparkle, dependencies for brave/vendor seem to be managed here: https://github.com/brave/brave-core/blob/master/DEPS#L3 |
I created a repo for brave/sparkle that you can use, but yes you'd list the dependency to that repo there. |
Ah ok, misunderstood the repo thing. Just fyi if you want to test against the server you can use this https://github.com/RyanJarv/updater (let me know if you run into any issues). Sounds good, will do. |
cba171f
to
0a23d87
Compare
DEPS
Outdated
@@ -9,6 +9,7 @@ deps = { | |||
"vendor/requests": "https://github.com/kennethreitz/requests@e4d59bedfd3c7f4f254f4f5d036587bcd8152458", | |||
"vendor/boto": "https://github.com/boto/boto@f7574aa6cc2c819430c1f05e9a1a1a666ef8169b", | |||
"vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403", | |||
"vendor/sparkle": "https://github.com/simonhong/Sparkle.git@e6c544e72a72e96d1712f0f503d61ea267bc6e22", |
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.
Works well with my personal repo.
I'll update this with brave/sparkle when it is ready.
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.
Will want to have GN set up to build this, shouldn't be pulling in binaries unless we have that being built in some other CI process that we can audit.
(apologies again for the confusion)
+ # BRAVE(shong): Add sparkle update support | ||
+ if options.brave_feed_url: | ||
+ plist['SUFeedURL'] = options.brave_feed_url | ||
+ plist['SUPublicDSAKeyFile'] = 'dsa_pub.pem' |
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 put this into gni?
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.
defined dsa file name in brave_init_settings.gni
.
+ # BRAVE(shong): Add sparkle update support | ||
+ if options.brave_feed_url: | ||
+ plist['SUFeedURL'] = options.brave_feed_url | ||
+ plist['SUPublicDSAKeyFile'] = 'dsa_pub.pem' |
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.
defined dsa file name in brave_init_settings.gni
.
DEPS
Outdated
@@ -9,6 +9,7 @@ deps = { | |||
"vendor/requests": "https://github.com/kennethreitz/requests@e4d59bedfd3c7f4f254f4f5d036587bcd8152458", | |||
"vendor/boto": "https://github.com/boto/boto@f7574aa6cc2c819430c1f05e9a1a1a666ef8169b", | |||
"vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403", | |||
"vendor/sparkle": "https://github.com/simonhong/Sparkle.git@3364c87a25a93cf86dc9dd68066830a418ba0d90", |
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.
@bbondy @RyanJarv Still I can't use brave/sparkle
repo.
So, I tested with my personal repo to build sparkle from its source.
Just three files(BUILD.gn, build_sparkle_framework.py and dsa_pub.pem) are added with unmodified sparkle source.
Also 1.18.1 version is used.
When latest release verson (1.19.0) is used, sometimes crashed with below log.
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2018-04-18 16:49:29.448 Brave[70310:4028787] pid(70310)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
[70310:43015:0418/164929.449313:FATAL:sequenced_task_runner_handle.cc(52)] Check failed: ThreadTaskRunnerHandle::IsSet(). Error: This caller requires a sequenced context (i.e. the current task needs to run from a SequencedTaskRunner).
0 libbase.dylib 0x00000001200caf43 base::debug::StackTrace::StackTrace() + 19
1 libbase.dylib 0x00000001200f1ae0 logging::LogMessage::~LogMessage() + 224
2 libbase.dylib 0x00000001201711b3 base::SequencedTaskRunnerHandle::Get() + 307
3 libbase.dylib 0x000000012017a506 base::Timer::PostNewScheduledTask(base::TimeDelta) + 102
4 libbase.dylib 0x00000001200dfeb0 base::ImportantFileWriter::ScheduleWrite(base::ImportantFileWriter::DataSerializer*) + 208
5 libprefs.dylib 0x0000000134922930 JsonPrefStore::ScheduleWrite(unsigned int) + 96
6 libprefs.dylib 0x000000013492468d JsonPrefStore::ReportValueChanged(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int) + 317
7 libchrome_dll.dylib 0x000000010d85c61e SegregatedPrefStore::ReportValueChanged(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int) + 62
8 libprefs.dylib 0x0000000134959869 PrefService::ReportUserPrefChanged(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 105
9 libprefs.dylib 0x000000013496e6f2 subtle::ScopedUserPrefUpdateBase::Notify() + 50
10 libprefs.dylib 0x000000013496e6a9 subtle::ScopedUserPrefUpdateBase::~ScopedUserPrefUpdateBase() + 25
11 libchrome_dll.dylib 0x0000000113800879 ScopedUserPrefUpdate<base::DictionaryValue, (base::Value::Type)6>::~ScopedUserPrefUpdate() + 25
12 libchrome_dll.dylib 0x00000001137ffe75 ScopedUserPrefUpdate<base::DictionaryValue, (base::Value::Type)6>::~ScopedUserPrefUpdate() + 21
13 libchrome_dll.dylib 0x0000000113800849 ScopedUserPrefUpdate<base::DictionaryValue, (base::Value::Type)6>::~ScopedUserPrefUpdate() + 25
14 libchrome_dll.dylib 0x00000001138ac9ab -[BrowserWindowController(Private) saveWindowPositionIfNeeded] + 2939
15 libchrome_dll.dylib 0x000000011389b3d6 -[BrowserWindowController windowDidBecomeMain:] + 86
16 CoreFoundation 0x00007fff4776df2c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
17 CoreFoundation 0x00007fff4776ddfa _CFXRegistrationPost + 458
18 CoreFoundation 0x00007fff4776db31 ___CFXNotificationPost_block_invoke + 225
19 CoreFoundation 0x00007fff4772b8d0 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1664
20 CoreFoundation 0x00007fff4772aa07 _CFXNotificationPost + 599
21 Foundation 0x00007fff4982d8c7 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
22 AppKit 0x00007fff44e15c0b -[NSWindow _changeKeyAndMainLimitedOK:] + 940
23 AppKit 0x00007fff44e90ca8 -[NSWindow _orderOutAndCalcKeyWithCounter:stillVisible:docWindow:] + 1261
24 AppKit 0x00007fff44e18c0c NSPerformVisuallyAtomicChange + 146
25 AppKit 0x00007fff455c6833 -[NSWindow _doWindowOrderOutWithWithKeyCalc:forCounter:orderingDone:docWindow:] + 85
26 AppKit 0x00007fff455c7d26 -[NSWindow _reallyDoOrderWindowOutRelativeTo:findKey:forCounter:force:isModal:] + 446
27 AppKit 0x00007fff44e208ec -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 172
28 AppKit 0x00007fff44e1f765 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 287
29 AppKit 0x00007fff44e1f5cb -[NSWindow orderWindow:relativeTo:] + 169
30 AppKit 0x00007fff455c540e -[NSWindow _finishClosingWindow] + 479
31 AppKit 0x00007fff44f64ed8 -[NSWindow _close] + 378
32 Sparkle 0x000000010a856b5f -[SUUserInitiatedUpdateDriver closeCheckingWindow] + 122
33 Sparkle 0x000000010a857068 -[SUUserInitiatedUpdateDriver abortUpdateWithError:] + 47
34 Sparkle 0x000000010a82b7b2 -[SUAppcast reportError:] + 688
35 Sparkle 0x000000010a82a34e -[SUAppcast downloaderDidFailWithError:] + 63
36 Sparkle 0x000000010a8377f5 -[SPUDownloaderSession URLSession:task:didCompleteWithError:] + 96
37 CFNetwork 0x00007fff46841c8f __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.182 + 80
38 Foundation 0x00007fff498635df __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
39 Foundation 0x00007fff49863441 -[NSBlockOperation main] + 68
40 Foundation 0x00007fff498618ee -[__NSOperationInternal _start:] + 778
41 libdispatch.dylib 0x00007fff6fa38e08 _dispatch_client_callout + 8
42 libdispatch.dylib 0x00007fff6fa4b38e _dispatch_block_invoke_direct + 317
43 libdispatch.dylib 0x00007fff6fa38e08 _dispatch_client_callout + 8
44 libdispatch.dylib 0x00007fff6fa4b38e _dispatch_block_invoke_direct + 317
45 libdispatch.dylib 0x00007fff6fa4b231 dispatch_block_perform + 109
46 Foundation 0x00007fff4985d8fc __NSOQSchedule_f + 342
47 libdispatch.dylib 0x00007fff6fa38e08 _dispatch_client_callout + 8
48 libdispatch.dylib 0x00007fff6fa4bed1 _dispatch_continuation_pop + 472
49 libdispatch.dylib 0x00007fff6fa43783 _dispatch_async_redirect_invoke + 703
50 libdispatch.dylib 0x00007fff6fa3a9f9 _dispatch_root_queue_drain + 515
51 libdispatch.dylib 0x00007fff6fa3a7a5 _dispatch_worker_thread3 + 101
52 libsystem_pthread.dylib 0x00007fff6fd8a169 _pthread_wqthread + 1387
53 libsystem_pthread.dylib 0x00007fff6fd89be9 start_wqthread + 13
5403f33
to
8767a88
Compare
8767a88
to
a150250
Compare
During the update feature development, add this to command line args to enable update feature. When update feature development is finished, update is only enabled in official build.
To change feed url, modify brave_feed_url in brave/brave_init_settings.gni
To see error log.
Update Brave item is enabled when --enable-brave-update-test command argument is used. This item is added for update test easily.
Second Info.plist tweaking is done by brave_tweak_info_plist("brave_app_plist") with fisrt tweaking result by tweak_info_plist("chrome_app_plist"). For this, //brave/build/mac/tweak_info_plist.[py|gni| is created.
With this, brave_app_plist target is added to //brave.
To build and run on chrome layer test targets, sparkle dependency should be included in them.
With this, we don't need to add any link-time dependency. BraveAppController requests update check to Sparkle via SparkleGlue.
2b92c6f
to
326026a
Compare
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.
Approving for commit 326026a (approved by @riastradh-brave previously)
Fix shields isn't toggled when url has port number
Upgrade to Chromium 65.0.3325.146
Add initial sparkle framework integration.
Update stuff is added to BraveAppController(AppController subclass).
Close brave/brave-browser#159
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: