Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find toml file @ url crate #13

Open
sabazk opened this issue Mar 31, 2016 · 2 comments · Fixed by servo/rust-url#186
Open

can't find toml file @ url crate #13

sabazk opened this issue Mar 31, 2016 · 2 comments · Fixed by servo/rust-url#186

Comments

@sabazk
Copy link

sabazk commented Mar 31, 2016

$ ./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
Copy link
Contributor

zofrex commented Apr 17, 2016

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.

bors-servo pushed a commit to servo/rust-url that referenced this issue Apr 17, 2016
Make Cargo.toml compatible with TOML spec

Hello!

I think the Cargo.toml for this crate may not be strictly compliant with the TOML specification - I'm not certain, but it's blowing up in pytoml and my reading of the spec sides with pytoml.

The relevant part of the Cargo.toml file:

```
[[test]] name = "format"
```

And the [TOML spec on tables](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md#table):

> They appear in square brackets on a line by themselves

So I think pytoml is right to object here, but I'm fairly new to TOML so please let me know if I'm mis-interpreting and I'll go fix pytoml instead :)

The incompatibility with pytoml is an issue if you are using cargo-bootstrap, and I've tested that my proposed fix here fixes dhuseby/cargo-bootstrap#13

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/186)
<!-- Reviewable:end -->
@zofrex
Copy link
Contributor

zofrex commented Apr 17, 2016

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

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

Successfully merging a pull request may close this issue.

2 participants