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

fix; ubuntu 24 toolchain #1900

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
37 changes: 37 additions & 0 deletions sp1up/src/toolchain.rs
Original file line number Diff line number Diff line change
@@ -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(())
}
5 changes: 5 additions & 0 deletions sp1up/toolchain_tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[test]
fn test_toolchain_install_ubuntu24() {
// Test installation on Ubuntu 24.04
// ...
}
Loading