Skip to content

The source view is not available when crate failed to build. #607

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

Closed
pftbest opened this issue Feb 13, 2020 · 8 comments · Fixed by #928
Closed

The source view is not available when crate failed to build. #607

pftbest opened this issue Feb 13, 2020 · 8 comments · Fixed by #928
Assignees
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature E-easy Effort: Should be easy to implement and would make a good first PR mentor This has instructions for getting started P-medium Medium priority

Comments

@pftbest
Copy link

pftbest commented Feb 13, 2020

It should be possible to view the source code of a crate even if it failed to compile for some reason. I think some time ago this was working correctly, but I'm not sure.

It seems docs.rs is the only website on the internet which allows you to read the source code of a crate, because github link is often missing and even if it's not it contains a different source code than an actual crate version. It is very unfortunate that you are not able to see the source just because it failed to compile on docs.rs platform.

Example links:
https://docs.rs/crate/libui-sys/0.1.9/source/
https://docs.rs/crate/stm32ral/0.3.1/source/

@jyn514
Copy link
Member

jyn514 commented Feb 13, 2020

I think this should be as simple as moving this block outside of the if res.result.successful block:

debug!("adding sources into database");

@jyn514 jyn514 added the E-easy Effort: Should be easy to implement and would make a good first PR label Feb 13, 2020
@jyn514 jyn514 added the mentor This has instructions for getting started label Feb 23, 2020
@jyn514
Copy link
Member

jyn514 commented Apr 1, 2020

Testing instructions: Once you've gotten set up (either with docker-compose or natively), run a build for a crate that you know will fail to build. You can choose any crate off of https://docs.rs/releases/recent-failures.

# for docker-compose
docker-compose run web build crate <name> <version>
# running locally
cargo run build crate <name> <version>

You can then go to http://localhost:3000, click on the crate name, and click 'Source' in the top-left. It should show a list of all the files in the crate, including a Cargo.toml.

I expect this to also add sources for binaries when fixed, if you could test that as well that would be great, for example with bat 0.13.0.

@pftbest
Copy link
Author

pftbest commented Apr 17, 2020

The same problem with binary crates. They all lost the source code too. Examples: cargo-bloat, ripgrep.

@pftbest

This comment has been minimized.

@jyn514

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Jun 8, 2020

This would be fixed by #826.

@jyn514

This comment has been minimized.

@pftbest
Copy link
Author

pftbest commented Jun 12, 2020

Thank you!

@jyn514 jyn514 added P-medium Medium priority and removed wishlist labels Jun 27, 2020
@jyn514 jyn514 self-assigned this Aug 2, 2020
@jyn514 jyn514 added A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature labels Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature E-easy Effort: Should be easy to implement and would make a good first PR mentor This has instructions for getting started P-medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants