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

[rustdoc] stabilize cfg(doctest) #63201

Open
wants to merge 1 commit into
base: master
from

Conversation

@GuillaumeGomez
Copy link
Member

commented Aug 1, 2019

Fixes #62210.

Since we removed rustdoc from providing cfg(test) on test runs, it's been replaced by cfg(doctest). It'd be nice to have it in not too far in the future. :)

cc @rust-lang/rustdoc

r? @ollie27

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 1, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-01T21:20:36.6690942Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-01T21:20:36.6906621Z ##[command]git config gc.auto 0
2019-08-01T21:20:36.6979109Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-01T21:20:36.7049573Z ##[command]git config --get-all http.proxy
2019-08-01T21:20:36.7200702Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63201/merge:refs/remotes/pull/63201/merge
---
2019-08-01T21:21:11.7201498Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-01T21:21:11.7201559Z 
2019-08-01T21:21:11.7201788Z   git checkout -b <new-branch-name>
2019-08-01T21:21:11.7201840Z 
2019-08-01T21:21:11.7201896Z HEAD is now at 37c3cdc2c Merge e82314764554270b264ccf5bc536c2d616e82899 into 435236b8877cdb98c82eaebfb7887782277265c5
2019-08-01T21:21:11.7368334Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-01T21:21:11.7371495Z ==============================================================================
2019-08-01T21:21:11.7371550Z Task         : Bash
2019-08-01T21:21:11.7371596Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-01T21:24:42.3814277Z  ---> 6dade7a1acf6
2019-08-01T21:24:42.3857285Z Successfully built 6dade7a1acf6
2019-08-01T21:24:42.4427221Z Successfully tagged rust-ci:latest
2019-08-01T21:24:42.4938209Z Built container sha256:6dade7a1acf659422882bb85a0af8472c9bc41d0974364480fbd497d41268ea4
2019-08-01T21:24:42.4961248Z Uploading finished image to https://rust-lang-ci-sccache2.s3.amazonaws.com/docker/1bcedfd0fd3b0e1f17865450d97c5f933a700734ac7e085679f2dabcb79f9aa8554228d95a4689fc65827d53828df5be9ba37c197505830ce93978e771921af3
2019-08-01T21:25:43.6469034Z upload failed: - to s3://rust-lang-ci-sccache2/docker/1bcedfd0fd3b0e1f17865450d97c5f933a700734ac7e085679f2dabcb79f9aa8554228d95a4689fc65827d53828df5be9ba37c197505830ce93978e771921af3 Unable to locate credentials
2019-08-01T21:25:44.6023626Z [CI_JOB_NAME=x86_64-gnu-llvm-6.0]
2019-08-01T21:25:44.6072703Z Starting sccache server...
2019-08-01T21:25:44.6973117Z configure: processing command line
2019-08-01T21:25:44.6973225Z configure: 
---
2019-08-01T21:29:24.4784293Z     Finished release [optimized] target(s) in 1m 28s
2019-08-01T21:29:24.4850522Z tidy check
2019-08-01T21:29:25.3330068Z * 578 error codes
2019-08-01T21:29:25.3330191Z * highest error code: E0733
2019-08-01T21:29:25.7086810Z tidy error: Found 1 features without a gate test.
2019-08-01T21:29:25.7088634Z Expected a gate test for the feature 'cfg_doctest'.
2019-08-01T21:29:25.7089397Z Hint: create a failing test file named 'feature-gate-cfg_doctest.rs'
2019-08-01T21:29:25.7090039Z       in the 'ui' test suite, with its failures due to
2019-08-01T21:29:25.7090378Z       missing usage of `#![feature(cfg_doctest)]`.
2019-08-01T21:29:25.7090962Z Hint: If you already have such a test and don't want to rename it,
2019-08-01T21:29:25.7091636Z       you can also add a // gate-test-cfg_doctest line to the test file.
2019-08-01T21:29:26.3675860Z some tidy checks failed
2019-08-01T21:29:26.3686985Z 
2019-08-01T21:29:26.3686985Z 
2019-08-01T21:29:26.3688119Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-08-01T21:29:26.3688527Z 
2019-08-01T21:29:26.3688580Z 
2019-08-01T21:29:26.3700104Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-01T21:29:26.3700187Z Build completed unsuccessfully in 0:01:31
2019-08-01T21:29:26.3700187Z Build completed unsuccessfully in 0:01:31
2019-08-01T21:29:27.7039772Z ##[error]Bash exited with code '1'.
2019-08-01T21:29:27.7074326Z ##[section]Starting: Checkout
2019-08-01T21:29:27.7076262Z ==============================================================================
2019-08-01T21:29:27.7076346Z Task         : Get sources
2019-08-01T21:29:27.7076401Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:stabilize-doctest branch from e823147 to ca0d1d0 Aug 2, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 2, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-02T15:40:20.2461838Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-02T15:40:20.2653034Z ##[command]git config gc.auto 0
2019-08-02T15:40:20.2737363Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-02T15:40:20.2833360Z ##[command]git config --get-all http.proxy
2019-08-02T15:40:20.2973903Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63201/merge:refs/remotes/pull/63201/merge
---
2019-08-02T15:40:57.8074284Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-02T15:40:57.8074316Z 
2019-08-02T15:40:57.8074673Z   git checkout -b <new-branch-name>
2019-08-02T15:40:57.8074701Z 
2019-08-02T15:40:57.8074759Z HEAD is now at 8ff8fc543 Merge ca0d1d0ef78ec63eccbc8cf2d84b98270f4964ac into 1df512fcaeaf17639c5d28a3045814d6f7a7db97
2019-08-02T15:40:57.8234165Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-02T15:40:57.8236725Z ==============================================================================
2019-08-02T15:40:57.8236773Z Task         : Bash
2019-08-02T15:40:57.8236829Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-02T15:47:14.3647711Z     Finished release [optimized] target(s) in 1m 30s
2019-08-02T15:47:14.3685119Z tidy check
2019-08-02T15:47:15.3188993Z * 578 error codes
2019-08-02T15:47:15.3189731Z * highest error code: E0733
2019-08-02T15:47:15.6966399Z Expected a gate test for the feature 'cfg_doctest'.
2019-08-02T15:47:15.6967656Z Hint: create a failing test file named 'feature-gate-cfg_doctest.rs'
2019-08-02T15:47:15.6968198Z       in the 'ui' test suite, with its failures due to
2019-08-02T15:47:15.6968482Z       missing usage of `#![feature(cfg_doctest)]`.
2019-08-02T15:47:15.6968972Z Hint: If you already have such a test and don't want to rename it,
2019-08-02T15:47:15.6969484Z       you can also add a // gate-test-cfg_doctest line to the test file.
2019-08-02T15:47:15.6969930Z tidy error: Found 1 features without a gate test.
2019-08-02T15:47:16.3309204Z some tidy checks failed
2019-08-02T15:47:16.3309389Z 
2019-08-02T15:47:16.3309389Z 
2019-08-02T15:47:16.3310452Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-08-02T15:47:16.3310834Z 
2019-08-02T15:47:16.3310862Z 
2019-08-02T15:47:16.3317588Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-02T15:47:16.3317709Z Build completed unsuccessfully in 0:01:33
2019-08-02T15:47:16.3317709Z Build completed unsuccessfully in 0:01:33
2019-08-02T15:47:17.6627090Z ##[error]Bash exited with code '1'.
2019-08-02T15:47:17.6658095Z ##[section]Starting: Checkout
2019-08-02T15:47:17.6659743Z ==============================================================================
2019-08-02T15:47:17.6659799Z Task         : Get sources
2019-08-02T15:47:17.6659863Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:stabilize-doctest branch from ca0d1d0 to 7dcf3f0 Aug 2, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 2, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-02T16:17:57.2214762Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-02T16:17:57.2402817Z ##[command]git config gc.auto 0
2019-08-02T16:17:57.2467631Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-02T16:17:57.2516606Z ##[command]git config --get-all http.proxy
2019-08-02T16:17:57.2659993Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63201/merge:refs/remotes/pull/63201/merge
---
2019-08-02T16:18:32.0369807Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-02T16:18:32.0369832Z 
2019-08-02T16:18:32.0370025Z   git checkout -b <new-branch-name>
2019-08-02T16:18:32.0370051Z 
2019-08-02T16:18:32.0370108Z HEAD is now at 89fd48a0b Merge 7dcf3f0b42fc713c6155a924d37cebfbeece4dbf into 1df512fcaeaf17639c5d28a3045814d6f7a7db97
2019-08-02T16:18:32.0524544Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-02T16:18:32.0527546Z ==============================================================================
2019-08-02T16:18:32.0527613Z Task         : Bash
2019-08-02T16:18:32.0527652Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-02T16:24:42.5165728Z     Finished release [optimized] target(s) in 1m 26s
2019-08-02T16:24:42.5227546Z tidy check
2019-08-02T16:24:43.4949242Z * 578 error codes
2019-08-02T16:24:43.4950272Z * highest error code: E0733
2019-08-02T16:24:43.8224997Z Expected a gate test for the feature 'cfg_doctest'.
2019-08-02T16:24:43.8225347Z Hint: create a failing test file named 'feature-gate-cfg_doctest.rs'
2019-08-02T16:24:43.8225652Z       in the 'ui' test suite, with its failures due to
2019-08-02T16:24:43.8225709Z       missing usage of `#![feature(cfg_doctest)]`.
2019-08-02T16:24:43.8225957Z Hint: If you already have such a test and don't want to rename it,
2019-08-02T16:24:43.8226233Z       you can also add a // gate-test-cfg_doctest line to the test file.
2019-08-02T16:24:43.8226288Z tidy error: Found 1 features without a gate test.
2019-08-02T16:24:44.4080413Z some tidy checks failed
2019-08-02T16:24:44.4082650Z 
2019-08-02T16:24:44.4082650Z 
2019-08-02T16:24:44.4084574Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-08-02T16:24:44.4084787Z 
2019-08-02T16:24:44.4084815Z 
2019-08-02T16:24:44.4094946Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-02T16:24:44.4095020Z Build completed unsuccessfully in 0:01:29
2019-08-02T16:24:44.4095020Z Build completed unsuccessfully in 0:01:29
2019-08-02T16:24:45.7042569Z ##[error]Bash exited with code '1'.
2019-08-02T16:24:45.7099444Z ##[section]Starting: Checkout
2019-08-02T16:24:45.7100895Z ==============================================================================
2019-08-02T16:24:45.7100942Z Task         : Get sources
2019-08-02T16:24:45.7100983Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:stabilize-doctest branch from 7dcf3f0 to 07ab24b Aug 3, 2019

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

commented Aug 10, 2019

Ping @rust-lang/rustdoc

r? @Mark-Simulacrum

Btw, like said multiple times, a few (very big) crates depend on this feature because it's replacing cfg(test) for rustdoc. Having it hit stable as soon as possible is something I'd really like.

@RalfJung

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

See #62210 (comment): AFAIK no decision was made yet by the relevant team(s) (whichever ones that would be) which approach is the right one. The revert happened because just adding --cfg test in rustdoc test collection broke something that worked since pre-1.0 (libcore doc tests) -- in that case the process is to first back out the breaking change, and then discuss whether this is acceptable breakage given the benefits or not.

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

I think the implementation here looks good. However, I agree that the discussion @RalfJung notes should happen prior to landing stabilization.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

commented Aug 11, 2019

The original cfg(test) has already been reverted which is why I opened this PR (so no breakage considering nothing has been stabilized). I'm still waiting for team approval though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.