From d48e0bfcbb1a4f0b916ef5a4a0314d297be98818 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 17:06:48 +0800 Subject: [PATCH 01/20] Use `manylinux2014` base image instead --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 851fa93..d993a34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ setup = ['-Dwheel=true'] [tool.cibuildwheel] build-verbosity = 3 before-all = "bash {project}/cibw_before_all.sh" -manylinux-x86_64-image = "manylinux_2_24" -manylinux-i686-image = "manylinux_2_24" +manylinux-x86_64-image = "manylinux2014" +manylinux-i686-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.windows] From 7d1aabdf88f81d106be6bdf98f949984844b4c66 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 17:33:01 +0800 Subject: [PATCH 02/20] Add CentOS 7 llvm-toolset-7.0 install --- cibw_before_all.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index c186303..28cbab8 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -19,6 +19,10 @@ if command -v apt; then apt update && apt install --assume-yes libclang-7-dev clang-7 llvm-7 elif command -v apk; then apk update && apk add clang-dev +elif command -v yum; then + yum install centos-release-scl + yum install llvm-toolset-7.0 + scl enable llvm-toolset-7.0 bash fi pushd rizin From 198ccef8761a8490784411c616c238f7ab11a3da Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 17:36:56 +0800 Subject: [PATCH 03/20] Use `yum -y` --- cibw_before_all.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 28cbab8..0a791ef 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -20,8 +20,7 @@ if command -v apt; then elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then - yum install centos-release-scl - yum install llvm-toolset-7.0 + yum -y install centos-release-scl llvm-toolset-7.0 scl enable llvm-toolset-7.0 bash fi From 7fec7702d64c0d21cbcaa6e0db4cbf1c9017ede3 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 17:45:14 +0800 Subject: [PATCH 04/20] Use `source scl_source` instead --- cibw_before_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 0a791ef..331677d 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -21,7 +21,7 @@ elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then yum -y install centos-release-scl llvm-toolset-7.0 - scl enable llvm-toolset-7.0 bash + source scl_source enable llvm-toolset-7.0 fi pushd rizin From ba3fcc492cfbe7e8751cf2c6a48334571332b413 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 17:52:28 +0800 Subject: [PATCH 05/20] Use `|| true` --- cibw_before_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 331677d..eace206 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -21,7 +21,7 @@ elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then yum -y install centos-release-scl llvm-toolset-7.0 - source scl_source enable llvm-toolset-7.0 + source scl_source enable llvm-toolset-7.0 || true fi pushd rizin From 7528eca5d5609fbbb06b04654d0655916db3d8a3 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 18:05:35 +0800 Subject: [PATCH 06/20] Add some test statements --- cibw_before_all.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index eace206..25620f7 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -22,6 +22,8 @@ elif command -v apk; then elif command -v yum; then yum -y install centos-release-scl llvm-toolset-7.0 source scl_source enable llvm-toolset-7.0 || true + clang --version + clang-7 --version fi pushd rizin From 68b1feb5caa7af4a0c0a725d89fd5d8c65c31ce9 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 18:17:39 +0800 Subject: [PATCH 07/20] Try using `ln -s` --- cibw_before_all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 25620f7..5ce1450 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -22,8 +22,8 @@ elif command -v apk; then elif command -v yum; then yum -y install centos-release-scl llvm-toolset-7.0 source scl_source enable llvm-toolset-7.0 || true - clang --version - clang-7 --version + ln -s `which clang` /usr/local/bin/clang + ln -s `which clang-7` /usr/local/bin/clang-7 fi pushd rizin From febb273a26ea44c201a344320c8d9b6cc54b6a2e Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 18:31:02 +0800 Subject: [PATCH 08/20] Do `ln -s` for llvm-config as well --- cibw_before_all.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 5ce1450..6e234e5 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -24,6 +24,8 @@ elif command -v yum; then source scl_source enable llvm-toolset-7.0 || true ln -s `which clang` /usr/local/bin/clang ln -s `which clang-7` /usr/local/bin/clang-7 + ln -s `which llvm-config` /usr/local/bin/llvm-config + ln -s `which llvm-config-7` /usr/local/bin/llvm-config-7 fi pushd rizin From 99baba7136f63977ea9936f98953f2889d9c9ccc Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 18:42:51 +0800 Subject: [PATCH 09/20] Try installing `llvm-toolset-7.0-llvm-devel` --- cibw_before_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 6e234e5..d93b076 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -20,7 +20,7 @@ if command -v apt; then elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then - yum -y install centos-release-scl llvm-toolset-7.0 + yum -y install centos-release-scl llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel source scl_source enable llvm-toolset-7.0 || true ln -s `which clang` /usr/local/bin/clang ln -s `which clang-7` /usr/local/bin/clang-7 From ccd98bd5c88efd8d2973b39d92b89936907b601f Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 18:54:21 +0800 Subject: [PATCH 10/20] Use a `before-build` command --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d993a34..8e4f15b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ setup = ['-Dwheel=true'] [tool.cibuildwheel] build-verbosity = 3 before-all = "bash {project}/cibw_before_all.sh" +before-build = "source scl_source enable llvm-toolset-7.0 || true" manylinux-x86_64-image = "manylinux2014" manylinux-i686-image = "manylinux2014" skip = "pp*" From 11d9ba193a400088d300b67e45d00a2567f248dc Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 19:20:43 +0800 Subject: [PATCH 11/20] Use `before-build-linux` and remove symbolic links --- cibw_before_all.sh | 4 ---- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index d93b076..2ba31dd 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -22,10 +22,6 @@ elif command -v apk; then elif command -v yum; then yum -y install centos-release-scl llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel source scl_source enable llvm-toolset-7.0 || true - ln -s `which clang` /usr/local/bin/clang - ln -s `which clang-7` /usr/local/bin/clang-7 - ln -s `which llvm-config` /usr/local/bin/llvm-config - ln -s `which llvm-config-7` /usr/local/bin/llvm-config-7 fi pushd rizin diff --git a/pyproject.toml b/pyproject.toml index 8e4f15b..f7ce8f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ setup = ['-Dwheel=true'] [tool.cibuildwheel] build-verbosity = 3 before-all = "bash {project}/cibw_before_all.sh" -before-build = "source scl_source enable llvm-toolset-7.0 || true" +before-build-linux = "source scl_source enable llvm-toolset-7.0 || true" manylinux-x86_64-image = "manylinux2014" manylinux-i686-image = "manylinux2014" skip = "pp*" From 91024d5733f9809f6f11e314f4df536023491e03 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 19:25:03 +0800 Subject: [PATCH 12/20] Use `tool.cibuildwheel.linux` --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f7ce8f5..cf74113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,11 +11,13 @@ setup = ['-Dwheel=true'] [tool.cibuildwheel] build-verbosity = 3 before-all = "bash {project}/cibw_before_all.sh" -before-build-linux = "source scl_source enable llvm-toolset-7.0 || true" manylinux-x86_64-image = "manylinux2014" manylinux-i686-image = "manylinux2014" skip = "pp*" +[tool.cibuildwheel.linux] +before-build = "source scl_source enable llvm-toolset-7.0 || true" + [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } archs = ["AMD64"] From 1e4390215b09b502c4c36ae4a8ad0e24f50383c5 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 19:39:21 +0800 Subject: [PATCH 13/20] Set PATH manually --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index cf74113..4f8e464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ skip = "pp*" [tool.cibuildwheel.linux] before-build = "source scl_source enable llvm-toolset-7.0 || true" +environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH" } [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } From 235a50720c1640339a5d16edd5b32f59493348ef Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 19:51:39 +0800 Subject: [PATCH 14/20] Remove `before-build` and set LD_LIBRARY_PATH manually --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4f8e464..15687dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,10 @@ manylinux-i686-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.linux] -before-build = "source scl_source enable llvm-toolset-7.0 || true" -environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH" } +environment = { + PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", + LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH", +} [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } From 33743dec227b410bc43354c1fa12cbea899ee992 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 19:57:25 +0800 Subject: [PATCH 15/20] Put env vars on 1 line --- pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 15687dd..c540853 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,7 @@ manylinux-i686-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.linux] -environment = { - PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", - LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH", -} +environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH" } [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } From b6b291ff366d85ca4b60355b2dadc06bb4b27956 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 20:10:57 +0800 Subject: [PATCH 16/20] Remove Python path from PATH --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c540853..92d2f5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ manylinux-i686-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.linux] -environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH" } +environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH" } [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } From 36617480a9548e062d5d23e0f9489fba83e2f938 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 20:36:03 +0800 Subject: [PATCH 17/20] Try not installing centos-release-scl --- cibw_before_all.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 2ba31dd..bd71c57 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -20,8 +20,9 @@ if command -v apt; then elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then - yum -y install centos-release-scl llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel - source scl_source enable llvm-toolset-7.0 || true + # yum -y install centos-release-scl llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel + yum -y install llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel + # source scl_source enable llvm-toolset-7.0 || true fi pushd rizin From c69fe0cf3c5ca6c2ea55a4e981f7b4c7c9c0064f Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 21:45:54 +0800 Subject: [PATCH 18/20] Drop i686 support --- cibw_before_all.sh | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index bd71c57..f8d076f 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -20,9 +20,9 @@ if command -v apt; then elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then - # yum -y install centos-release-scl llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel yum -y install llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel - # source scl_source enable llvm-toolset-7.0 || true + yum -y install centos-release-scl + source scl_source enable llvm-toolset-7.0 || true fi pushd rizin diff --git a/pyproject.toml b/pyproject.toml index 92d2f5e..4a4da9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,11 +12,11 @@ setup = ['-Dwheel=true'] build-verbosity = 3 before-all = "bash {project}/cibw_before_all.sh" manylinux-x86_64-image = "manylinux2014" -manylinux-i686-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.linux] environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH" } +archs = ["x86_64"] [tool.cibuildwheel.windows] environment = { CMAKE_PREFIX_PATH="C:\\rizin" } From 7cd30a795243fb25b218923575a807dc0d3c60bd Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 22:07:12 +0800 Subject: [PATCH 19/20] Keep only llvm-toolset-7.0 paths --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4a4da9a..f942499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ manylinux-x86_64-image = "manylinux2014" skip = "pp*" [tool.cibuildwheel.linux] -environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:/opt/rh/devtoolset-10/root/usr/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:$LD_LIBRARY_PATH" } +environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/sbin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:$LD_LIBRARY_PATH" } archs = ["x86_64"] [tool.cibuildwheel.windows] From bc2fb951c48ac2a93e82db642136fc5712dc03b7 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 18 Apr 2024 22:37:03 +0800 Subject: [PATCH 20/20] Cleanup --- cibw_before_all.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cibw_before_all.sh b/cibw_before_all.sh index f8d076f..ad62290 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -21,8 +21,9 @@ elif command -v apk; then apk update && apk add clang-dev elif command -v yum; then yum -y install llvm-toolset-7.0 llvm-toolset-7.0-llvm-devel - yum -y install centos-release-scl - source scl_source enable llvm-toolset-7.0 || true + # (CentOS 7) Uncomment following lines to see required paths in build log: + # yum -y install centos-release-scl + # source scl_source enable llvm-toolset-7.0 || true fi pushd rizin