Skip to content

Commit c528b8c

Browse files
committed
Auto merge of #134907 - Kobzol:rustc-dev-guide-josh, r=ehuss
Turn rustc-dev-guide into a Josh subtree Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/196385-t-compiler.2Fwg-rustc-dev-guide/topic/a.20move.20to.20main.20repo.20.28rust-lang.2Frust.29). Accompanying rustc-dev-guide PR: rust-lang/rustc-dev-guide#2183 I didn't create a bootstrap step for rustc-dev-guide yet, because the rustc-dev-guide version that we currently use in this repo doesn't have linkcheck enabled and that fails tests. The subtree starts with commit [ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e](rust-lang/rustc-dev-guide@ad93c5f). What I did: ``` export DIR=src/doc/rustc-dev-guide # Remove submodule git submodule status ${DIR} git submodule deinit ${DIR} git rm -r --cached ${DIR} rm -rf ${DIR} # Remove rustc-dev-guide from .gitmodules git commit -m"Removed `${DIR}` submodule" # Import history with josh git fetch https://github.com/rust-lang/rustc-dev-guide ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e josh-filter ':prefix=src/doc/rustc-dev-guide' FETCH_HEAD git merge --allow-unrelated FILTERED_HEAD # A few follow-up cleanup commits ``` r? ehuss
2 parents 504f4f5 + 47e2baa commit c528b8c

File tree

250 files changed

+348506
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+348506
-41
lines changed

.gitmodules

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
path = library/stdarch
2323
url = https://github.com/rust-lang/stdarch.git
2424
shallow = true
25-
[submodule "src/doc/rustc-dev-guide"]
26-
path = src/doc/rustc-dev-guide
27-
url = https://github.com/rust-lang/rustc-dev-guide.git
28-
shallow = true
2925
[submodule "src/doc/edition-guide"]
3026
path = src/doc/edition-guide
3127
url = https://github.com/rust-lang/edition-guide.git

src/bootstrap/src/core/build_steps/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ macro_rules! book {
6363
}
6464

6565
// NOTE: When adding a book here, make sure to ALSO build the book by
66-
// adding a build step in `src/bootstrap/builder.rs`!
66+
// adding a build step in `src/bootstrap/code/builder/mod.rs`!
6767
// NOTE: Make sure to add the corresponding submodule when adding a new book.
6868
// FIXME: Make checking for a submodule automatic somehow (maybe by having a list of all submodules
6969
// and checking against it?).

src/bootstrap/src/core/build_steps/test.rs

-29
Original file line numberDiff line numberDiff line change
@@ -2525,35 +2525,6 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
25252525
}
25262526
}
25272527

