Closed nelsonjchen closed 8 years ago
According to git blame
line 7 hasn't been added since sept 2014, so definitely. :)
I'm looking into this.
Hey! I'm afraid I'm not having that problem. Here's what I did:
cargo doc && cargo run --example doc_server
Then I browsed to localhost:3000
and got this:
Can you please confirm you're experiencing something different? Can you tell me your rustc
version, and your operating system?
7346d72b6120a2f71e6dc6a46c53e79baf1ef7b0 fixed the example commands.
rustc 1.10.0 (cfcb716cf 2016-07-03)
OS X 10.11.6.
Case Insensitive HFS+
Ahh I'm on rustc 1.12.0-nightly (936bfea94 2016-07-20)
. I'll try an older version...
I can try a newer version too.
rustc 1.10.0 (cfcb716cf 2016-07-03)
seems to work as well. I'm on Linux, do you know anyone who can test on OS X?
Are you testing this on master? I wonder if #81 is causing this for you.
I am indeed testing on master.
@nelsonjchen Can you confirm the router
example is also not working for you?
It works. The hello
route works and ,π, the off by one letter static file mount route "doc
s" also appears to work.
Hold on, that's with this rust version.
rustc 1.12.0-nightly (feeca9457 2016-07-26)
π . Odd, now things seem to work, at least on this MacBook.
I could have sworn I was doing cargo doc --open
and seeing docs and then wondering what's happening with staticfile
's doc_server
. I still have another Macbook with the same symptom, but it's a few miles away and a few hours away in schedule for me to get to.
That is with rustc 1.10.0 (cfcb716cf 2016-07-03). Just works. π . I'll close this for now. I'm like 80% sure I'm doing something stupid here. If I can still reproduce it on that other MacBook, I'll be sure to comment.
I left the lid open and I was able to remote into the other Macbook.
I was able to reproduce this issue. I checked I was running the current stable. I ran cargo doc
and I got no output, so I guess it was up-to-date. I ran cargo run --example doc_server
. I checked that I was accessing http://127.0.0.1/doc/
, without the "s". I still got a blank page. I ran cargo doc --open
and got the docs. I moved this local repository away.
I made another clone of the repository and repeated the steps but this time when I visited "http://127.0.0.1/doc/", it worked! π
I guess something bad compilation artifacts were affecting things. Maybe I just ran the example at a bad time and kept on building it with the "bad time"'s Lockfile where some dependency broke for a few moments. That would explain why things are working now.
Hmm... I just confirmed it. It was just that. When I use this Cargo.lock, doc_server
results in a blank page. Here's the lockfile.
https://gist.github.com/nelsonjchen/a7707b9cfac1acb4c8b61748e4087e42
@Hoverbear , thank you for your help!
Having done a diff, I guess 0.2.1 of iron/mount fixed my issue. π
Ahhh ha! Glad we caught it!
https://github.com/iron/staticfile/blob/2ac0d6048415bb9e9f4ae169248225df8cb1996b/examples/doc_server.rs#L7
For starters, I'm not sure why we should run
cargo test
to run an example.Second, the
doc_server
binary would not be generated from these instructions. Perhaps we meant to saycargo run --example doc_server
? Was--example
introduced after this example?That said, the "doesn't appear to work" comes from the last instruction, "point your browser to http://127.0.0.1:3000/doc/". If I do that, I get a blank page. I get this from cURL request to that endpoint.
I do get the
COPYRIGHT.txt
and any other content below the/
route like http://127.0.0.1:3000/COPYRIGHT.txt, but thedoc
andsrc
appear to end with 404s. Am I doing something wrong?