Slide 1

Slide 1 text

The Hitchhiker’s Guide to Servo Contributor @_cybai, HERP, Inc. Rust.Tokyo

Slide 2

Slide 2 text

whoami ● Haku ● @CYBAI ● @_cybai ● Software Engineer @ HERP, Inc. ● Contribute to Servo from Aug 2017 2

Slide 3

Slide 3 text

● What is Servo? ● How to contribute? ● How to run tests? ● How Servo CI works? Agenda 3

Slide 4

Slide 4 text

● What is Servo? ● How to contribute? ● How to run tests? ● How Servo CI works? Agenda 4

Slide 5

Slide 5 text

● A modern, high-performance greenfield browser engine designed for both application and embedded use ● Written in Rust ● Aim to achieve parallel and concurrency computing and layout ● Derived memory safety and security from Rust What is Servo? 5

Slide 6

Slide 6 text

What is Servo? (Cont.) ● Two successful components have been migrated into Firefox, e.g. Stylo and WebRender 6

Slide 7

Slide 7 text

Demo 7

Slide 8

Slide 8 text

● What is Servo? ● How to contribute? ● How to run tests? ● How Servo CI works? Agenda 8

Slide 9

Slide 9 text

Workflow 9 Find issue Implementation Test related WPT locally Send / Update PR Review PR merged Run CI passed with r+ Check Failures : Sucess : Failure

Slide 10

Slide 10 text

How to get involved? ● Check E-* labels ○ E stands for Effort here. ○ E-easy and E-less easy are good for new contributors. ○ E-candidate-for-mentoring means it might be an easy issue because members didn’t check it carefully. But, they will mentor you to finish the issue. ○ E-hard means challenging tasks. 10 Ref: Tag label names and definitions

Slide 11

Slide 11 text

How to get involved? (Cont.) ● Check the Servo starter page. ● Find any Web API you’re interested in and it’s missing or implemented incorrectly in Servo! 11

Slide 12

Slide 12 text

12 The first issue I fixed

Slide 13

Slide 13 text

13 From WHATWG DOM spec

Slide 14

Slide 14 text

14

Slide 15

Slide 15 text

15 But, how can I confirm my implementation is correct?

Slide 16

Slide 16 text

● What is Servo? ● How to contribute? ● How to run tests? ● How Servo CI works? Agenda 16

Slide 17

Slide 17 text

WPT ● In Software Engineering, writing tests to verify our business logic is indispensable. ● So do the web platforms! ● Here comes the Web Platform Tests a.k.a wpt. 17

Slide 18

Slide 18 text

“The web-platform-tests project is a W3C-coordinated attempt to build a cross-browser test suite for the Web-platform stack.” -- web-platform-tests.org What is wpt? 18

Slide 19

Slide 19 text

Brief introduction to WPT metadata 19

Slide 20

Slide 20 text

How to run tests with Servo CI? 20 Ask @bors-servo to trigger “try” tests

Slide 21

Slide 21 text

How to run tests with Servo CI? (Cont.) 21 CI tests triggered by try will report tests result when all tests passed instead of merging PR

Slide 22

Slide 22 text

How to run tests with Servo CI? (Cont.) 22 But wait! Let’s see what @jdm said!

Slide 23

Slide 23 text

How to run tests with Servo CI? (Cont.) 23

Slide 24

Slide 24 text

WPT Synchronization 24 Sync new / fixed tests Contribute new / fixed tests

Slide 25

Slide 25 text

25 After upstream tests synced and try again, finally got unexpected PASS!

Slide 26

Slide 26 text

26 Approved by @jdm after the tests marked as PASS

Slide 27

Slide 27 text

But wait! Why not just merge the PR? and what exactly is @bors-servo and r+? 27

Slide 28

Slide 28 text

● What is Servo? ● How to contribute? ● How to run tests? ● How Servo CI works? Agenda 28

Slide 29

Slide 29 text

Homu: The Not Rocket Science™ bors is first introduced by Graydon Hoare who is Rust’s original creator and mainly applied Ben Elliston’s “not rocket science” rule to the bot: 29 The Not Rocket Science Rule Of Software Engineering: automatically maintain a repository of code that always passes all the tests -- Ben Elliston

Slide 30

Slide 30 text

Homu: The Not Rocket Science™ 30 Rename fn foo → fn bar ✅ CI Pass Call fn foo in somewhere ✅ CI Pass ☠ Function foo doesn’t exist ❌ Broken master branch A B

Slide 31

Slide 31 text

Homu: The Not Rocket Science™ 31 Screenshot from Homu Queue

Slide 32

Slide 32 text

32 @bors-servo with r+ merged PR after CI passed

Slide 33

Slide 33 text

Recap 33

Slide 34

Slide 34 text

Recap 34 Write spec compliant tests Implement existing / new spec Contribute new / fixed tests

Slide 35

Slide 35 text

Recap 35 Add / fix tests while changed Contribute spec bugfix or new feature Sync new / fixed tests

Slide 36

Slide 36 text

References ● Experience Report: Developing the Servo Web Browser Engine using Rust ● technicalities: "not rocket science" (the story of monotone and bors) ● Rust infrastructure can be your infrastructure ● Servo: Designing and Implementing a Parallel Browser ● Servo and YOU: A beginner's guide ● Inside a super fast CSS engine: Quantum CSS (aka Stylo) ● The whole web at maximum FPS: How WebRender gets rid of jank 36

Slide 37

Slide 37 text

37 https://blog.cybai.dev/ References

Slide 38

Slide 38 text

Q & A ? 38 We’re hiring!

Slide 39

Slide 39 text

Thank you! @_cybai 39