Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
14662fa
docs(library/core/src/pin): fix typo "necessarily" -> "necessary"
ruancomelli Apr 13, 2025
6f23f16
docs(library/core/src/pin): rewrite for clarity
ruancomelli Apr 13, 2025
80758c3
add rdg push git config entry for git protocol pushers
tshepang May 1, 2025
53459ff
Simplify `Vec::as_non_null` implementation and make it `const`
viliml May 5, 2025
6e966d7
avoid duplicating commands
tshepang May 6, 2025
046bfb3
Preparing for merge from rustc
invalid-email-address May 8, 2025
659f0b6
Merge from rustc
invalid-email-address May 8, 2025
b2de3f4
Merge pull request #2374 from rust-lang/rustc-pull
tshepang May 8, 2025
47cd0e7
Fix minor typo in serialization.md
smanilov May 8, 2025
f52e1be
Merge pull request #2375 from smanilov/patch-4
tshepang May 8, 2025
d87763d
Remark test naming exception
smanilov May 8, 2025
f31bf4a
Merge pull request #2323 from smanilov/patch-2
BoxyUwU May 8, 2025
a07c71d
Fix minor typo in installation.md
smanilov May 8, 2025
079e0b4
Merge pull request #2377 from smanilov/patch-6
tshepang May 8, 2025
31ebe11
normalization: avoid incompletely constraining GAT args
lcnr May 6, 2025
0185484
refactor `probe_and_consider_param_env_candidate`
lcnr May 8, 2025
9eac7a3
move (and remove) impl Trait tests
lcnr May 9, 2025
3052683
Fix minor typo in rustdoc-internals.md
smanilov May 8, 2025
6831638
Merge pull request #2376 from smanilov/patch-5
tshepang May 9, 2025
0533ff7
more moved tests
lcnr May 9, 2025
90ec9da
Merge pull request #2369 from rust-lang/tshepang-patch-1
tshepang May 10, 2025
c1de624
link to chapter referred to
tshepang May 10, 2025
8c6c97d
use the right case
tshepang May 10, 2025
4e684a9
make more clear what is meant
tshepang May 10, 2025
9f07c1e
make more readable
tshepang May 10, 2025
2efa4e6
sembr
tshepang May 10, 2025
eb6749c
is a question
tshepang May 10, 2025
a82a329
fix broken links
tshepang May 10, 2025
5d8e19f
reduce clutter when reading source
tshepang May 10, 2025
7b9d7fc
sembr
tshepang May 10, 2025
f1d1ebc
last updated a year ago
tshepang May 10, 2025
52e4b4a
add missing word
tshepang May 10, 2025
927343e
no point versioning these
tshepang May 10, 2025
a9d6551
bump edition
tshepang May 10, 2025
63b3bf9
"cargo fmt"
tshepang May 10, 2025
58fa975
we are a collective
tshepang May 10, 2025
5a406be
noise
tshepang May 10, 2025
53ef2e0
Add LLDB providers for BTreeMap and BTreeSet
ede1998 Apr 21, 2025
aeea472
Remove `stable` attribute from wasi fs (read_exact|write_all)_at
paolobarbolini May 10, 2025
2a0c72e
Remove obsolete reference to `unsized_tuple_coercion`
Zalathar May 12, 2025
53572cf
Merge pull request #2382 from Zalathar/no-tuple-unsize
JohnTitor May 12, 2025
436c363
Remove n.b. about parser refactoring
smanilov May 9, 2025
e983642
Merge pull request #2378 from smanilov/patch-7
jieyouxu May 12, 2025
df1da67
Flush errors before deep normalize in dropck_outlives
compiler-errors May 12, 2025
b255ae2
remove dangling references
tshepang May 12, 2025
a508011
Expect deep norm to fail if query norm failed
compiler-errors May 12, 2025
a1ea0ce
[win] Use a dash instead of slash for linker to avoid breaking lld
dpaoliello May 13, 2025
79b2794
Remove #![feature(let_chains)] from library and src/librustdoc
est31 May 13, 2025
e1f1878
Fix set_name for vxworks. Length of name should be truncated to VX_TA…
biabbas May 14, 2025
544c8ce
Fix settimes for vxworks
biabbas May 14, 2025
1267333
Improve ternary operator recovery
jamie-osec May 14, 2025
ac1df15
Improve `dangerous_implicit_aurorefs` diagnostic output
Urgau May 7, 2025
e0b6363
wire up startupinfo methods
federico-terzi May 14, 2025
9b3abe7
Use more subdiagnostics and reword the overloaded deref note
Urgau May 14, 2025
032f738
Merge pull request #2383 from rust-lang/tshepang-unused
tshepang May 14, 2025
b805dcb
Merge pull request #2380 from rust-lang/tshepang-crate-cleaning
tshepang May 14, 2025
30b54ad
Merge pull request #2379 from rust-lang/tshepang-which-chapter
tshepang May 14, 2025
05e7ce9
Merge pull request #2373 from rust-lang/tshepang-patch-2
tshepang May 14, 2025
5e3aa16
avoid upstream pull conflict
tshepang May 15, 2025
d016ed8
Merge pull request #2387 from rust-lang/tshepang-avoid-conflict
tshepang May 15, 2025
4adff2f
Preparing for merge from rustc
invalid-email-address May 15, 2025
1fd536c
Merge from rustc
invalid-email-address May 15, 2025
a3ce646
Merge pull request #2388 from rust-lang/rustc-pull
tshepang May 15, 2025
6ee49ab
Rollup merge of #139749 - ruancomelli:docs/library/core/src/pin/fix-t…
compiler-errors May 15, 2025
56df335
Rollup merge of #140130 - ede1998:add-lldb-btree-providers, r=Mark-Si…
compiler-errors May 15, 2025
fc11361
Rollup merge of #140685 - viliml:patch-1, r=Mark-Simulacrum
compiler-errors May 15, 2025
53fa4d7
Rollup merge of #140712 - lcnr:normalization-gat-args, r=compiler-errors
compiler-errors May 15, 2025
d23a82e
Rollup merge of #140768 - Urgau:improv_autorefs-lint, r=fmease
compiler-errors May 15, 2025
0ee8f1e
Rollup merge of #140834 - lcnr:apit-folder, r=compiler-errors
compiler-errors May 15, 2025
80b5da5
Rollup merge of #140910 - paolobarbolini:wasi-fs-incorrect-stabilizat…
compiler-errors May 15, 2025
0904424
Rollup merge of #140947 - compiler-errors:pending-norm, r=lcnr
compiler-errors May 15, 2025
b81bdbc
Rollup merge of #140966 - est31:let_chains_library, r=tgross35
compiler-errors May 15, 2025
a933842
Rollup merge of #140977 - dpaoliello:dash, r=jieyouxu
compiler-errors May 15, 2025
2686217
Rollup merge of #140990 - biabbas:vxworks, r=tgross35
compiler-errors May 15, 2025
c39fdc4
Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors
compiler-errors May 15, 2025
996cb38
Rollup merge of #141013 - federico-terzi:feat/command_startupinfo_win…
compiler-errors May 15, 2025
b9f2cfa
Rollup merge of #141026 - tshepang:rust-push, r=jieyouxu
compiler-errors May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
"cargo fmt"
  • Loading branch information
