Skip to content

Commit

Permalink
Merge pull request #44 from rnag/fix-ignore-glibc-version-in-final-ta…
Browse files Browse the repository at this point in the history
…rget

fix: ignore glibc version in `--target` for checks
  • Loading branch information
calavera authored Mar 31, 2022
2 parents 9bb2229 + b413851 commit c66ba01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ impl Build {
// Validate that the build target is supported in AWS Lambda
check_build_target(target)?;
// Same explicit target as host target
if host_target == target {
//
// Note: check with *starts with* instead of equality, as
// the `--target` might have a trailing glibc version.
if target.starts_with(host_target) {
self.build.disable_zig_linker = true
}
}
Expand All @@ -62,7 +65,7 @@ impl Build {
.build
.target
.get(0)
.map(|x| x.as_str())
.map(|x| x.split_once('.').map(|(t, _)| t).unwrap_or(x.as_str()))
.unwrap_or("x86_64-unknown-linux-gnu");
let profile = match self.build.profile.as_deref() {
Some("dev" | "test") => "debug",
Expand Down

0 comments on commit c66ba01

Please sign in to comment.