2528-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2529-
pub struct RustcGuide;
2530-
2531-
impl Step for RustcGuide {
2532-
type Output = ();
2533-
const DEFAULT: bool = false;
2534-
const ONLY_HOSTS: bool = true;
2535-
2536-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2537-
run.path("src/doc/rustc-dev-guide")
2538-
}
2539-
2540-
fn make_run(run: RunConfig<'_>) {
2541-
run.builder.ensure(RustcGuide);
2542-
}
2543-
2544-
fn run(self, builder: &Builder<'_>) {
2545-
let relative_path = "src/doc/rustc-dev-guide";
2546-
builder.require_submodule(relative_path, None);
2547-
2548-
let src = builder.src.join(relative_path);
2549-
let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook).delay_failure();
2550-
rustbook_cmd.arg("linkcheck").arg(&src);
2551-
let toolstate =
2552-
if rustbook_cmd.run(builder) { ToolState::TestPass } else { ToolState::TestFail };
2553-
builder.save_toolstate("rustc-dev-guide", toolstate);
2554-
}
2555-
}
2556-
25572528
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
25582529
pub struct CrateLibrustc {
25592530
compiler: Compiler,

src/bootstrap/src/core/build_steps/toolstate.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ static STABLE_TOOLS: &[(&str, &str)] = &[
7676
// We do require that we checked whether they build or not on the tools builder,
7777
// though, as otherwise we will be unable to file an issue if they start
7878
// failing.
79-
static NIGHTLY_TOOLS: &[(&str, &str)] = &[
80-
("embedded-book", "src/doc/embedded-book"),
81-
// ("rustc-dev-guide", "src/doc/rustc-dev-guide"),
82-
];
79+
static NIGHTLY_TOOLS: &[(&str, &str)] = &[("embedded-book", "src/doc/embedded-book")];
8380

8481
fn print_error(tool: &str, submodule: &str) {
8582
eprintln!();

src/bootstrap/src/core/builder/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ impl<'a> Builder<'a> {
951951
test::UnstableBook,
952952
test::RustcBook,
953953
test::LintDocs,
954-
test::RustcGuide,
955954
test::EmbeddedBook,
956955
test::EditionGuide,
957956
test::Rustfmt,

src/doc/rustc-dev-guide

-1
This file was deleted.

src/doc/rustc-dev-guide/.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[src/*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
max_line_length = 100
7+
8+
[ci/*.sh]
9+
indent_style = space
10+
indent_size = 2
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto eol=lf
3+
4+
# git grep shouldn't match entries in huge minified javascript
5+
*.min.js binary
6+
7+
# Older git versions try to fix line endings on images, this prevents it.
8+
*.png binary
9+
*.jpg binary
10+
*.ico binary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
schedule:
9+
# Run at 18:00 UTC every day
10+
- cron: '0 18 * * *'
11+
12+
jobs:
13+
ci:
14+
if: github.repository == 'rust-lang/rustc-dev-guide'
15+
runs-on: ubuntu-latest
16+
env:
17+
MDBOOK_VERSION: 0.4.21
18+
MDBOOK_LINKCHECK2_VERSION: 0.8.1
19+
MDBOOK_MERMAID_VERSION: 0.12.6
20+
MDBOOK_TOC_VERSION: 0.11.2
21+
DEPLOY_DIR: book/html
22+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
# linkcheck needs the base commit.
28+
fetch-depth: 0
29+
30+
- name: Cache binaries
31+
id: mdbook-cache
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.cargo/bin
36+
key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }}
37+
38+
- name: Cache linkcheck
39+
uses: actions/cache@v4
40+
with:
41+
path: |
42+
~/book/linkcheck
43+
key: ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }}
44+
45+
- name: Install latest nightly Rust toolchain
46+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
47+
run: |
48+
rustup update nightly
49+
rustup override set nightly
50+
51+
- name: Install Dependencies
52+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
53+
run: |
54+
cargo install mdbook --version ${{ env.MDBOOK_VERSION }}
55+
cargo install mdbook-linkcheck2 --version ${{ env.MDBOOK_LINKCHECK2_VERSION }}
56+
cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }}
57+
cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}
58+
59+
- name: Check build
60+
run: ENABLE_LINKCHECK=1 mdbook build
61+
62+
- name: Deploy to gh-pages
63+
if: github.event_name == 'push'
64+
run: |
65+
touch "${{ env.DEPLOY_DIR }}/.nojekyll"
66+
cp CNAME "${{ env.DEPLOY_DIR }}"
67+
cd "${{ env.DEPLOY_DIR }}"
68+
rm -rf .git
69+
git init
70+
git config user.name "Deploy from CI"
71+
git config user.email ""
72+
git add .
73+
git commit -m "Deploy ${GITHUB_SHA} to gh-pages"
74+
git push --quiet -f "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}" HEAD:gh-pages
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Date-Check
2+
3+
on:
4+
schedule:
5+
# Run at noon UTC every 1st of the month
6+
- cron: '00 12 01 * *'
7+
8+
# Allow manually starting the workflow
9+
workflow_dispatch:
10+
11+
jobs:
12+
date-check:
13+
if: github.repository == 'rust-lang/rustc-dev-guide'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Ensure Rust is up-to-date
21+
run: |
22+
rustup update stable
23+
24+
- name: Run `date-check`
25+
working-directory: ci/date-check
26+
run: |
27+
cargo run -- ../../src/ > ../../date-check-output.txt
28+
29+
- name: Open issue
30+
uses: actions/github-script@v7
31+
with:
32+
script: |
33+
const fs = require('fs');
34+
35+
const rawText = fs.readFileSync('date-check-output.txt', { encoding: 'utf8' });
36+
const title = rawText.split('\n')[0];
37+
if (title != 'empty') {
38+
const body = rawText.split('\n').slice(1).join('\n');
39+
github.rest.issues.create({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
title,
43+
body,
44+
});
45+
console.log('Opened issue.');
46+
} else {
47+
console.log('No dates to triage.');
48+
}

src/doc/rustc-dev-guide/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
book
2+
3+
ci/date-check/target/
4+
5+
# Generated by check-in.sh
6+
pulls.json

src/doc/rustc-dev-guide/.mailmap

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
4+
5+
Jynn Nelson <[email protected]>

src/doc/rustc-dev-guide/CITATION.cff

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cff-version: 1.2.0
2+
message: If you use this guide, please cite it using these metadata.
3+
title: Rust Compiler Development Guide (rustc-dev-guide)
4+
abstract: A guide to developing the Rust compiler (rustc)
5+
authors:
6+
- name: "The Rust Project Developers"
7+
date-released: "2018-01-16"
8+
license: "MIT OR Apache-2.0"
9+
repository-code: "https://github.com/rust-lang/rustc-dev-guide"

src/doc/rustc-dev-guide/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rustc-dev-guide.rust-lang.org
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# The Rust Code of Conduct
2+
3+
This repository follows the [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) of the Rust organization.

0 commit comments

Comments
 (0)