tshepang committed May 10, 2025
commit 63b3bf99afe22c299ed6ca332674cf2a63966e8e
6 changes: 2 additions & 4 deletions src/doc/rustc-dev-guide/josh-sync/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use clap::Parser;

use crate::sync::{GitSync, RustcPullError};

mod sync;
Expand All @@ -11,10 +12,7 @@ enum Args {
/// Push changes from `rustc-dev-guide` to the given `branch` of a `rustc` fork under the given
/// GitHub `username`.
/// The pushed branch should then be merged into the `rustc` repository.
RustcPush {
branch: String,
github_username: String
}
RustcPush { branch: String, github_username: String },
}

fn main() -> anyhow::Result<()> {
Expand Down
40 changes: 26 additions & 14 deletions src/doc/rustc-dev-guide/josh-sync/src/sync.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::io::Write;
use std::ops::Not;
use std::path::PathBuf;
use std::{env, net, process};
use std::io::Write;
use std::time::Duration;
use anyhow::{anyhow, bail, Context};
use xshell::{cmd, Shell};
use std::{env, net, process};

use anyhow::{Context, anyhow, bail};
use xshell::{Shell, cmd};

/// Used for rustc syncs.
const JOSH_FILTER: &str = ":/src/doc/rustc-dev-guide";
Expand All @@ -15,10 +16,13 @@ pub enum RustcPullError {
/// No changes are available to be pulled.
NothingToPull,
/// A rustc-pull has failed, probably a git operation error has occurred.
PullFailed(anyhow::Error)
PullFailed(anyhow::Error),
}

impl<E> From<E> for RustcPullError where E: Into<anyhow::Error> {
impl<E> From<E> for RustcPullError
where
E: Into<anyhow::Error>,
{
fn from(error: E) -> Self {
Self::PullFailed(error.into())
}
Expand All @@ -32,9 +36,7 @@ pub struct GitSync {
/// (https://github.com/rust-lang/miri/blob/6a68a79f38064c3bc30617cca4bdbfb2c336b140/miri-script/src/commands.rs#L236).
impl GitSync {
pub fn from_current_dir() -> anyhow::Result<Self> {
Ok(Self {
dir: std::env::current_dir()?
})
Ok(Self { dir: std::env::current_dir()? })
}

pub fn rustc_pull(&self, commit: Option<String>) -> Result<(), RustcPullError> {
Expand All @@ -51,7 +53,10 @@ impl GitSync {
})?;
// Make sure the repo is clean.
if cmd!(sh, "git status --untracked-files=no --porcelain").read()?.is_empty().not() {
return Err(anyhow::anyhow!("working directory must be clean before performing rustc pull").into());
return Err(anyhow::anyhow!(
"working directory must be clean before performing rustc pull"
)
.into());
}
// Make sure josh is running.
let josh = Self::start_josh()?;
Expand Down Expand Up @@ -94,26 +99,33 @@ impl GitSync {
};
let num_roots_before = num_roots()?;

let sha = cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;
let sha =
cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;

// Merge the fetched commit.
const MERGE_COMMIT_MESSAGE: &str = "Merge from rustc";
cmd!(sh, "git merge FETCH_HEAD --no-verify --no-ff -m {MERGE_COMMIT_MESSAGE}")
.run()
.context("FAILED to merge new commits, something went wrong")?;

let current_sha = cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;
let current_sha =
cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;
if current_sha == sha {
cmd!(sh, "git reset --hard HEAD^")
.run()
.expect("FAILED to clean up after creating the preparation commit");
eprintln!("No merge was performed, no changes to pull were found. Rolled back the preparation commit.");
eprintln!(
"No merge was performed, no changes to pull were found. Rolled back the preparation commit."
);
return Err(RustcPullError::NothingToPull);
}

// Check that the number of roots did not increase.
if num_roots()? != num_roots_before {
return Err(anyhow::anyhow!("Josh created a new root commit. This is probably not the history you want.").into());
return Err(anyhow::anyhow!(
"Josh created a new root commit. This is probably not the history you want."
)
.into());
}

drop(josh);
Expand Down