Skip to content

Commit

Permalink
Try dynamic github fix
Browse files Browse the repository at this point in the history
  • Loading branch information
levkk committed Nov 7, 2024
1 parent c08e10c commit fef6a51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ jobs:
with:
toolchain: stable
override: true
- name: Install libruby
run: |
echo "Looking for ruby"
find / -name libruby.so 2>/dev/null
echo "Ruby maybe found"
exit 1
sudo apt update && sudo apt install ruby-dev -y
- name: Build
run: cargo build
tests:
Expand Down
21 changes: 21 additions & 0 deletions rwf-ruby/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,26 @@ fn main() {
build.flag(flag);
}

// Github actions workaround
match Command::new("find")
.arg("/opt/hostedtoolcache/Ruby")
.arg("-name")
.arg("libruby.so")
.output()
{
Ok(output) => {
let lib = String::from_utf8_lossy(&output.stdout)
.to_string()
.trim()
.to_string();
let lib = lib.split("\n").next().unwrap_or("").trim();
if !lib.is_empty() {
build.flag(format!("-L{}", lib));
}
}

Err(_) => (),
};

build.file("src/bindings.c").compile("rwf_ruby");
}

0 comments on commit fef6a51

Please sign in to comment.