From 4b7d2dff9ae47754bf5d1c1ffcd8542f6b91f7ec Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 7 Apr 2022 10:25:32 -0700 Subject: [PATCH 01/20] ci: add MinGW build for Rust crate --- .github/workflows/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbbdbb9a..a5bdc6d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + - os: macos-latest + - os: windows-latest + - os: windows-latest + target: x86_64-pc-windows-gnu defaults: run: working-directory: rust @@ -59,6 +64,10 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive + - run: rustup target add ${{ matrix.target }} + if: matrix.target != '' + - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV + if: matrix.target != '' - name: Build Rust crate run: cargo build - name: Test Rust crate From 03e49251e04ad6d14ebf3dacc872d65bfc410f70 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 7 Apr 2022 10:36:04 -0700 Subject: [PATCH 02/20] switch to windows-2019 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5bdc6d9..288bd40a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: - os: ubuntu-latest - os: macos-latest - os: windows-latest - - os: windows-latest + - os: windows-2019 target: x86_64-pc-windows-gnu defaults: run: From dd9c4caae2f437dc7ea93ce3d8276dafd2fc836a Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 13 Apr 2022 20:01:12 +0200 Subject: [PATCH 03/20] Use the `bash` shell by default in CI --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 288bd40a..bba0c21f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,10 @@ on: env: CARGO_TERM_COLOR: always +defaults: + run: + shell: bash + jobs: c_build: name: Check upstream C library From 12a11c66b88b94d1653eb73e96a5e498fe305c6c Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 13 Apr 2022 20:15:24 +0200 Subject: [PATCH 04/20] revert to windows-latest + put default shell in sub defaults section? --- .github/workflows/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bba0c21f..b727cdb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,6 @@ on: env: CARGO_TERM_COLOR: always -defaults: - run: - shell: bash - jobs: c_build: name: Check upstream C library @@ -59,11 +55,12 @@ jobs: - os: ubuntu-latest - os: macos-latest - os: windows-latest - - os: windows-2019 + - os: windows-latest target: x86_64-pc-windows-gnu defaults: run: working-directory: rust + shell: bash steps: - uses: actions/checkout@v2 with: From e48a54f124567dfa7900f4545ded082e9d056f78 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 08:59:16 -0700 Subject: [PATCH 05/20] Add additional compiler flag for MinGW --- rust/ittapi-sys/build.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index eab9068e..83a9c98b 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -4,10 +4,15 @@ //! [#36]: https://github.com/intel/ittapi/issues/36 fn main() { - cc::Build::new() + let mut build = cc::Build::new(); + build .file("c-library/src/ittnotify/ittnotify_static.c") .file("c-library/src/ittnotify/jitprofiling.c") .include("c-library/src/ittnotify/") - .include("c-library/include/") - .compile("ittnotify"); + .include("c-library/include/"); + + #[cfg(all(target_vendor = "pc", target_os = "windows", target_env = "gnu"))] + build.flag("--enable-secure-api"); + + build.compile("ittnotify"); } From e9756dd1bb9a42464c696c3eb5f487b35d544590 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:12:06 -0700 Subject: [PATCH 06/20] Tweak MINGW flag--use define instead --- rust/ittapi-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 83a9c98b..f8c92d9b 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -12,7 +12,7 @@ fn main() { .include("c-library/include/"); #[cfg(all(target_vendor = "pc", target_os = "windows", target_env = "gnu"))] - build.flag("--enable-secure-api"); + build.define("MINGW_HAS_SECURE_API", "1"); build.compile("ittnotify"); } From 51bc29a455bd2ae1f3dc4c487a5672f6d8aca53b Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:15:37 -0700 Subject: [PATCH 07/20] ci: ignore Windows-based changes to Git in verify-publish.sh --- .github/workflows/main.yml | 4 +++- rust/scripts/verify-publish.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b727cdb6..d6b04c9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,4 +74,6 @@ jobs: - name: Test Rust crate run: cargo test - name: Check crates are publishable - run: scripts/verify-publish.sh + # The Windows CI transforms the `c-library` symlink into a real directory, modifying the Git + # state, so we ignore these changes with `--allow-dirty` here. + run: scripts/verify-publish.sh --allow-dirty diff --git a/rust/scripts/verify-publish.sh b/rust/scripts/verify-publish.sh index c15130ef..cdbc07d0 100755 --- a/rust/scripts/verify-publish.sh +++ b/rust/scripts/verify-publish.sh @@ -2,6 +2,8 @@ # Check that the Rust crates can all be packaged up for publication. This cannot use use `cargo # publish --dry-run` because of the dependency between ittapi and ittapi-sys. set -e + +SCRIPT_ARGS=${@:1} SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) pushd $SCRIPT_DIR @@ -19,7 +21,7 @@ directory = "vendor" EOT # Package up ittapi-sys and place it in the vendor directory. -cargo package --manifest-path ../ittapi-sys/Cargo.toml +cargo package --manifest-path ../ittapi-sys/Cargo.toml $SCRIPT_ARGS pushd vendor tar xf ../../target/package/ittapi-sys-0.*.crate ITTAPI_SYS_DIR=$(echo ittapi-sys-0.*) @@ -27,5 +29,5 @@ echo '{"files":{}}' > $ITTAPI_SYS_DIR/.cargo-checksum.json popd # Package up ittapi. -cargo package --manifest-path ../ittapi/Cargo.toml +cargo package --manifest-path ../ittapi/Cargo.toml $SCRIPT_ARGS popd From 741f3bdbaffdbf6a07f469164a0c9b9674bb7b53 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:26:54 -0700 Subject: [PATCH 08/20] Try yet another define --- rust/ittapi-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index f8c92d9b..dec21209 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -12,7 +12,7 @@ fn main() { .include("c-library/include/"); #[cfg(all(target_vendor = "pc", target_os = "windows", target_env = "gnu"))] - build.define("MINGW_HAS_SECURE_API", "1"); + build.define("SDL_STRNLEN_S", None); build.compile("ittnotify"); } From a9b9b9100d455136077aae51bad284dd3686ff86 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:38:16 -0700 Subject: [PATCH 09/20] Use Cargo's TARGET variable for build detection instead --- rust/ittapi-sys/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index dec21209..b2961f44 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -11,8 +11,11 @@ fn main() { .include("c-library/src/ittnotify/") .include("c-library/include/"); - #[cfg(all(target_vendor = "pc", target_os = "windows", target_env = "gnu"))] - build.define("SDL_STRNLEN_S", None); + // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not + // always be available. + if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { + build.define("SDL_STRNLEN_S", None); + } build.compile("ittnotify"); } From a81f7882688632ccb690ecc3eed973c1c7fc3f1e Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:45:52 -0700 Subject: [PATCH 10/20] Try MINGW_HAS_SECURE_API again --- rust/ittapi-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index b2961f44..0d3bc94f 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -14,7 +14,7 @@ fn main() { // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not // always be available. if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { - build.define("SDL_STRNLEN_S", None); + build.define("MINGW_HAS_SECURE_API", "1"); } build.compile("ittnotify"); From a94bc14def87d915e6cb3ab07f4cd5f0454a47ea Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 10:54:31 -0700 Subject: [PATCH 11/20] Try everything... at once --- rust/ittapi-sys/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 0d3bc94f..401d1ede 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -14,7 +14,10 @@ fn main() { // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not // always be available. if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { - build.define("MINGW_HAS_SECURE_API", "1"); + build + .flag("--enable-secure-api") + .define("MINGW_HAS_SECURE_API", "1") + .define("SDL_STRNLEN_S", None); } build.compile("ittnotify"); From 653434b7b964e8edde4092d56dcae02a3abf57ab Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Apr 2022 11:00:25 -0700 Subject: [PATCH 12/20] Remove --enable-secure-api --- rust/ittapi-sys/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 401d1ede..5e450dee 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -15,7 +15,6 @@ fn main() { // always be available. if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { build - .flag("--enable-secure-api") .define("MINGW_HAS_SECURE_API", "1") .define("SDL_STRNLEN_S", None); } From e158238253f0329f41678ca117befabfc132e1e4 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 12 May 2022 12:13:45 -0700 Subject: [PATCH 13/20] Try defining the function directly --- rust/ittapi-sys/build.rs | 10 +++------- rust/ittapi-sys/strnlen_s.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 rust/ittapi-sys/strnlen_s.c diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 5e450dee..2d514756 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -1,5 +1,5 @@ //! Build the `ittapi` C library in the parent directory. The `cc` configuration here should match -//! that of the parent directories `CMakeLists.txt` (TODO: keep these in sync, see [#36]). +//! that of the parent directory's `CMakeLists.txt` (TODO: keep these in sync, see [#36]). //! //! [#36]: https://github.com/intel/ittapi/issues/36 @@ -10,14 +10,10 @@ fn main() { .file("c-library/src/ittnotify/jitprofiling.c") .include("c-library/src/ittnotify/") .include("c-library/include/"); - // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not - // always be available. + // always be available--define it here. if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { - build - .define("MINGW_HAS_SECURE_API", "1") - .define("SDL_STRNLEN_S", None); + build.file("strnlen_s.c"); } - build.compile("ittnotify"); } diff --git a/rust/ittapi-sys/strnlen_s.c b/rust/ittapi-sys/strnlen_s.c new file mode 100644 index 00000000..d9c9026d --- /dev/null +++ b/rust/ittapi-sys/strnlen_s.c @@ -0,0 +1,18 @@ +// Apply the definition of `strnlen_s` committed to mingw-w64 but not yet +// available (somehow) in the version of mingw available in the GitHub runner. +// This change is pulled from: +// https://github.com/mingw-w64/mingw-w64/commit/8a63e4c9f7252fded035c004dfe3f84e11677bf6 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +__forceinline size_t __cdecl strnlen_s(const char* _src, size_t _count) { + return _src ? strnlen(_src, _count) : 0; +} + +#ifdef __cplusplus +} +#endif From 03b1a03cfa61538c79fbefc3ba8a3344bea4676f Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 12 May 2022 12:27:55 -0700 Subject: [PATCH 14/20] Change compilation order --- rust/ittapi-sys/build.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 2d514756..53050bc2 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -5,15 +5,15 @@ fn main() { let mut build = cc::Build::new(); - build - .file("c-library/src/ittnotify/ittnotify_static.c") - .file("c-library/src/ittnotify/jitprofiling.c") - .include("c-library/src/ittnotify/") - .include("c-library/include/"); // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not // always be available--define it here. if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { build.file("strnlen_s.c"); } + build + .file("c-library/src/ittnotify/ittnotify_static.c") + .file("c-library/src/ittnotify/jitprofiling.c") + .include("c-library/src/ittnotify/") + .include("c-library/include/"); build.compile("ittnotify"); } From 455c8a66079963612c7fee8806ca61e7e6ecd5ac Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 08:56:51 -0700 Subject: [PATCH 15/20] Install a newer version of MingW --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6b04c9a..73bfd8c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,6 +69,8 @@ jobs: if: matrix.target != '' - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' + - run: choco install mingw + if: matrix.target != 'x86_64-pc-windows-gnu' - name: Build Rust crate run: cargo build - name: Test Rust crate From 8727af8db97d984de986fef0751b25c29dc97c59 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 09:00:41 -0700 Subject: [PATCH 16/20] fix: install newer version of MinGW with the right target --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73bfd8c1..13668e81 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' - run: choco install mingw - if: matrix.target != 'x86_64-pc-windows-gnu' + if: matrix.target == 'x86_64-pc-windows-gnu' - name: Build Rust crate run: cargo build - name: Test Rust crate From 97c12a8211037594a92a4edcd0517a4514b00ed2 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 09:09:57 -0700 Subject: [PATCH 17/20] fix: force mingw version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13668e81..a7850c58 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: if: matrix.target != '' - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' - - run: choco install mingw + - run: choco install mingw --version 11.2.0 --force if: matrix.target == 'x86_64-pc-windows-gnu' - name: Build Rust crate run: cargo build From 415115fb9c7773ac9a1bccc05a4bbdd2f561891e Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 09:26:40 -0700 Subject: [PATCH 18/20] uninstall previous version of mingw --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7850c58..26bc3cdc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,9 @@ jobs: if: matrix.target != '' - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' - - run: choco install mingw --version 11.2.0 --force + - run: | + choco uninstall mingw + choco install mingw --version 11.2.0 --force if: matrix.target == 'x86_64-pc-windows-gnu' - name: Build Rust crate run: cargo build From 8b24d9750792c52baca85c8552102ffca4683362 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 09:29:17 -0700 Subject: [PATCH 19/20] remove re-definition of strnlen_s --- rust/ittapi-sys/build.rs | 5 ----- rust/ittapi-sys/strnlen_s.c | 18 ------------------ 2 files changed, 23 deletions(-) delete mode 100644 rust/ittapi-sys/strnlen_s.c diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 53050bc2..6cf4bb9b 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -5,11 +5,6 @@ fn main() { let mut build = cc::Build::new(); - // For `x86_64-pc-windows-gnu` targets (i.e., MinGW builds), the `strnlen_s` function may not - // always be available--define it here. - if let Ok("x86_64-pc-windows-gnu") = std::env::var("TARGET").as_deref() { - build.file("strnlen_s.c"); - } build .file("c-library/src/ittnotify/ittnotify_static.c") .file("c-library/src/ittnotify/jitprofiling.c") diff --git a/rust/ittapi-sys/strnlen_s.c b/rust/ittapi-sys/strnlen_s.c deleted file mode 100644 index d9c9026d..00000000 --- a/rust/ittapi-sys/strnlen_s.c +++ /dev/null @@ -1,18 +0,0 @@ -// Apply the definition of `strnlen_s` committed to mingw-w64 but not yet -// available (somehow) in the version of mingw available in the GitHub runner. -// This change is pulled from: -// https://github.com/mingw-w64/mingw-w64/commit/8a63e4c9f7252fded035c004dfe3f84e11677bf6 - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -__forceinline size_t __cdecl strnlen_s(const char* _src, size_t _count) { - return _src ? strnlen(_src, _count) : 0; -} - -#ifdef __cplusplus -} -#endif From 3ececdf1af404cb81cc08e7d2758068b06aeba9d Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 May 2022 13:30:09 -0700 Subject: [PATCH 20/20] Document current state --- .github/workflows/main.yml | 11 +++++++++-- rust/ittapi-sys/build.rs | 7 +++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26bc3cdc..2368e123 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,10 +69,17 @@ jobs: if: matrix.target != '' - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' - - run: | + - name: Upgrade MinGW package + # In https://github.com/bytecodealliance/wasmtime/pull/4003 we discovered that the ittapi C + # code uses the uncommon `strnlen_s` function. On older versions of MinGW (GitHub runners + # currently come with v8.1.0 pre-installed), this function was not available. Since v8.1.0, + # other versions have been published; this re-installs MinGW with a recent version which + # includes `strnlen_s`. This block can be removed if/when MinGW is upgraded in all Windows + # GitHub runners: https://github.com/actions/virtual-environments/issues/5530. + if: matrix.target == 'x86_64-pc-windows-gnu' + run: | choco uninstall mingw choco install mingw --version 11.2.0 --force - if: matrix.target == 'x86_64-pc-windows-gnu' - name: Build Rust crate run: cargo build - name: Test Rust crate diff --git a/rust/ittapi-sys/build.rs b/rust/ittapi-sys/build.rs index 6cf4bb9b..c20049f1 100644 --- a/rust/ittapi-sys/build.rs +++ b/rust/ittapi-sys/build.rs @@ -4,11 +4,10 @@ //! [#36]: https://github.com/intel/ittapi/issues/36 fn main() { - let mut build = cc::Build::new(); - build + cc::Build::new() .file("c-library/src/ittnotify/ittnotify_static.c") .file("c-library/src/ittnotify/jitprofiling.c") .include("c-library/src/ittnotify/") - .include("c-library/include/"); - build.compile("ittnotify"); + .include("c-library/include/") + .compile("ittnotify"); }