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

emit error when doc generation fails #55933

Merged
merged 1 commit into from Dec 5, 2018

Conversation

Projects
None yet
10 participants
@euclio
Copy link
Contributor

euclio commented Nov 13, 2018

Fixes #41813.

The diagnostic looks something like this:

error: couldn't generate documentation: No space left on device (os error 28)
  |
  = note: failed to create or modify "/path/to/crate/target/doc/src/lazycell"
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 13, 2018

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Nov 20, 2018

Ping form triage @steveklabnik / @rust-lang/rustdoc: This PR requires your review.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Nov 20, 2018

@QuietMisdreavus or @GuillaumeGomez should be r+'ing this, not me

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Nov 21, 2018

Looks nice! Please add a rustdoc-ui test and then I r+.

@euclio

This comment has been minimized.

Copy link
Contributor

euclio commented Nov 21, 2018

I'd like to, but I'm not sure how to simulate filesystem errors in a UI test.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Nov 21, 2018

Ah that's a good point...

@rust-lang/infra Does anyone knows how to simulate a full disk?

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Nov 22, 2018

what about write to a location which you have no permission? this will need to be changed to a run-make test though.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Nov 22, 2018

Hard to write an all-OSes test...

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Nov 30, 2018

It may be enough to make it run on just Unix, though. The trick is just to make sure it outputs the right kind of error message when it encounters a filesystem error, even if the nature of that error doesn't matter much. Plus, plenty of other run-make-fulldeps tests skip running on Windows, so at least there's precedent there. At its core, we basically need to make sure that it doesn't say "internal compiler error" (or whatever the right capitalization should be) when it hits this error, right? If you want, i could try to sketch it out.

Otherwise, i quite like this PR. (I'm also not opposed to landing it as-is, since it's effectively just changing the way rustdoc prints certain kinds of errors.)

@euclio

This comment has been minimized.

Copy link
Contributor

euclio commented Dec 3, 2018

@QuietMisdreavus pushed a run-make test that checks that it doesn't ICE.

all:
mkdir -p $(OUTPUT_DIR)
chmod u-w $(OUTPUT_DIR)
-$(shell $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs)

This comment has been minimized.

@QuietMisdreavus

QuietMisdreavus Dec 4, 2018

Member

Does this save the exit status into $(.SHELLSTATUS) for later? I'm not familiar with this syntax.

This comment has been minimized.

@QuietMisdreavus

QuietMisdreavus Dec 4, 2018

Member

Cool, thanks for the link!

Show resolved Hide resolved src/librustdoc/lib.rs Outdated

@euclio euclio force-pushed the euclio:doc-panic branch 2 times, most recently from d4325f0 to e2fa3c1 Dec 4, 2018

@QuietMisdreavus
Copy link
Member

QuietMisdreavus left a comment

Excellent, thanks so much! r=me when travis is green.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Dec 5, 2018

@bors: r=QuietMisdreavus

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 5, 2018

📌 Commit e2fa3c1 has been approved by QuietMisdreavus

kennytm added a commit to GuillaumeGomez/rust that referenced this pull request Dec 5, 2018

Rollup merge of rust-lang#55933 - euclio:doc-panic, r=QuietMisdreavus
emit error when doc generation fails

Fixes rust-lang#41813.

The diagnostic looks something like this:

```
error: couldn't generate documentation: No space left on device (os error 28)
  |
  = note: failed to create or modify "/path/to/crate/target/doc/src/lazycell"
```

bors added a commit that referenced this pull request Dec 5, 2018

Auto merge of #56531 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 19 pull requests

Successful merges:

 - #51753 (Document `From` implementations)
 - #55563 (Improve no result found sentence in doc search)
 - #55933 (emit error when doc generation fails)
 - #55987 (Add Weak.ptr_eq)
 - #56119 (Utilize `?` instead of `return None`.)
 - #56250 (Introduce ptr::hash for references)
 - #56332 ([rustdoc] Specific crate search)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56388 (More MIR borrow check cleanup)
 - #56424 (Mention raw-ident syntax)
 - #56441 (rustbuild: Fix issues with compiler docs)
 - #56452 (Remove redundant clones)
 - #56456 (Handle existential types in dead code analysis)
 - #56466 (data_structures: remove tuple_slice)
 - #56476 (Fix invalid line number match)
 - #56497 (cleanup: remove static lifetimes from consts in libstd)
 - #56498 (Fix line numbers display)
 - #56523 (Added a bare-bones eslint config (removing jslint))
 - #56525 (Avoid extra copy and syscall in std::env::current_exe)
@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Dec 5, 2018

@bors r-

The test did not pass on Windows. See #56531 (comment)

---- [run-make] run-make-fulldeps\rustdoc-io-error stdout ----
error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
make[1]: Entering directory '/c/projects/rust/src/test/run-make-fulldeps/rustdoc-io-error'
make[1]: Leaving directory '/c/projects/rust/src/test/run-make-fulldeps/rustdoc-io-error'
------------------------------------------
stderr:
------------------------------------------
make[1]: *** No targets.  Stop.
------------------------------------------
thread '[run-make] run-make-fulldeps\rustdoc-io-error' panicked at 'explicit panic', src\tools\compiletest\src\runtest.rs:3284:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
    [run-make] run-make-fulldeps\rustdoc-io-error
test result: FAILED. 192 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
thread 'main' panicked at 'Some tests failed', src\tools\compiletest\src\main.rs:503:22

@euclio euclio force-pushed the euclio:doc-panic branch from e2fa3c1 to c359f98 Dec 5, 2018

@euclio

This comment has been minimized.

Copy link
Contributor

euclio commented Dec 5, 2018

The test was missing an else branch that runs an empty target. Fixed.

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Dec 5, 2018

r=me pending travis

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Dec 5, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 5, 2018

📌 Commit c359f98 has been approved by QuietMisdreavus

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 5, 2018

⌛️ Testing commit c359f98 with merge 14997d5...

bors added a commit that referenced this pull request Dec 5, 2018

Auto merge of #55933 - euclio:doc-panic, r=QuietMisdreavus
emit error when doc generation fails

Fixes #41813.

The diagnostic looks something like this:

```
error: couldn't generate documentation: No space left on device (os error 28)
  |
  = note: failed to create or modify "/path/to/crate/target/doc/src/lazycell"
```
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 5, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing 14997d5 to master...

@bors bors merged commit c359f98 into rust-lang:master Dec 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Dec 7, 2018

@michaelwoerister That makes no sense, I'd suspect an issue with the perf setup.

@euclio euclio deleted the euclio:doc-panic branch Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment