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

add swap for windows, add debug for macos, rerender #187

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Oct 31, 2024

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Debug build issues

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@h-vetinari
Copy link
Member

Could you try removing

export CXXFLAGS=${CXXFLAGS/-stdlib=libc++ /}

?

@mattip
Copy link
Contributor Author

mattip commented Oct 31, 2024

cc @h-vetinari

This all seems so fragile. The windows builds are newly failing with

external/com_google_protobuf/upb/message/internal/message.c(22): error C2099: initializer is not a constant

and macOS arm64 is newly failing with

In file included from external/zlib/zutil.c:10:
In file included from external/zlib/gzguts.h:20:
In file included from /Users/runner/miniforge3/conda-bld/ray-packages_1730357054105/_build_env/include/c++/v1/stdio.h:108:
/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/stdio.h:210:7: error: expected identifier or '('
  210 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
external/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */

It would be nice if we could refactor bazel build to use the conda-provided system libraries instead of building everything from source.

@mattip
Copy link
Contributor Author

mattip commented Oct 31, 2024

Anyhow, to the point of the PR: the macOS x64_86 builds show CXXFLAGS has -stdlib=libc++ just before the build:

CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/runner/miniforge3/conda-bld/ray-packages_1730357074667/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/ray-packages_1730357074667/work=/usr/local/src/conda/ray-core-2.38.0 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/ray-packages_1730357074667/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh=/usr/local/src/conda-prefix

@mattip
Copy link
Contributor Author

mattip commented Oct 31, 2024

Could you try removing ...

I removed all the bug-fixes I put in over what is needed for a cross-platform build. Let's see which are still needed

@h-vetinari
Copy link
Member

This all seems so fragile. The windows builds are newly failing with

Given that this only happened in one job, I was wondering if this was a flake...

Anyhow, to the point of the PR: the macOS x64_86 builds show CXXFLAGS has -stdlib=libc++ just before the build:

Yeah, I think the issue is that bazel does all its hermetic build isolation, and will generally ignore all environment variables unless specifically instructed to do so (at least, IIRC). Looking at the failed call (added linebreaks for legibility), I don't see -stdlib=libc++ anywhere.

external/local_config_cc/wrapped_clang_pp \
    '-D_FORTIFY_SOURCE=1' \
    -fstack-protector \
    -fcolor-diagnostics \
    -Wall \
    -Wthread-safety \
    -Wself-assign \
    -fno-omit\
    -frame-pointer \
    -g0 \
    -O2 \
    -DNDEBUG \
    '-DNS_BLOCK_ASSERTIONS=1' \
    '-std=c++11' \
    'DEBUG_PREFIX_MAP_PWD=.' \
    -iquote external/com_google_absl \
    -iquote bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl \
    -MD \
    -MF bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.d \
    '-DBAZEL_CURRENT_REPOSITORY="com_google_absl"' \
    '-frandom-seed=bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o' \
    -isysroot __BAZEL_XCODE_SDKROOT__ \
    -f__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks \
    -f__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks \
    -no-canonical-prefixes \
    -pthread \
    -g0 \
    -W \
    -g0 \
    '-std=c++17' \
    -Wall \
    -Wextra \
    -Wc++98-compat-extra-semi \
    -Wcast-qual \
    -Wconversion \
    -Wdeprecated-pragma \
    -Wfloat-overflow-conversion \
    -Wfloat-zero-conversion \
    -Wfor-loop-analysis \
    -Wformat-security \
    -Wgnu-redeclared-enum \
    -Winfinite-recursion \
    -Winvalid-constexpr \
    -Wliteral-conversion \
    -Wmissing-declarations \
    -Woverlength-strings \
    -Wpointer-arith \
    -Wself-assign \
    -Wshadow-all \
    -Wshorten-64-to-32 \
    -Wsign-conversion \
    -Wstring-conversion \
    -Wtautological-overlap-compare \
    -Wtautological-unsigned-zero-compare \
    -Wundef \
    -Wuninitialized \
    -Wunreachable-code \
    -Wunused-comparison \
    -Wunused-local-typedefs \
    -Wunused-result \
    -Wvla \
    -Wwrite-strings \
    -Wno\
    -float-conversion \
    -Wno-implicit\
    -float-conversion \
    -Wno-implicit-int\
    -float-conversion \
    -Wno-unknown\
    -Warning-option \
    -DNOMINMAX \
    -no-canonical-prefixes \
    -Wno-builtin-macro-redefined \
    '-D__DATE__="redacted"' \
    '-D__TIMESTAMP__="redacted"' \
    '-D__TIME__="redacted"' \
    -target x86_64-apple-macosx10.15 \
    -c external/com_google_absl/absl/numeric/int128.cc \
    -o bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o

It would be nice if we could refactor bazel build to use the conda-provided system libraries instead of building everything from source.

💯

@@ -5,7 +5,7 @@
jobs:
- job: osx
pool:
vmImage: macOS-13
vmImage: macOS-14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to persist this across rerenders, you can do

azure:
  settings_osx:
    pool:
      vmImage: macos-14

in conda-forge.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was just an experiment

@mattip
Copy link
Contributor Author

mattip commented Nov 6, 2024

This blog post provides a recipe for using system libraries in a bazel build.

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.

3 participants