Skip to content

Winit 0.24.0 and surfman - #28236

Merged
bors-servo merged 6 commits into
servo:masterfrom
pecastro:winit_0_24_surfman
Mar 14, 2021
Merged

bors-servo merged 6 commits into
servo:masterfrom
pecastro:winit_0_24_surfman

Conversation

@pecastro

@pecastro pecastro commented Mar 3, 2021 •

Copy link
Copy Markdown
Contributor

I've updated Servo to Winit 0.24.0 based on the previous work in #26394.
I've basically rebased master onto his jdm/winit branch which had the bulk of the work and I brute forced it till it built correcting things here and there as I could.
The build reports a few warnings:

00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/headed_window.rs:753:12
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 753 |         if input.modifiers.shift() {
00:04:59 Mar 03 10:20:06     |            ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06     = note: `#[warn(deprecated)]` on by default
00:04:59 Mar 03 10:20:06 
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/keyutils.rs:263:34
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 263 |         modifiers: get_modifiers(input.modifiers),
00:04:59 Mar 03 10:20:06     |                                  ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06 
00:07:06 Mar 03 10:22:13 warning: 2 warnings emitted
00:07:06 Mar 03 10:22:13 
00:07:06 Mar 03 10:22:13    Completed servo v0.0.1 bin "servo" in 132.7s
00:07:06 Mar 03 10:22:13     Finished dev [unoptimized + debuginfo] target(s) in 6m 59s
00:07:08 Mar 03 10:22:15 [Warning] Could not generate notification! 
00:07:08 Mar 03 10:22:15 Build Completed in 0:07:01

And there are a few commits namely b27e09e which I'm not entirely sure of.
I've intentionally left the surfman patch in Cargo.toml so someone else can validate this branch.
Unit tests and smoke test run successfully.
Servo runs but I'm not familiar enough with it to validate how well it does. The window opens and content loads though.

My Rust foo is not great and I could use some help fixing those warnings.

Regards,

PECastro


  • [x ] ./mach build -d does not report any errors
    A few warnings ...
  • [x ] ./mach test-tidy does not report any errors
    A few duplicate version statements but no errors.
  • These changes fix Update winit #26394
  • There are tests for these changes
  • These changes do not require tests because

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 3, 2021
@highfive

highfive commented Mar 3, 2021

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@jdm

jdm commented Mar 3, 2021

Copy link
Copy Markdown
Member

The same problems are present on macOS from my previous attempt, as described in #26394 (comment).

@jdm

jdm commented Mar 3, 2021

Copy link
Copy Markdown
Member

The resizing issue:

  • we call repaint_synchronously
  • this makes the compositor repaint synchronously via this code
  • we never receive a message from the compositor, because somehow the ordering gets messed up and the resize message doesn't cause the layout thread to trigger a new layout and therefore make the compositor redraw

@jdm

jdm commented Mar 3, 2021

Copy link
Copy Markdown
Member

I pushed a commit that avoids the freezing while repainting issue. The actual viewport for pages is still wildly incorrect on macOS, which is the next issue that needs to be resolved.

@jdm

jdm commented Mar 3, 2021

Copy link
Copy Markdown
Member

I pushed a commit that fixes the wacky viewport, so the rendering actually looks correct now. I think this is almost ready for merging after a bit more cleanup!

@jdm jdm mentioned this pull request Mar 3, 2021
@jdm

jdm commented Mar 3, 2021 •

Copy link
Copy Markdown
Member

Opening https://rawcdn.githack.com/mrdoob/three.js/master/examples/webxr_vr_rollercoaster.html, starting the VR, then closing the new window that appears yields (on macOS):

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x00007fff3d63f076 QuartzCore`CA::Layer::mark_visible(CA::Transaction*, bool) + 20
QuartzCore`CA::Layer::mark_visible:
->  0x7fff3d63f076 <+20>: movl   0x30(%rdi), %eax
    0x7fff3d63f079 <+23>: testl  %eax, %eax
    0x7fff3d63f07b <+25>: sets   %cl
    0x7fff3d63f07e <+28>: xorb   %r15b, %cl
Target 0: (servo) stopped.
(lldb) bt
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x00007fff3d63f076 QuartzCore`CA::Layer::mark_visible(CA::Transaction*, bool) + 20
    frame #1: 0x00007fff3d63f15d QuartzCore`CA::Layer::mark_visible(CA::Transaction*, bool) + 251
    frame #2: 0x00007fff3d63f15d QuartzCore`CA::Layer::mark_visible(CA::Transaction*, bool) + 251
    frame #3: 0x00007fff3d652b86 QuartzCore`CA::Layer::set_visible(unsigned int) + 334
    frame #4: 0x00007fff3d65290a QuartzCore`CA::Context::set_layer(void const*) + 90
    frame #5: 0x00007fff2f07735a AppKit`-[_NSViewLayerSurface invalidate] + 454
    frame #6: 0x00007fff2ee1074b AppKit`NSViewDetachLayerSurface + 38
    frame #7: 0x00007fff2edda189 AppKit`-[NSView _setWindow:] + 527
    frame #8: 0x00007fff2f076277 AppKit`-[NSWindow dealloc] + 878
    frame #9: 0x00007fff2f075f02 AppKit`-[NSWindow _dealloc] + 76
    frame #10: 0x00007fff6a8c0054 libobjc.A.dylib`AutoreleasePoolPage::releaseUntil(objc_object**) + 134
    frame #11: 0x00007fff6a8a4dba libobjc.A.dylib`objc_autoreleasePoolPop + 175
    frame #12: 0x0000000106b6f704 servo`_$LT$objc..rc..autorelease..AutoReleaseHelper$u20$as$u20$core..ops..drop..Drop$GT$::drop::h4c644cb45f998acc(self=0x00007ffeefbed968) at autorelease.rs:17:18
    frame #13: 0x0000000106b11ff1 servo`core::ptr::drop_in_place$LT$objc..rc..autorelease..AutoReleaseHelper$GT$::h1a0f61cd1601a817((null)=0x00007ffeefbed968) at mod.rs:187:1
    frame #14: 0x0000000106b2d263 servo`objc::rc::autorelease::autoreleasepool::hf4372b62d689fdd5(f=closure-0 @ 0x00007ffeefbed978) at autorelease.rs:30:1
    frame #15: 0x0000000106b387b9 servo`winit::platform_impl::platform::util::async::close_async::_$u7b$$u7b$closure$u7d$$u7d$::h9c1439cd6ab56826 at async.rs:213:9
    frame #16: 0x0000000106b2a208 servo`dispatch::context_and_function::work_execute_closure::hf77f49f744f5aa91(context=0x00000001155752e8) at lib.rs:94:9
    frame #17: 0x00007fff6b9fe658 libdispatch.dylib`_dispatch_client_callout + 8
    frame #18: 0x00007fff6ba09cab libdispatch.dylib`_dispatch_main_queue_callback_4CF + 936
    frame #19: 0x00007fff31b8fe81 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #20: 0x00007fff31b4fc87 CoreFoundation`__CFRunLoopRun + 2028
    frame #21: 0x00007fff31b4ee3e CoreFoundation`CFRunLoopRunSpecific + 462
    frame #22: 0x00007fff3077babd HIToolbox`RunCurrentEventLoopInMode + 292
    frame #23: 0x00007fff3077b7d5 HIToolbox`ReceiveNextEventCommon + 584
    frame #24: 0x00007fff3077b579 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #25: 0x00007fff2edc1039 AppKit`_DPSNextEvent + 883
    frame #26: 0x00007fff2edbf880 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
    frame #27: 0x00007fff2edb158e AppKit`-[NSApplication run] + 658
    frame #28: 0x000000010527ddc6 servo`_$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$::invoke::h7703d270b10e9f63(imp=(libobjc.A.dylib`objc_msgSend), obj=0x00000001156177f0, sel=Sel @ 0x00007ffeefbef070, (null)=<unavailable>) at mod.rs:128:17
    frame #29: 0x000000010527dc82 servo`objc::message::platform::send_unverified::hfe0943e94c5445bd(obj=0x00000001156177f0, sel=Sel @ 0x00007ffeefbef0e0, args=<unavailable>) at mod.rs:27:9
    frame #30: 0x000000010006b45f servo`winit::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run_return::h96736e563ea82f7f [inlined] objc::message::send_message::h91b8ba00ffaf2970(obj=0x00000001156177f0, sel=Sel @ 0x00007ffeefbf1680) at mod.rs:178:5
    frame #31: 0x000000010006b444 servo`winit::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run_return::h96736e563ea82f7f(self=0x00007ffeefbf16c8, callback=closure-0 @ 0x00007ffeefbf16d8) at event_loop.rs:106
    frame #32: 0x000000010006c6c2 servo`winit::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run::h5a15a6f1e30d03ec(self=EventLoop<servo::events_loop::ServoEvent> @ 0x00007ffeefbf16c8, callback=<unavailable>) at event_loop.rs:93:9
    frame #33: 0x00000001000b8c61 servo`winit::event_loop::EventLoop$LT$T$GT$::run::ha69d468e5b7f979d(self=EventLoop<servo::events_loop::ServoEvent> @ 0x00007ffeefbf5d70, event_handler=<unavailable>) at event_loop.rs:154:9
    frame #34: 0x0000000100063100 servo`servo::events_loop::EventsLoop::run_forever::h63bd7ac07288a07f(self=EventsLoop @ 0x00007ffeefbfcba0, callback=closure-0 @ 0x00007ffeefbfcbb8) at events_loop.rs:91:17
    frame #35: 0x00000001000cc13e servo`servo::app::App::run::ha4333ac1b97f8135(no_native_titlebar=false, device_pixels_per_px=Option<f32> @ 0x00007ffeefbfeee8, user_agent=Option<alloc::string::String> @ 0x00007ffeefbff428) at app.rs:68:9
    frame #36: 0x00000001000ff2f9 servo`servo::main::h00e35406e12638f2 at main2.rs:162:5
    frame #37: 0x0000000100081ace servo`core::ops::function::FnOnce::call_once::h98a1242b997620c9((null)=(servo`servo::main::h00e35406e12638f2 at main2.rs:48), (null)=<unavailable>) at function.rs:227:5
    frame #38: 0x0000000100056fa1 servo`std::sys_common::backtrace::__rust_begin_short_backtrace::hde939feab1a1a699(f=(servo`servo::main::h00e35406e12638f2 at main2.rs:48)) at backtrace.rs:125:18
    frame #39: 0x0000000100067724 servo`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h87d78c5aacb43ad9 at rt.rs:66:18
    frame #40: 0x0000000106ba7dd4 servo`std::rt::lang_start_internal::h2d3973544157dbe9 [inlined] core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::h87e98698e5aff40b at function.rs:259:13 [opt]
    frame #41: 0x0000000106ba7dcd servo`std::rt::lang_start_internal::h2d3973544157dbe9 [inlined] std::panicking::try::do_call::hbeb8e3adb45dddd0 at panicking.rs:379 [opt]
    frame #42: 0x0000000106ba7dcd servo`std::rt::lang_start_internal::h2d3973544157dbe9 [inlined] std::panicking::try::h4ebc010a82f8a6ce at panicking.rs:343 [opt]
    frame #43: 0x0000000106ba7dcd servo`std::rt::lang_start_internal::h2d3973544157dbe9 [inlined] std::panic::catch_unwind::hc5143bb9ab9fcac9 at panic.rs:431 [opt]
    frame #44: 0x0000000106ba7dcd servo`std::rt::lang_start_internal::h2d3973544157dbe9 at rt.rs:51 [opt]
    frame #45: 0x0000000100067701 servo`std::rt::lang_start::hd31fa2bbfae10235(main=(servo`servo::main::h00e35406e12638f2 at main2.rs:48), argc=2, argv=0x00007ffeefbff600) at rt.rs:65:5
    frame #46: 0x00000001001001d2 servo`main + 34
    frame #47: 0x00007fff6ba57cc9 libdyld.dylib`start + 1

Probably worth filing as a followup issue, though; that might be a bug in winit.

@jdm

jdm commented Mar 3, 2021 •

Copy link
Copy Markdown
Member

Keyboard input for the openxr window on macOS also doesn't appear to work, but it does work if the original window is focused.

@pecastro

pecastro commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

I've tried to correct the ./Cargo.lock:1: duplicate versions for package errors but I can't seem to find a combination of versions that satisfies the test-tidy requirements and cargo build.

@jdm

jdm commented Mar 4, 2021 •

Copy link
Copy Markdown
Member

Yeah, the fix for the duplicate package versions is to update the list in this file of allowed duplicates.

@pecastro

pecastro commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

One warning left whilst building locally as a result of dfd92ec which I assume was an attempt to fix the sizing to prove a point ?

@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

Oh yeah, you're right. We can revert that specific change that triggered the warning.

@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request Mar 4, 2021
Winit 0.24.0 and surfman

<!-- Please describe your changes on the following line: -->
I've updated Servo to Winit 0.24.0 based on the previous work of @jdm.
I've basically rebased master onto his jdm/winit branch which had the bulk of the work and I brute forced it till it built correcting things here and there as I could.
The build reports a few warnings:

```
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/headed_window.rs:753:12
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 753 |         if input.modifiers.shift() {
00:04:59 Mar 03 10:20:06     |            ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06     = note: `#[warn(deprecated)]` on by default
00:04:59 Mar 03 10:20:06
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/keyutils.rs:263:34
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 263 |         modifiers: get_modifiers(input.modifiers),
00:04:59 Mar 03 10:20:06     |                                  ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06
00:07:06 Mar 03 10:22:13 warning: 2 warnings emitted
00:07:06 Mar 03 10:22:13
00:07:06 Mar 03 10:22:13    Completed servo v0.0.1 bin "servo" in 132.7s
00:07:06 Mar 03 10:22:13     Finished dev [unoptimized + debuginfo] target(s) in 6m 59s
00:07:08 Mar 03 10:22:15 [Warning] Could not generate notification!
00:07:08 Mar 03 10:22:15 Build Completed in 0:07:01
```

And there are a few commits namely b27e09e which I'm not entirely sure of.
I've intentionally left the surfman patch in Cargo.toml so someone else can validate this branch.
Unit tests and smoke test run successfully.
Servo runs but I'm not familiar enough with it to validate how well it does. The window opens and content loads though.

My Rust foo is not great and I could use some help fixing those warnings.

Regards,

PECastro

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x ] `./mach build -d` does not report any errors
A few warnings ...
- [x ] `./mach test-tidy` does not report any errors
A few duplicate version statements but no errors.
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X ] These changes do not require tests because we haven't developed new features or behaviour.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 3f846cd with merge 2f3abd7...

@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

@bors-servo try=wpt-mac retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 3f846cd with merge 7d0c191...

bors-servo added a commit that referenced this pull request Mar 4, 2021
Winit 0.24.0 and surfman

<!-- Please describe your changes on the following line: -->
I've updated Servo to Winit 0.24.0 based on the previous work of @jdm.
I've basically rebased master onto his jdm/winit branch which had the bulk of the work and I brute forced it till it built correcting things here and there as I could.
The build reports a few warnings:

```
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/headed_window.rs:753:12
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 753 |         if input.modifiers.shift() {
00:04:59 Mar 03 10:20:06     |            ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06     = note: `#[warn(deprecated)]` on by default
00:04:59 Mar 03 10:20:06
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/keyutils.rs:263:34
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 263 |         modifiers: get_modifiers(input.modifiers),
00:04:59 Mar 03 10:20:06     |                                  ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06
00:07:06 Mar 03 10:22:13 warning: 2 warnings emitted
00:07:06 Mar 03 10:22:13
00:07:06 Mar 03 10:22:13    Completed servo v0.0.1 bin "servo" in 132.7s
00:07:06 Mar 03 10:22:13     Finished dev [unoptimized + debuginfo] target(s) in 6m 59s
00:07:08 Mar 03 10:22:15 [Warning] Could not generate notification!
00:07:08 Mar 03 10:22:15 Build Completed in 0:07:01
```

And there are a few commits namely b27e09e which I'm not entirely sure of.
I've intentionally left the surfman patch in Cargo.toml so someone else can validate this branch.
Unit tests and smoke test run successfully.
Servo runs but I'm not familiar enough with it to validate how well it does. The window opens and content loads though.

My Rust foo is not great and I could use some help fixing those warnings.

Regards,

PECastro

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x ] `./mach build -d` does not report any errors
A few warnings ...
- [x ] `./mach test-tidy` does not report any errors
A few duplicate version statements but no errors.
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X ] These changes do not require tests because we haven't developed new features or behaviour.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Mar 4, 2021
@jdm
jdm force-pushed the winit_0_24_surfman branch from 3f846cd to fd1c1e9 Compare March 4, 2021 04:12
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Mar 4, 2021
@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

I've published surfman 0.4, and now we need to merge:

@pecastro

pecastro commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

I've removed a file from the check_no_panic.sh script just to make the test pass...

ports/winit/headed_window.rs:142:        } = primary_monitor.clone().unwrap().size();

Is the best way to handle that line to try to match the value somehow or expect ?

@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

@jdm

jdm commented Mar 4, 2021

Copy link
Copy Markdown
Member

We should probably use current_monitor and call expect("No monitor detected") instead of using unwrap.

@pecastro
pecastro force-pushed the winit_0_24_surfman branch from c124d4b to 34a6a3c Compare March 4, 2021 15:55
@pecastro

pecastro commented Mar 4, 2021 •

Copy link
Copy Markdown
Contributor Author

We should probably use current_monitor and call expect("No monitor detected") instead of using unwrap.

There's only an EventLoop to work with ...
Following on your Wayland None spot from the docs I went for the first of available_monitors ?

@pecastro

Copy link
Copy Markdown
Contributor Author

@jdm

jdm commented Mar 12, 2021

Copy link
Copy Markdown
Member

That's a common intermittent failure: #27315

@pecastro

Copy link
Copy Markdown
Contributor Author

Second round of tests results on the mac, the first one always has a few more failures.

paulocastro@mac ~/git/esrc/servo[winit_0_24_surfman]$ python3 ./mach test-wpt tests/wpt/web-platform-tests/url 2>&1 | tee winit_0_24_surfman.1.log
Running 45 tests in web-platform-tests

  [1/45] /url/historical.any.html
  [2/45] /url/url-tojson.any.html
  [3/45] /url/idlharness.any.worker.html
  [4/45] /url/a-element-origin-xhtml.xhtml
  [5/45] /url/data-uri-fragment.html
  [6/45] /url/a-element-xhtml.xhtml
  [7/45] /url/a-element.html
  [8/45] /url/failure.html
  [9/45] /url/idlharness.any.html
  [10/45] /url/urlsearchparams-getall.any.worker.html
  [11/45] /url/url-setters-stripping.any.worker.html
  [12/45] /url/a-element-origin.html
  [13/45] /url/url-searchparams.any.html
  [14/45] /url/url-constructor.any.worker.html
  [15/45] /url/historical.any.worker.html
  [16/45] /url/percent-encoding.window.html
  [17/45] /url/urlsearchparams-sort.any.worker.html
  [18/45] /url/toascii.window.html
  [19/45] /url/url-searchparams.any.worker.html
  [20/45] /url/url-tojson.any.worker.html
  [21/45] /url/url-origin.any.html
  [22/45] /url/urlencoded-parser.any.worker.html
  [23/45] /url/url-origin.any.worker.html
  [24/45] /url/url-constructor.any.html
  [25/45] /url/urlsearchparams-delete.any.worker.html
  [26/45] /url/urlsearchparams-constructor.any.worker.html
  [27/45] /url/urlsearchparams-append.any.worker.html
  [28/45] /url/urlsearchparams-foreach.any.worker.html
  [29/45] /url/urlsearchparams-append.any.html
  [30/45] /url/url-setters-stripping.any.html
  [31/45] /url/urlsearchparams-delete.any.html
  [32/45] /url/urlsearchparams-get.any.html
  ▶ TIMEOUT [expected CRASH] b'/url/url-setters.html'
  │
  └ begin <= end (11 <= 9) when slicing `non-spec://p` (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }, at /Users/paulocastro/.cargo/registry/src/github.com-1ecc6299db9ec823/url-2.2.0/src/lib.rs:2419)

  [34/45] /url/urlsearchparams-has.any.worker.html
  [35/45] /url/urlsearchparams-set.any.html
  [36/45] /url/urlencoded-parser.any.html
  [37/45] /url/urlsearchparams-set.any.worker.html
  [38/45] /url/urlsearchparams-sort.any.html
  [39/45] /url/urlsearchparams-constructor.any.html
  [40/45] /url/urlsearchparams-stringifier.any.worker.html
  [41/45] /url/urlsearchparams-foreach.any.html
  [42/45] /url/urlsearchparams-stringifier.any.html
  [43/45] /url/urlsearchparams-get.any.worker.html
  [44/45] /url/urlsearchparams-getall.any.html
  [45/45] /url/urlsearchparams-has.any.html

Ran 45 tests finished in 44.9 seconds.
  • 44 ran as expected. 0 tests skipped.
  • 1 tests timed out unexpectedly

Tests with unexpected results:
  ▶ TIMEOUT [expected CRASH] b'/url/url-setters.html'
  │
  └ begin <= end (11 <= 9) when slicing `non-spec://p` (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }, at /Users/paulocastro/.cargo/registry/src/github.com-1ecc6299db9ec823/url-2.2.0/src/lib.rs:2419)

paulocastro@mac ~/git/esrc/servo[winit_0_24_surfman]$ uname -a
Darwin mac 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64

@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member

I can reproduce this on the CI machines \o/

@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member

None of the tricks I'm used to made a difference (logging into a particular user over VNC), and I verified that the linux codepath that avoids the winit event loop works. We should change the code to use that path on both linux and macos.

@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member
diff --git a/ports/winit/events_loop.rs b/ports/winit/events_loop.rs
index 3bd82574b3..2d76fe41c3 100644
--- a/ports/winit/events_loop.rs
+++ b/ports/winit/events_loop.rs
@@ -29,11 +29,11 @@ pub struct EventsLoop(EventLoop);
 impl EventsLoop {
     // Ideally, we could use the winit event loop in both modes,
     // but on Linux, the event loop requires a X11 server.
-    #[cfg(not(target_os = "linux"))]
+    #[cfg(not(any(target_os = "linux", target_os = "macos")))]
     pub fn new(_headless: bool) -> EventsLoop {
         EventsLoop(EventLoop::Winit(Some(winit::event_loop::EventLoop::with_user_event())))
     }
-    #[cfg(target_os = "linux")]
+    #[cfg(any(target_os = "linux", target_os = "macos"))]
     pub fn new(headless: bool) -> EventsLoop {
         EventsLoop(if headless {
             EventLoop::Headless(Arc::new((Mutex::new(false), Condvar::new())))

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Mar 14, 2021
@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member

@bors-servo try=wpt-mac

bors-servo added a commit that referenced this pull request Mar 14, 2021
Winit 0.24.0 and surfman

<!-- Please describe your changes on the following line: -->
I've updated Servo to Winit 0.24.0 based on the previous work in #26394.
I've basically rebased master onto his jdm/winit branch which had the bulk of the work and I brute forced it till it built correcting things here and there as I could.
The build reports a few warnings:

```
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/headed_window.rs:753:12
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 753 |         if input.modifiers.shift() {
00:04:59 Mar 03 10:20:06     |            ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06     = note: `#[warn(deprecated)]` on by default
00:04:59 Mar 03 10:20:06
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/keyutils.rs:263:34
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 263 |         modifiers: get_modifiers(input.modifiers),
00:04:59 Mar 03 10:20:06     |                                  ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06
00:07:06 Mar 03 10:22:13 warning: 2 warnings emitted
00:07:06 Mar 03 10:22:13
00:07:06 Mar 03 10:22:13    Completed servo v0.0.1 bin "servo" in 132.7s
00:07:06 Mar 03 10:22:13     Finished dev [unoptimized + debuginfo] target(s) in 6m 59s
00:07:08 Mar 03 10:22:15 [Warning] Could not generate notification!
00:07:08 Mar 03 10:22:15 Build Completed in 0:07:01
```

And there are a few commits namely b27e09e which I'm not entirely sure of.
I've intentionally left the surfman patch in Cargo.toml so someone else can validate this branch.
Unit tests and smoke test run successfully.
Servo runs but I'm not familiar enough with it to validate how well it does. The window opens and content loads though.

My Rust foo is not great and I could use some help fixing those warnings.

Regards,

PECastro

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x ] `./mach build -d` does not report any errors
A few warnings ...
- [x ] `./mach test-tidy` does not report any errors
A few duplicate version statements but no errors.
- [x] These changes fix #26394
- [x] There are tests for these changes
-  [ ] These changes do not require tests because

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 21e3154 with merge 9468693...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-taskcluster
State: approved= try=True

@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 21e3154 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 14, 2021
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 21e3154 with merge b63fe51...

bors-servo added a commit that referenced this pull request Mar 14, 2021
Winit 0.24.0 and surfman

<!-- Please describe your changes on the following line: -->
I've updated Servo to Winit 0.24.0 based on the previous work in #26394.
I've basically rebased master onto his jdm/winit branch which had the bulk of the work and I brute forced it till it built correcting things here and there as I could.
The build reports a few warnings:

```
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/headed_window.rs:753:12
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 753 |         if input.modifiers.shift() {
00:04:59 Mar 03 10:20:06     |            ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06     = note: `#[warn(deprecated)]` on by default
00:04:59 Mar 03 10:20:06
00:04:59 Mar 03 10:20:06 warning: use of deprecated field `winit::event::KeyboardInput::modifiers`: Deprecated in favor of WindowEvent::ModifiersChanged
00:04:59 Mar 03 10:20:06    --> ports/winit/keyutils.rs:263:34
00:04:59 Mar 03 10:20:06     |
00:04:59 Mar 03 10:20:06 263 |         modifiers: get_modifiers(input.modifiers),
00:04:59 Mar 03 10:20:06     |                                  ^^^^^^^^^^^^^^^
00:04:59 Mar 03 10:20:06
00:07:06 Mar 03 10:22:13 warning: 2 warnings emitted
00:07:06 Mar 03 10:22:13
00:07:06 Mar 03 10:22:13    Completed servo v0.0.1 bin "servo" in 132.7s
00:07:06 Mar 03 10:22:13     Finished dev [unoptimized + debuginfo] target(s) in 6m 59s
00:07:08 Mar 03 10:22:15 [Warning] Could not generate notification!
00:07:08 Mar 03 10:22:15 Build Completed in 0:07:01
```

And there are a few commits namely b27e09e which I'm not entirely sure of.
I've intentionally left the surfman patch in Cargo.toml so someone else can validate this branch.
Unit tests and smoke test run successfully.
Servo runs but I'm not familiar enough with it to validate how well it does. The window opens and content loads though.

My Rust foo is not great and I could use some help fixing those warnings.

Regards,

PECastro

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x ] `./mach build -d` does not report any errors
A few warnings ...
- [x ] `./mach test-tidy` does not report any errors
A few duplicate version statements but no errors.
- [x] These changes fix #26394
- [x] There are tests for these changes
-  [ ] These changes do not require tests because

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Mar 14, 2021
@jdm

jdm commented Mar 14, 2021

Copy link
Copy Markdown
Member

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 21e3154 with merge 68e200a...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Mar 14, 2021
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 68e200a to master...

@bors-servo
bors-servo merged commit 68e200a into servo:master Mar 14, 2021
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 14, 2021
@nicoabie

Copy link
Copy Markdown

Excellent!!! I tried to update it but it was beyond my knowledge. This will enable many more things!

@pecastro
pecastro deleted the winit_0_24_surfman branch March 15, 2021 22:26
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.

Update winit

5 participants