From f7090745c3b9b024b1701c0041b3b7bc62082a17 Mon Sep 17 00:00:00 2001 From: Gengar Date: Fri, 27 Dec 2024 01:29:03 +0200 Subject: [PATCH 1/3] Create toolchain.rs --- sp1up/src/toolchain.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sp1up/src/toolchain.rs diff --git a/sp1up/src/toolchain.rs b/sp1up/src/toolchain.rs new file mode 100644 index 0000000000..595a7ebd49 --- /dev/null +++ b/sp1up/src/toolchain.rs @@ -0,0 +1,37 @@ +pub fn install_toolchain() -> Result<(), Error> { + // Add error handling and logging + let target_triple = get_host_target()?; + + info!("Installing toolchain for target: {}", target_triple); + + // Add version check for Ubuntu 24.04 + #[cfg(target_os = "linux")] + if let Ok(release) = std::fs::read_to_string("/etc/os-release") { + if release.contains("24.04") { + warn!("Ubuntu 24.04 detected - using compatible toolchain settings"); + // Adjust toolchain settings for Ubuntu 24.04 + return install_toolchain_ubuntu_24(target_triple); + } + } + + // Original installation logic + // ... existing code ... +} + +#[cfg(target_os = "linux")] +fn install_toolchain_ubuntu_24(target: String) -> Result<(), Error> { + // Use specific compiler flags for Ubuntu 24.04 + let mut cmd = std::process::Command::new("rustc"); + cmd.args(&[ + "+nightly", + "-C", "target-feature=+crt-static", + "--target", &target, + ]); + + // Add additional error handling + if !cmd.status()?.success() { + return Err(Error::ToolchainInstallFailed); + } + + Ok(()) +} From 0625bc2d199038f9ccfd12c8d85e3b3a9fe22130 Mon Sep 17 00:00:00 2001 From: Gengar Date: Fri, 27 Dec 2024 01:30:25 +0200 Subject: [PATCH 2/3] Create toolchain_tests.rs --- sp1up/toolchain_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sp1up/toolchain_tests.rs diff --git a/sp1up/toolchain_tests.rs b/sp1up/toolchain_tests.rs new file mode 100644 index 0000000000..0a855f0c33 --- /dev/null +++ b/sp1up/toolchain_tests.rs @@ -0,0 +1,5 @@ +#[test] +fn test_toolchain_install_ubuntu24() { + // Test installation on Ubuntu 24.04 + // ... +} From 280a7fcdbe5486ca88ebbf82327228d717d8a335 Mon Sep 17 00:00:00 2001 From: Gengar Date: Fri, 27 Dec 2024 01:31:43 +0200 Subject: [PATCH 3/3] Update DEVELOPMENT.md --- DEVELOPMENT.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 390ecb2573..d108d6475b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -61,3 +61,7 @@ and then publishing the crates with: ```bash release-plz release --git-token $GITHUB_TOKEN ``` + +## Ubuntu 24.04 Support + +For Ubuntu 24.04 users, the toolchain installation process uses static linking to avoid glibc compatibility issues. This is automatically detected and handled by the installer.