Skip to content

Update from rust-lang/rust #943

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

Merged
merged 5 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"
members = [
"builtins-test",
"compiler-builtins",
"crates/josh-sync",
"crates/libm-macros",
"crates/musl-math-sys",
"crates/panic-handler",
Expand Down
1 change: 0 additions & 1 deletion compiler-builtins/LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion compiler-builtins/src/math/libm_math

This file was deleted.

1 change: 1 addition & 0 deletions compiler-builtins/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#[allow(dead_code)]
#[allow(unused_imports)]
#[allow(clippy::all)]
#[path = "../../../libm/src/math/mod.rs"]
pub(crate) mod libm_math;

macro_rules! libm_intrinsics {
Expand Down
7 changes: 7 additions & 0 deletions crates/josh-sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "josh-sync"
edition = "2024"
publish = false

[dependencies]
directories = "6.0.0"
45 changes: 45 additions & 0 deletions crates/josh-sync/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
use std::io::{Read, Write};
use std::process::exit;
use std::{env, io};

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

mod sync;

const USAGE: &str = r#"Utility for synchroniing compiler-builtins with rust-lang/rust

Usage:

josh-sync rustc-pull

Pull from rust-lang/rust to compiler-builtins. Creates a commit
updating the version file, followed by a merge commit.

josh-sync rustc-push GITHUB_USERNAME [BRANCH]

Create a branch off of rust-lang/rust updating compiler-builtins.
"#;

fn main() {
let sync = GitSync::from_current_dir();

// Collect args, then recollect as str refs so we can match on them
let args: Vec<_> = env::args().collect();
let args: Vec<&str> = args.iter().map(String::as_str).collect();

match args.as_slice()[1..] {
["rustc-pull"] => sync.rustc_pull(None),
["rustc-push", github_user, branch] => sync.rustc_push(github_user, Some(branch)),
["rustc-push", github_user] => sync.rustc_push(github_user, None),
["start-josh"] => {
let _josh = Josh::start();
println!("press enter to stop");
io::stdout().flush().unwrap();
let _ = io::stdin().read(&mut [0u8]).unwrap();
}
_ => {
println!("{USAGE}");
exit(1);
}
}
}
Loading