dhuseby / cargo-bootstrap

Bootstrapping script for Rust Cargo when cross-compilation is difficult or impossible.
BSD 2-Clause "Simplified" License
37 stars 9 forks source link

can't find toml file @ url crate #13

Open sabazk opened 8 years ago

sabazk commented 8 years ago

$ ./bootstrap.py --cargo-root /home/javan/apps/cargo --crate-index ./index --target-dir ./out --target x86_64-unknown-openbsd

cargo: Looking up info for url ^0.5.7 cargo: opening crate info: ./index/3/u/url cargo: best match is url-0.5.7

/home/javan/apps/cargo-bootstrap/bootstrap.py(1148)crate_info_from_toml() -> dbg('failed to load toml file for: %s (%s)' % (cdir, str(e))) (Pdb)

zofrex commented 8 years ago

I think the url crate may be the issue here, not the script, but I'm less than certain.

The url crate's Cargo.toml:

[[test]] name = "format"
[[test]] name = "form_urlencoded"
[[test]] name = "idna"
[[test]] name = "punycode"
[[test]] name = "tests"
[[test]]
name = "wpt"
harness = false

The TOML spec on tables:

They appear in square brackets on a line by themselves

Changing the url crate's TOML file (in my local output directory) to the following fixed the issue:

[[test]]
name = "format"
[[test]]
name = "form_urlencoded"
[[test]]
name = "idna"
[[test]]
name = "punycode"
[[test]]
name = "tests"
[[test]]
name = "wpt"
harness = false

Quick fix if you're stuck on this same issue:

sed -i"" -e 's/\(\[\[test\]\]\) /\1\
/' /path/to/target/dir/url-0.5.9/Cargo.toml

I've filed a PR against the url crate as I believe that's where the problem lies.

zofrex commented 8 years ago

The url crate accepted the PR, so this should fix itself in time.