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

[Reactant] Cleanup the recipe #10345

Merged
merged 10 commits into from
Jan 26, 2025

Conversation

giordano
Copy link
Member

This goes together with EnzymeAD/Reactant.jl#616, but not quite ready yet because a bunch of things are failing still.

@giordano
Copy link
Member Author

giordano commented Jan 25, 2025

When compiling for aarch64-darwin I'm getting this interesting error:

ERROR: /workspace/bazel_root/097636303b1142f44508c1d8e3494e4b/external/llvm-project/llvm/BUILD.bazel:253:11: Compiling llvm/lib/Support/Path.cpp [for tool] failed: (Exit 1): cc failed: error executing command (from target @llvm-project//llvm:Support) 
  (cd /workspace/bazel_root/097636303b1142f44508c1d8e3494e4b/sandbox/processwrapper-sandbox/1787/execroot/__main__ && \
  exec env - \
    LD_LIBRARY_PATH=/usr/lib/csl-musl-x86_64:/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib:/workspace/x86_64-linux-musl-cxx11/destdir/lib:/workspace/x86_64-linux-musl-cxx11/destdir/lib64:/opt/x86_64-linux-musl/x86_64-linux-musl/lib64:/opt/x86_64-linux-musl/x86_64-linux-musl/lib:/opt/aarch64-apple-darwin20/aarch64-apple-darwin20/lib:/opt/aarch64-apple-darwin20/lib:/workspace/destdir/lib64:/workspace/destdir/lib \
    MACOSX_DEPLOYMENT_TARGET=10.14 \
    PATH=/workspace/srcdir/Reactant.jl/deps/ReactantExtra/.local/bin:/opt/bin/aarch64-apple-darwin20-libgfortran5-cxx11-cuda_version+none-gpu+none-mode+opt:/opt/aarch64-apple-darwin20/bin:/opt/bin/x86_64-linux-musl-cxx11:/opt/x86_64-linux-musl/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/workspace/x86_64-linux-musl-cxx11/destdir/bin:/workspace/destdir/bin \
    PWD=/proc/self/cwd \
  /opt/bin/aarch64-apple-darwin20-libgfortran5-cxx11-cuda_version+none-gpu+none-mode+opt/cc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/_objs/Support/Path.d '-frandom-seed=bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/_objs/Support/Path.o' '-DLLVM_ON_UNIX=1' '-DNO_HAVE_BACKTRACE=0' '-DBACKTRACE_HEADER=<execinfo.h>' '-DLTDL_SHLIB_EXT=".so"' '-DLLVM_PLUGIN_EXT=".so"' '-DLLVM_ENABLE_THREADS=0' '-DHAVE_DEREGISTER_FRAME=1' '-DHAVE_LIBPTHREAD=1' '-DFAKE_HAVE_PTHREAD_GETNAME_NP=0' '-DHAVE_PTHREAD_H=1' '-DFAKE_HAVE_PTHREAD_SETNAME_NP=0' '-DHAVE_REGISTER_FRAME=1' '-DHAVE_SETENV_R=1' '-DHAVE_STRERROR_R=1' '-DHAVE_SYSEXITS_H=1' '-DHAVE_UNISTD_H=1' -D_GNU_SOURCE '-DDONT_HAVE_ANY_MALLINFO=0' '-DHAVE_SBRK=1' '-DHAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1' -DHAVE_BUILTIN_THREAD_POINTER '-DLLVM_NATIVE_ARCH="X86"' '-DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser' '-DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter' '-DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler' '-DLLVM_NATIVE_TARGET=LLVMInitializeX86Target' '-DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86TargetInfo' '-DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC' '-DLLVM_NATIVE_TARGETMCA=LLVMInitializeX86TargetMCA' '-DLLVM_HOST_TRIPLE="x86_64-unknown-linux-gnu"' '-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-unknown-linux-gnu"' '-DLLVM_VERSION_MAJOR=20' '-DLLVM_VERSION_MINOR=0' '-DLLVM_VERSION_PATCH=0' '-DLLVM_VERSION_STRING="20.0.0git"' -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS '-DLLVM_HAS_AArch64_TARGET=1' '-DLLVM_HAS_AMDGPU_TARGET=1' '-DLLVM_HAS_ARM_TARGET=1' '-DLLVM_HAS_NVPTX_TARGET=1' '-DLLVM_HAS_PowerPC_TARGET=1' '-DLLVM_HAS_RISCV_TARGET=1' '-DLLVM_HAS_SystemZ_TARGET=1' '-DLLVM_HAS_X86_TARGET=1' '-DBLAKE3_USE_NEON=0' -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512 -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 '-DBAZEL_CURRENT_REPOSITORY="llvm-project"' -iquote external/llvm-project -iquote bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project -isystem external/llvm-project/llvm/include -isystem bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/include -g0 -g0 '-std=c++17' -w '-std=c++17' '--sysroot=/opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -Wno-unused-command-line-argument -Wno-gnu-offsetof-extensions -c external/llvm-project/llvm/lib/Support/Path.cpp -o bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/_objs/Support/Path.o)
# Configuration: 29a6cde99b57ba01c7ae1057ba90b176c4c0a222a082fa15807a139ec7c9e25d
# Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/llvm-project/llvm/lib/Support/Path.cpp:1199:
external/llvm-project/llvm/lib/Support/Unix/Path.inc:738:23: error: no member named 'st_atim' in 'stat'
  738 |   atime_nsec = Status.st_atim.tv_nsec;
      |                ~~~~~~ ^
external/llvm-project/llvm/lib/Support/Unix/Path.inc:739:23: error: no member named 'st_mtim' in 'stat'
  739 |   mtime_nsec = Status.st_mtim.tv_nsec;
      |                ~~~~~~ ^
2 errors generated.

Somehow this file, and apparently only this file at least until this point, is configured to target x86_64-linux instead of aarch64-darwin. By adding

BAZEL_BUILD_FLAGS+=(--action_env=SUPER_VERBOSE=1)

to the list of Bazel options you can see all other files are compiled targeting the right platform:

INFO: From Compiling llvm/lib/Demangle/RustDemangle.cpp:
ccache /opt/x86_64-linux-musl/bin/clang -target arm64-apple-darwin20 --sysroot=/opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root -Wno-unused-command-line-argument -nostdinc++ -isystem /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1 -mmacosx-version-min=10.14 -U_FORTIFY_SOURCE -fstack-protector -Wall -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++17 -MD -MF bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/RustDemangle.pic.d -frandom-seed=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/RustDemangle.pic.o -fPIC -DLLVM_ON_UNIX=1 -DNO_HAVE_BACKTRACE=0 -DBACKTRACE_HEADER=<execinfo.h> -DLTDL_SHLIB_EXT=".so" -DLLVM_PLUGIN_EXT=".so" -DLLVM_ENABLE_THREADS=0 -DHAVE_DEREGISTER_FRAME=1 -DHAVE_LIBPTHREAD=1 -DFAKE_HAVE_PTHREAD_GETNAME_NP=0 -DHAVE_PTHREAD_H=1 -DFAKE_HAVE_PTHREAD_SETNAME_NP=0 -DHAVE_REGISTER_FRAME=1 -DHAVE_SETENV_R=1 -DHAVE_STRERROR_R=1 -DHAVE_SYSEXITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MACH_MACH_H=1 -DHAVE_MALLOC_MALLOC_H=1 -DHAVE_MALLOC_ZONE_STATISTICS=1 -DHAVE_PROC_PID_RUSAGE=1 -DHAVE_UNW_ADD_DYNAMIC_FDE=1 -DLLVM_NATIVE_ARCH="AArch64" -DLLVM_NATIVE_ASMPARSER=LLVMInitializeAArch64AsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeAArch64AsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeAArch64Disassembler -DLLVM_NATIVE_TARGET=LLVMInitializeAArch64Target -DLLVM_NATIVE_TARGETINFO=LLVMInitializeAArch64TargetInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeAArch64TargetMC -DLLVM_NATIVE_TARGETMCA=LLVMInitializeAArch64TargetMCA -DLLVM_HOST_TRIPLE="arm64-apple-darwin" -DLLVM_DEFAULT_TARGET_TRIPLE="arm64-apple-darwin" -DLLVM_VERSION_MAJOR=20 -DLLVM_VERSION_MINOR=0 -DLLVM_VERSION_PATCH=0 -DLLVM_VERSION_STRING="20.0.0git" -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_HAS_AArch64_TARGET=1 -DLLVM_HAS_AMDGPU_TARGET=1 -DLLVM_HAS_ARM_TARGET=1 -DLLVM_HAS_NVPTX_TARGET=1 -DLLVM_HAS_PowerPC_TARGET=1 -DLLVM_HAS_RISCV_TARGET=1 -DLLVM_HAS_SystemZ_TARGET=1 -DLLVM_HAS_X86_TARGET=1 -DBAZEL_CURRENT_REPOSITORY="llvm-project" -iquote external/llvm-project -iquote bazel-out/darwin_arm64-opt/bin/external/llvm-project -isystem external/llvm-project/llvm/include -isystem bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/include -D__ARM_FEATURE_AES=1 -D__ARM_NEON=1 -D__ARM_FEATURE_SHA2=1 -DDNNL_ARCH_GENERIC=1 -std=c++17 -w -std=c++17 -DTCP_USER_TIMEOUT=0 -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fmodule-name=@llvm-project//llvm:Demangle -fmodule-map-file=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/Demangle.cppmap -fmodules-strict-decluse -Wprivate-header -fmodule-map-file=external/local_config_cc/module.modulemap -fmodule-map-file=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/config.cppmap -c external/llvm-project/llvm/lib/Demangle/RustDemangle.cpp -o bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/RustDemangle.pic.o
[...]
INFO: From Compiling llvm/lib/Demangle/MicrosoftDemangleNodes.cpp:
ccache /opt/x86_64-linux-musl/bin/clang -target arm64-apple-darwin20 --sysroot=/opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root -Wno-unused-command-line-argument -nostdinc++ -isystem /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1 -mmacosx-version-min=10.14 -U_FORTIFY_SOURCE -fstack-protector -Wall -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++17 -MD -MF bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/MicrosoftDemangleNodes.pic.d -frandom-seed=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/MicrosoftDemangleNodes.pic.o -fPIC -DLLVM_ON_UNIX=1 -DNO_HAVE_BACKTRACE=0 -DBACKTRACE_HEADER=<execinfo.h> -DLTDL_SHLIB_EXT=".so" -DLLVM_PLUGIN_EXT=".so" -DLLVM_ENABLE_THREADS=0 -DHAVE_DEREGISTER_FRAME=1 -DHAVE_LIBPTHREAD=1 -DFAKE_HAVE_PTHREAD_GETNAME_NP=0 -DHAVE_PTHREAD_H=1 -DFAKE_HAVE_PTHREAD_SETNAME_NP=0 -DHAVE_REGISTER_FRAME=1 -DHAVE_SETENV_R=1 -DHAVE_STRERROR_R=1 -DHAVE_SYSEXITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MACH_MACH_H=1 -DHAVE_MALLOC_MALLOC_H=1 -DHAVE_MALLOC_ZONE_STATISTICS=1 -DHAVE_PROC_PID_RUSAGE=1 -DHAVE_UNW_ADD_DYNAMIC_FDE=1 -DLLVM_NATIVE_ARCH="AArch64" -DLLVM_NATIVE_ASMPARSER=LLVMInitializeAArch64AsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeAArch64AsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeAArch64Disassembler -DLLVM_NATIVE_TARGET=LLVMInitializeAArch64Target -DLLVM_NATIVE_TARGETINFO=LLVMInitializeAArch64TargetInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeAArch64TargetMC -DLLVM_NATIVE_TARGETMCA=LLVMInitializeAArch64TargetMCA -DLLVM_HOST_TRIPLE="arm64-apple-darwin" -DLLVM_DEFAULT_TARGET_TRIPLE="arm64-apple-darwin" -DLLVM_VERSION_MAJOR=20 -DLLVM_VERSION_MINOR=0 -DLLVM_VERSION_PATCH=0 -DLLVM_VERSION_STRING="20.0.0git" -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_HAS_AArch64_TARGET=1 -DLLVM_HAS_AMDGPU_TARGET=1 -DLLVM_HAS_ARM_TARGET=1 -DLLVM_HAS_NVPTX_TARGET=1 -DLLVM_HAS_PowerPC_TARGET=1 -DLLVM_HAS_RISCV_TARGET=1 -DLLVM_HAS_SystemZ_TARGET=1 -DLLVM_HAS_X86_TARGET=1 -DBAZEL_CURRENT_REPOSITORY="llvm-project" -iquote external/llvm-project -iquote bazel-out/darwin_arm64-opt/bin/external/llvm-project -isystem external/llvm-project/llvm/include -isystem bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/include -D__ARM_FEATURE_AES=1 -D__ARM_NEON=1 -D__ARM_FEATURE_SHA2=1 -DDNNL_ARCH_GENERIC=1 -std=c++17 -w -std=c++17 -DTCP_USER_TIMEOUT=0 -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fmodule-name=@llvm-project//llvm:Demangle -fmodule-map-file=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/Demangle.cppmap -fmodules-strict-decluse -Wprivate-header -fmodule-map-file=external/local_config_cc/module.modulemap -fmodule-map-file=bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/config.cppmap -c external/llvm-project/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp -o bazel-out/darwin_arm64-opt/bin/external/llvm-project/llvm/_objs/Demangle/MicrosoftDemangleNodes.pic.o

I'm extremely puzzled by this.

Edit: running bazel with --keep_going shows that that's literally the only file targeting x86_64-linux, what the heck.

@giordano giordano force-pushed the mg/cleanup-reactant branch from 011f3a9 to 7650c35 Compare January 25, 2025 21:49
@giordano giordano marked this pull request as ready for review January 25, 2025 21:51
@giordano
Copy link
Member Author

Alright, for the time being I'm giving up on coupling this with EnzymeAD/Reactant.jl#616, but somehow the changes here fix the error reported at #10330 (comment) so we can upgrade BBB and restore #10332, which had been reverted by #10334.

I have honestly zero clue of how the changes in this PR (which should be mostly cosmetic) can possibly affect in any way the issue in #10330 (comment) (which still remains a mystery to me), but I take this as a victory and move on for now.

@giordano giordano force-pushed the mg/cleanup-reactant branch from 153f4a6 to d62153a Compare January 26, 2025 11:16
@giordano giordano enabled auto-merge (squash) January 26, 2025 11:21
@giordano giordano disabled auto-merge January 26, 2025 13:10
@giordano giordano enabled auto-merge (squash) January 26, 2025 13:24
@giordano giordano merged commit 4f81f69 into JuliaPackaging:master Jan 26, 2025
7 checks passed
@giordano giordano deleted the mg/cleanup-reactant branch January 26, 2025 13:41
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.

1 participant