From 3cf5c96534b3faefb3bbebf5b8bca21ffc711fca Mon Sep 17 00:00:00 2001 From: Andreas Tsatsanis Date: Tue, 13 May 2025 22:10:01 +0200 Subject: [PATCH 1/3] static libc link in examples --- Cargo.toml | 6 +++--- src/resources/build_builtin_examples.rs | 27 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dff812a..c4447ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ version = "1.2.1" edition = "2021" default-run = "gourd" authors = [ - "Mikołaj Gazeel ", + "Mikołaj Gazeel ", "Lukáš Chládek ", - "Ανδρέας Τσατσάνης ", + "Ανδρέας Τσατσάνης ", "Jan Piotrowski ", - "Rūta Giedrytė " + "Rūta Giedrytė " ] build = "build.rs" diff --git a/src/resources/build_builtin_examples.rs b/src/resources/build_builtin_examples.rs index 5e15364..23cd850 100644 --- a/src/resources/build_builtin_examples.rs +++ b/src/resources/build_builtin_examples.rs @@ -193,9 +193,34 @@ fn compile_rust_file(path: &Path) -> Result<()> { let str_compiled_path = compiled_path.to_str().ok_or_else(|| anyhow!(":("))?; + // on linux, we statically link the examples to musl in order to prevent glibc + // compatibility errors. + let target_triple = format!("{}-unknown-linux-musl", std::env::consts::ARCH); + let compile_args = if std::env::consts::OS == "linux" { + std::process::Command::new("rustup") + .arg("target") + .arg("add") + .arg(&target_triple) + .spawn()? + .wait()?; + + vec![ + "--target", + &target_triple, + "-C", + "target-feature=+crt-static", + "-O", + str_path, + "-o", + str_compiled_path, + ] + } else { + vec!["-O", str_path, "-o", str_compiled_path] + }; + let output = run_command( "rustc", - &vec!["-O", str_path, "-o", str_compiled_path], + &compile_args, Some(canon_path.parent().ok_or_else(|| anyhow!(":("))?.to_owned()), )?; From d2a6bc7a0a1d56f4e79710cb9b7c9e5d65f9b8e9 Mon Sep 17 00:00:00 2001 From: Andreas Tsatsanis Date: Tue, 13 May 2025 22:49:22 +0200 Subject: [PATCH 2/3] linker flags --- .cargo/config.toml | 5 +++++ .gitignore | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..aa079f1 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,5 @@ +[target.x86_64-unknown-linux-musl] +linker = "musl-gcc" +rustflags = [ + "-C", "target-feature=+crt-static" +] diff --git a/.gitignore b/.gitignore index 45c684d..2dca1f4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,3 @@ Cargo.lock /*.man compile.fish /*.profraw -.cargo From 08552f68d738b4481b934391ca6dcc88010e139c Mon Sep 17 00:00:00 2001 From: Andreas Tsatsanis Date: Mon, 9 Jun 2025 15:56:11 +0200 Subject: [PATCH 3/3] update email addresses --- Cargo.toml | 6 +++--- README.md | 11 ++++++----- docs/user/gourd-tutorial.7.tex | 4 ++-- docs/user/gourd.1.tex | 4 ++-- docs/user/gourd.toml.5.tex | 4 ++-- docs/user/html/postamble.html | 2 +- docs/user/html/preamble.html | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c4447ae..c1c1861 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ version = "1.2.1" edition = "2021" default-run = "gourd" authors = [ - "Mikołaj Gazeel ", + "Mikołaj Gazeel ", "Lukáš Chládek ", - "Ανδρέας Τσατσάνης ", + "Ανδρέας Τσατσάνης ", "Jan Piotrowski ", - "Rūta Giedrytė " + "Rūta Giedrytė " ] build = "build.rs" diff --git a/README.md b/README.md index 36b722b..40487b8 100644 --- a/README.md +++ b/README.md @@ -98,12 +98,13 @@ An artifact is available from the GitLab pipeline `documentation` job, or ### Authors -- Mikołaj Gazeel, m.j.gazeel@tudelft.nl +- Mikołaj Gazeel, mgazeel@ethz.ch - Lukáš Chládek, l@chla.cz -- Ανδρέας Τσατσάνης, a.tsatsanis@tudelft.nl -- Rūta Giedrytė, r.giedryte@tudelft.nl +- Ανδρέας Τσατσάνης, atsatsanis@tudelft.nl +- Rūta Giedrytė, rgiedryte@tudelft.nl - Jan Piotrowski, me@jan.wf ### Maintainers -- Ανδρέας Τσατσάνης, a.tsatsanis@tudelft.nl - +- Ανδρέας Τσατσάνης, atsatsanis@tudelft.nl +- Lukáš Chládek, l@chla.cz +- Mikołaj Gazeel, m.j.gazeel@tudelft.nl diff --git a/docs/user/gourd-tutorial.7.tex b/docs/user/gourd-tutorial.7.tex index 713a634..82f6874 100644 --- a/docs/user/gourd-tutorial.7.tex +++ b/docs/user/gourd-tutorial.7.tex @@ -364,9 +364,9 @@ \Prog{gourd.toml(5)} \section{CONTACT} - Ανδρέας Τσατσάνης <\Email{a.tsatsanis@tudelft.nl}>\\[0.1cm]\MANbr + Ανδρέας Τσατσάνης <\Email{atsatsanis@tudelft.nl}>\\[0.1cm]\MANbr Lukáš Chládek <\Email{l@chla.cz}>\\[0.1cm]\MANbr - Mikołaj Gazeel <\Email{m.j.gazeel@tudelft.nl}>\\[0.1cm]\MANbr + Mikołaj Gazeel <\Email{mgazeel@ethz.ch}>\\[0.1cm]\MANbr %@% IF LATEX %@% \end{adjustwidth} diff --git a/docs/user/gourd.1.tex b/docs/user/gourd.1.tex index 5486d72..5448f64 100644 --- a/docs/user/gourd.1.tex +++ b/docs/user/gourd.1.tex @@ -574,9 +574,9 @@ \Prog{gourd.toml(5)} \section{CONTACT} - Ανδρέας Τσατσάνης <\Email{a.tsatsanis@tudelft.nl}>\\[0.1cm]\MANbr + Ανδρέας Τσατσάνης <\Email{atsatsanis@tudelft.nl}>\\[0.1cm]\MANbr Lukáš Chládek <\Email{l@chla.cz}>\\[0.1cm]\MANbr - Mikołaj Gazeel <\Email{m.j.gazeel@tudelft.nl}>\\[0.1cm]\MANbr + Mikołaj Gazeel <\Email{mgazeel@ethz.ch}>\\[0.1cm]\MANbr %@% IF LATEX %@% \end{adjustwidth} diff --git a/docs/user/gourd.toml.5.tex b/docs/user/gourd.toml.5.tex index f8165f4..488f59d 100644 --- a/docs/user/gourd.toml.5.tex +++ b/docs/user/gourd.toml.5.tex @@ -683,9 +683,9 @@ \Prog{gourd(1)} \Prog{gourd-tutorial(7)} \section{CONTACT} - Ανδρέας Τσατσάνης <\Email{a.tsatsanis@tudelft.nl}>\\[0.1cm]\MANbr + Ανδρέας Τσατσάνης <\Email{atsatsanis@tudelft.nl}>\\[0.1cm]\MANbr Lukáš Chládek <\Email{l@chla.cz}>\\[0.1cm]\MANbr - Mikołaj Gazeel <\Email{m.j.gazeel@tudelft.nl}>\\[0.1cm]\MANbr + Mikołaj Gazeel <\Email{mgazeel@ethz.ch}>\\[0.1cm]\MANbr %@% IF LATEX %@% \end{adjustwidth} diff --git a/docs/user/html/postamble.html b/docs/user/html/postamble.html index 353b79e..538fdd2 100644 --- a/docs/user/html/postamble.html +++ b/docs/user/html/postamble.html @@ -4,7 +4,7 @@ - +
diff --git a/docs/user/html/preamble.html b/docs/user/html/preamble.html index 0423596..457030f 100644 --- a/docs/user/html/preamble.html +++ b/docs/user/html/preamble.html @@ -4,7 +4,7 @@ - +