diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bd5da4b..bef9814b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,17 +22,14 @@ jobs: strategy: matrix: include: - ## permission denied? - # - target: armv7-unknown-linux-gnueabihf - # os: ubuntu-latest - # - target: aarch64-unknown-linux-gnu - # os: ubuntu-latest + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-latest + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest - target: aarch64-apple-darwin os: macos-latest - target: x86_64-unknown-linux-gnu os: ubuntu-latest - # - target: x86_64-unknown-linux-musl - # os: ubuntu-latest - target: x86_64-apple-darwin os: macos-latest - target: x86_64-pc-windows-msvc diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..ace72eb8 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,4 @@ +[target.aarch64-unknown-linux-gnu] +pre-build = ["apt-get update && apt-get install --assume-yes python3"] +[target.armv7-unknown-linux-gnueabihf] +pre-build = ["apt-get update && apt-get install --assume-yes python3"] diff --git a/crates/erg_common/python_util.rs b/crates/erg_common/python_util.rs index 4005caa3..c218d396 100644 --- a/crates/erg_common/python_util.rs +++ b/crates/erg_common/python_util.rs @@ -3,6 +3,7 @@ //! CPythonを呼び出すためのユーティリティー use std::process::Command; +use crate::fn_name_full; use crate::serialize::get_magic_num_from_bytes; #[cfg(unix)] @@ -535,11 +536,11 @@ pub fn which_python() -> String { let out = Command::new(cmd) .arg(python) .output() - .expect("python not found"); + .unwrap_or_else(|_| panic!("{}: {python} not found", fn_name_full!())); let res = String::from_utf8(out.stdout).unwrap(); let res = res.split('\n').next().unwrap_or("").replace('\r', ""); if res.is_empty() { - println!("python not found"); + println!("{}: {python} not found", fn_name_full!()); std::process::exit(1); } else if res.contains("pyenv") && cfg!(windows) { println!("cannot use pyenv-win"); // because pyenv-win does not support `-c` option