diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2016-12-23 18:48:08 +0100 |
---|---|---|
committer | Gregory <gterzian@users.noreply.github.com> | 2016-12-23 23:43:07 +0100 |
commit | 44e808b5cfd6756a5fb44951575035bf9451932c (patch) | |
tree | 87ac4b6d1b037e2eb7dfebbfaf3755f68eb1980d /docs | |
parent | dd2aa4195ab1ac853a5b80c6aa0a0d9c1fae055c (diff) | |
download | servo-44e808b5cfd6756a5fb44951575035bf9451932c.tar.gz servo-44e808b5cfd6756a5fb44951575035bf9451932c.zip |
update "Working on a Crate" in HACKING_QUICKSTART
Diffstat (limited to 'docs')
-rw-r--r-- | docs/HACKING_QUICKSTART.md | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/docs/HACKING_QUICKSTART.md b/docs/HACKING_QUICKSTART.md index d391ae5da08..b97d6a5ff4b 100644 --- a/docs/HACKING_QUICKSTART.md +++ b/docs/HACKING_QUICKSTART.md @@ -108,20 +108,29 @@ This is how my projects are laid out: ``` ~/my-projects/servo/ -~/my-projects/cocoa-rs/ -~/my-projects/glutin/ +~/my-projects/mozjs/ ``` +Both folder are git repositories. -These are all git repositories. +To make it so that servo uses `~/my-projects/mozjs/`, first ascertain which version of the crate Servo is using and whether it is a git dependency or one from crates.io. -To make it so that servo uses `~/my-projects/cocoa-rs/` and `~/my-projects/glutin/` , create a `~/my-projects/servo/.cargo/config` file: +Both information can be found using, in this example, `/mach cargo pkgid mozjs_sys`(`mozjs_sys` is the actual crate name, which doesn't necessarily match the repo folder name). -``` shell -$ cat ~/my-projects/servo/.cargo/config -paths = ['../glutin', '../cocoa-rs'] +If the output is in the format `https://github.com/servo/mozjs#mozjs_sys:0.0.0`, you are dealing with a git dependency and you will have to edit the `~/my-projects/servo/Cargo.toml` file and add at the bottom: + +``` toml +[replace] +"https://github.com/servo/mozjs#mozjs_sys:0.0.0" = { path = '../mozjs' } +``` + +If the output is in the format `https://github.com/rust-lang/crates.io-index#mozjs_sys#0.0.0`, you are dealing with a crates.io dependency and you will have to edit the `~/my-projects/servo/Cargo.toml` in the following way: + +``` toml +[replace] +"mozjs_sys:0.0.0" = { path = '../mozjs' } ``` -This will tell any cargo project to not use the online version of the dependency, but your local clone. +Both will tell any cargo project to not use the online version of the dependency, but your local clone. For more details about overriding dependencies, see [Cargo's documentation](http://doc.crates.io/specifying-dependencies.html#overriding-dependencies). |