Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

fixes cargo build command on osx #28

Open
wants to merge 2 commits into
base: servo
Choose a base branch
from
Open

fixes cargo build command on osx #28

wants to merge 2 commits into from

Conversation

zolkko
Copy link

@zolkko zolkko commented Aug 10, 2014

These changes allows to use servo/rust-http repository as a dependency in Cargo.toml

Here is a sample program:

extern crate url;
extern crate http;

fn mian() -> () {
    let url: url::Url = Url::parse("http://example.com/example?test").unwrap();
    let request: http::client::RequestWriter = http::client::RequestWriter::new(Get, url).unwrap();
    println!("test = {}", request.url);
}

and Cargo.toml which I use:

...
[[bin]]
name = "blumenplace-border"
path = "src/main.rs"
[dependencies.url]
git = "https://github.com/servo/rust-url.git"
[dependencies.http]
git = "https://github.com/zolkko/rust-http.git"

Beside this, it seems like, Cargo requires that a repository contained a branch named "master". Otherwise there will be following error:

cargo build --verbose
    Updating git repository `https://github.com/servo/rust-http.git`
Unable to update https://github.com/servo/rust-http.git

Caused by:
 10 #[phase(plugin, link)] extern crate log;
  Executing `git rev-parse master` failed

Caused by:
  Could not execute process `git rev-parse master` (status=128)
--- stdout
master

--- stderr
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Review on Reviewable

@zolkko
Copy link
Author

zolkko commented Aug 10, 2014

I mean, for sure, It would make more sense to fix this in Makefile. Just wanted to point out that there is a issue.

@SimonSapin
Copy link
Member

Have you tried using the upstream rust-http repository? https://github.com/chris-morgan/rust-http This one is meant for use in Servo and therefore may have some build system quirks and be behind in terms of Rust language upgrades.

@zolkko
Copy link
Author

zolkko commented Aug 11, 2014

I started using servo's repo because of deprecated url module. But at the moment chris-morgan/rust-http uses rust-url as well. So I changed dependency declaration back to chris-morgan/rust-http repository. And it works like a charm. Thank you very much for your answer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants