Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake, use 'NOT WIN32' instead of 'UNIX' #2075

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

justsmth
Copy link
Contributor

@justsmth justsmth commented Dec 20, 2024

Description of changes:

CMake condition on UNIX should instead be NOT WIN32 b/c some unix-like operating systems do not identify with "UNIX".

Callout

The "UNIX" variable appears to not be set on illumos, which leads to build failures like this: https://github.com/rust-lang/rustup/actions/runs/12384929706/job/34570334451#step:17:584

Testing

I verified locally that with this change the build of aws-lc-sys for x86_64-unknown-illumos succeeds.

❯ cargo clean && cross build --target x86_64-unknown-illumos
     Removed 215 files, 74.6MiB total
[+] Building 7.1s (8/8) FINISHED                                                                                                                                                                                                                                 docker-container:container
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 843B                                                                                                                                                                                                                                                   0.0s
 => [internal] load metadata for ghcr.io/cross-rs/x86_64-unknown-illumos:main                                                                                                                                                                                                          0.3s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                        0.0s
 => [1/3] FROM ghcr.io/cross-rs/x86_64-unknown-illumos:main@sha256:ff410dca255986b9bb06f74c466f5d032502951d49c4436b401c3d7acd17a0d3                                                                                                                                                    0.0s
 => => resolve ghcr.io/cross-rs/x86_64-unknown-illumos:main@sha256:ff410dca255986b9bb06f74c466f5d032502951d49c4436b401c3d7acd17a0d3                                                                                                                                                    0.0s
 => CACHED [2/3] RUN apt-get update &&     apt-get install --assume-yes --no-install-recommends gpg-agent software-properties-common &&     add-apt-repository --yes ppa:longsleep/golang-backports &&     apt-get update &&     apt-get install --assume-yes --no-install-recommends  0.0s
 => CACHED [3/3] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable &&     . $HOME/.cargo/env &&     cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin &&     rm -rf $HOME/.ca  0.0s
 => exporting to docker image format                                                                                                                                                                                                                                                   6.7s
 => => exporting layers                                                                                                                                                                                                                                                                0.0s
 => => exporting manifest sha256:e61a79c40bbd531f030688b9306e726757fb3b45ac9a62a81fced103d4c12344                                                                                                                                                                                      0.0s
 => => exporting config sha256:6cc549d380a42123a4f54e820fd0d1b09817b446fc521540a6ad799c3bdb6c72                                                                                                                                                                                        0.0s
 => => sending tarball                                                                                                                                                                                                                                                                 6.7s
 => importing to docker                                                                                                                                                                                                                                                                0.0s
   Compiling libc v0.2.168
   Compiling shlex v1.3.0
   Compiling fs_extra v1.3.0
   Compiling paste v1.0.15
   Compiling dunce v1.0.5
   Compiling jobserver v0.1.32
   Compiling cc v1.2.3
   Compiling cmake v0.1.52
   Compiling aws-lc-sys v0.24.0 (/Users/justsmth/repos/aws-lc-rs/aws-lc-sys)
warning: [email protected]: Building with: CMake
warning: [email protected]: Symbol Prefix: Some("aws_lc_0_24_0")
warning: [email protected]: CMAKE environment variable set: cmake
warning: [email protected]: Generating bindings - external bindgen. Platform: x86_64-unknown-illumos
warning: [email protected]: Compilation of 'c11.c' succeeded - Ok(["/target/x86_64-unknown-illumos/debug/build/aws-lc-sys-00266876999d9957/out/out-c11/7dfda64fdf5a526c-c11.o"]).
warning: [email protected]: CC environment variable set: clang
warning: [email protected]: CXX environment variable set: clang++
warning: [email protected]: Setting CFLAGS: "-O0 -ffunction-sections -fdata-sections -fPIC -g -fno-omit-frame-pointer -m64 -std=c11 -I /Users/justsmth/repos/aws-lc-rs/aws-lc-sys/generated-include -I /Users/justsmth/repos/aws-lc-rs/aws-lc-sys/include -I /Users/justsmth/repos/aws-lc-rs/aws-lc-sys/aws-lc/include -I /Users/justsmth/repos/aws-lc-rs/aws-lc-sys/aws-lc/third_party/s2n-bignum/include -Wall -Wextra -Wno-unused-parameter -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_24_0"
warning: [email protected]: CMAKE_TOOLCHAIN_FILE environment variable set: /opt/toolchain.cmake
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 36.72s

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@justsmth justsmth requested a review from a team as a code owner December 20, 2024 18:53
@justsmth justsmth requested a review from skmcgrail December 20, 2024 18:53
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.76%. Comparing base (39b3fae) to head (4414a1e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2075   +/-   ##
=======================================
  Coverage   78.75%   78.76%           
=======================================
  Files         598      598           
  Lines      103650   103650           
  Branches    14718    14720    +2     
=======================================
+ Hits        81633    81637    +4     
+ Misses      21366    21362    -4     
  Partials      651      651           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justsmth justsmth merged commit 591c67e into aws:main Jan 3, 2025
125 checks passed
@justsmth justsmth deleted the cmake-not-win32 branch January 3, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants