servo / servo

Servo, the embeddable, independent, memory-safe, modular, parallel web rendering engine
https://servo.org
Mozilla Public License 2.0
27.95k stars 2.98k forks source link

Ability to save a build and restore it for faster bisecting #14258

Open shinglyu opened 7 years ago

shinglyu commented 7 years ago

Rational:

When working on layout/css, I usually need to compare the reftest result before/after a patch, sometimes even comparing between multiple branches. Needing to rebuild before we run a test is not very efficient. We could workaround this by saving the test result, but you never know which test is required.

Proposal:

Let's build a mach command like this (just a rough idea)

Use case

Any feedback is welcome, especially on naming :)

highfive commented 7 years ago

cc @Wafflespeanut

nox commented 6 years ago

Was any progress made on that?

jdm commented 6 years ago

No, but this sounds useful.

tigercosmos commented 6 years ago

Looks interesting.

tigercosmos commented 6 years ago

I think we can add a command

# Use current branch to test previous build
./mach test --cache <hash>
ysimonson commented 6 years ago

This would be so useful for my rust projects as well! I wonder if it might make sense to implement this as a custom cargo command, rather than via mach? Would y'all be opposed to that?

jdm commented 6 years ago

A custom cargo command sounds useful, but it might be tricky to allow it to work with Servo due to our peculiarities. I don't think we would spend any time porting our solution to Rust and making it generic, as a result.

ysimonson commented 6 years ago

If it's not too much trouble, could you expound on what those peculiarities are? I'm assuming it'd be useful to know them regardless of how this might be implemented.

jdm commented 6 years ago

We have DMG and MSI nightlies for macOS and Windows, so there are special ways to unpack those so the binaries can actually be executed.

u7693 commented 3 years ago

I wrote a simple code. It takes a lot of time to copy files as shown below.

$ time ./mach cache store
./mach cache store  5.39s user 45.15s system 82% cpu 1:01.56 total

I think it can be solved by using symlinks. Could you let me know your thoughts?

jdm commented 3 years ago

Interesting! I'm no longer sure if this is a good idea, though, rather than having two different working directories. My fear with swapping out cached builds would be getting confused about what the current state of the target directory is, relative to the contents of the source files. With multiple working directories, this is not a problem.