Closed Bug 1527325 Opened Last year Closed 4 months ago

Refactor the use sections to avoid rebase conflicts

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: kvark, Assigned: kvark)

Details

Attachments

(2 files)

The current use of "use" statements are giant and arbitrarily lined. This causes rebase conflicts, which are especially annoying if they cause changes to fail to land.

One way to address this would be to have an include per line:

use api::{
  Something,
  SomethingElse,
};

Given the number of types we typically include, this would unnecessary pollute the code.

Another approach would be to use more qualified names:

use api;

fn foo(arg: api::Something) -> api::SomethingElse {...}

This approach has a downside of increasing the verbosity of the call sites. This can be partially alleviated by shortening the module names:

use display_item as di;
Assignee: nobody → dmalyshau
Status: NEW → ASSIGNED
Keywords: leave-open
Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/541f044e3e7b
Refactor webrender_api includes r=gw,nical
Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/052b3184c809
Refactor webrender_api includes r=gw,nical

Relanded with changes to make servo-tidy happy

Flags: needinfo?(dmalyshau)

The cleans up our WR use statements further, easying the merge conflicts.
Note: this PR is subject to instant rot, it is preferred to land quickly.

Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/950174a8c708
Don't re-export contents of WR API units r=gw

Backed out changeset 950174a8c708 (bug 1527325) for wrench failures on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/4a45880ddbd0878eadf29eb4146ced658d18464c

**Push with failures:**https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=950174a8c708a11f76452a83ed77b32e2213a8de

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233726487&repo=autoland&lineNumber=2200

Log snippet:

[task 2019-03-13T22:40:23.457Z] 98 | size: api::FramebufferIntSize,
[task 2019-03-13T22:40:23.457Z] | ^^^^^^^^^^^^^^^^^^ not found in api
[task 2019-03-13T22:40:23.457Z] help: possible candidate is found in another module, you can import it into scope
[task 2019-03-13T22:40:23.457Z] |
[task 2019-03-13T22:40:23.457Z] 11 | use webrender::api::units::FramebufferIntSize;
[task 2019-03-13T22:40:23.457Z] |
[task 2019-03-13T22:40:23.457Z]
[task 2019-03-13T22:40:23.457Z] error[E0412]: cannot find type FramebufferIntSize in module api
[task 2019-03-13T22:40:23.457Z] --> direct-composition\src\main_windows.rs:104:48
[task 2019-03-13T22:40:23.457Z] |
[task 2019-03-13T22:40:23.457Z] 104 | device_pixel_ratio: f32, size: api::FramebufferIntSize, r: f32, g: f32, b: f32, a: f32)
[task 2019-03-13T22:40:23.457Z] | ^^^^^^^^^^^^^^^^^^ not found in api
[task 2019-03-13T22:40:23.457Z] help: possible candidate is found in another module, you can import it into scope
[task 2019-03-13T22:40:23.457Z] |
[task 2019-03-13T22:40:23.457Z] 11 | use webrender::api::units::FramebufferIntSize;
[task 2019-03-13T22:40:23.457Z] |
[task 2019-03-13T22:40:23.457Z]
[task 2019-03-13T22:40:23.673Z] error: aborting due to 2 previous errors
[task 2019-03-13T22:40:23.673Z]
[task 2019-03-13T22:40:23.673Z] For more information about this error, try rustc --explain E0412.
[task 2019-03-13T22:40:23.763Z] error: Could not compile direct-composition.
[task 2019-03-13T22:40:23.763Z]
[task 2019-03-13T22:40:23.763Z] Caused by:
[task 2019-03-13T22:40:23.763Z] process didn't exit successfully: rustc --crate-name direct_composition direct-composition\src\main.rs --color never --crate-type bin --emit=dep-info,metadata -C debuginfo=2 -C metadata=a369a2d7222b4a3a -C extra-filename=-a369a2d7222b4a3a --out-dir z:\task_1552514048\build\src\gfx\wr\target\debug\deps -C incremental=z:\task_1552514048\build\src\gfx\wr\target\debug\incremental -L dependency=z:\task_1552514048\build\src\gfx\wr\target\debug\deps --extern direct_composition=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libdirect_composition-774d0a6a38876d05.rmeta --extern euclid=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libeuclid-5c593573341f8625.rmeta --extern gleam=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libgleam-22fca45cd6ff0aeb.rmeta --extern mozangle=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libmozangle-907b9fa44285e6bd.rmeta --extern webrender=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libwebrender-10c621e752138813.rmeta --extern winapi=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libwinapi-0a95d0eead7ad2cd.rmeta --extern winit=z:\task_1552514048\build\src\gfx\wr\target\debug\deps\libwinit-551efed08f6931a7.rmeta --deny warnings -L native=z:\task_1552514048\build\src\gfx\wr\target\debug\build\mozangle-d654a3080dd3b3fd\out (exit code: 1)
[task 2019-03-13T22:40:23.769Z]
[task 2019-03-13T22:40:23.769Z] z:\task_1552514048\build\src\gfx\wr\direct-composition>if 101 NEQ 0 EXIT /b 101
[taskcluster 2019-03-13T22:40:23.810Z] Exit Code: 101
[taskcluster 2019-03-13T22:40:23.810Z] User Time: 0s
[taskcluster 2019-03-13T22:40:23.810Z] Kernel Time: 0s
[taskcluster 2019-03-13T22:40:23.810Z] Wall Time: 41m19.7774424s
[taskcluster 2019-03-13T22:40:23.810Z] Result: FAILED
[taskcluster 2019-03-13T22:40:23.810Z] === Task Finished ===
[taskcluster 2019-03-13T22:40:23.810Z] Task Duration: 41m19.7774424s
[taskcluster 2019-03-13T22:40:24.626Z] Uploading redirect artifact public/logs/live.log to URL https://queue.taskcluster.net/v1/task/Dl3Ko_wMQHyw7JkxSEpkvA/runs/2/artifacts/public/logs/live_backing.log with mime type "text/plain; charset=utf-8" and expiry 2020-03-12T20:13:27.635Z
[taskcluster:error] exit status 101

Flags: needinfo?(dmalyshau)

Thank you! I just had that file fixed but not saved.

Flags: needinfo?(dmalyshau)
Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/64f683055202
Don't re-export contents of WR API units r=gw

The first few changes are in now. We have the units no longer in the way of merging, which is already a big win.
I was wondering if we should turn webrender_api into not publicly re-exporting everything (maybe some things?). For example, display_list is a fairly big module, and the dependent pieces of webrender crate could be importing it either globally, or as dl shortcut.

Priority: -- → P3

The leave-open keyword is there and there is no activity for 6 months.
:kvark, maybe it's time to close this bug?

Flags: needinfo?(dmalyshau)

We can follow up with more specific bugs.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Flags: needinfo?(dmalyshau)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.