rnburn / cpp20-module-example

4 stars 1 forks source link

Does not compile on macOS with xcode 14.2 #2

Open nadiasvertex opened 1 year ago

nadiasvertex commented 1 year ago

Cloned this and tried to build per the instructions.

csnelson@ cpp20-module-example % bazelisk build //...
INFO: Analyzed 6 targets (45 packages loaded, 498 targets configured).
INFO: Found 6 targets...
ERROR: /Users/csnelson/cpp20-module-example/toolchain/BUILD:5:10: Action toolchain/cc_module_interface-_Builtin_stddef_max_align_t.o failed: (Exit 1): driver failed: error executing command (from target //toolchain:_Builtin_stddef_max_align_t) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_github_rnburn_bazel_cpp20_modules/util/driver/driver --object_out ... (remaining 42 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error: module compilation requires '-fmodules'
1 error generated.
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.runfiles/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.py", line 30, in <module>
    main()
  File "/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.runfiles/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.py", line 24, in main
    invoke_clang(driver_args, compiler, compiler_args)
  File "/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.runfiles/com_github_rnburn_bazel_cpp20_modules/util/driver/clang.py", line 104, in invoke_clang
    make_system_module(driver_args, compiler, interface_args)
  File "/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_github_rnburn_bazel_cpp20_modules/util/driver/driver.runfiles/com_github_rnburn_bazel_cpp20_modules/util/driver/clang.py", line 80, in make_system_module
    subprocess.run(args, check=True)
  File "/Applications/Xcode-14.2.0.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++', '-cc1', '-triple', 'arm64-apple-macosx13.1.0', '-Wundef-prefix=TARGET_OS_', '-Wdeprecated-objc-isa-usage', '-Werror=deprecated-objc-isa-usage', '-Werror=implicit-function-declaration', '-emit-module', '-disable-free', '-clear-ast-before-backend', '-disable-llvm-verifier', '-discard-value-names', '-main-file-name', '_Builtin_stddef_max_align_t.cc', '-mrelocation-model', 'pic', '-pic-level', '2', '-mframe-pointer=non-leaf', '-fno-strict-return', '-fno-rounding-math', '-funwind-tables=2', '-fobjc-msgsend-selector-stubs', '-target-sdk-version=13.1', '-fvisibility-inlines-hidden-static-local-var', '-target-cpu', 'apple-m1', '-target-feature', '+v8.5a', '-target-feature', '+fp-armv8', '-target-feature', '+neon', '-target-feature', '+crc', '-target-feature', '+crypto', '-target-feature', '+dotprod', '-target-feature', '+fp16fml', '-target-feature', '+ras', '-target-feature', '+lse', '-target-feature', '+rdm', '-target-feature', '+rcpc', '-target-feature', '+zcm', '-target-feature', '+zcz', '-target-feature', '+fullfp16', '-target-feature', '+sm4', '-target-feature', '+sha3', '-target-feature', '+sha2', '-target-feature', '+aes', '-target-abi', 'darwinpcs', '-fallow-half-arguments-and-returns', '-debugger-tuning=lldb', '-target-linker-version', '820.1', '-resource-dir', '/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0', '-isysroot', '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk', '-iquote', '.', '-F/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks', '-F/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks', '-stdlib=libc++', '-internal-isystem', '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1', '-internal-isystem', '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include', '-internal-isystem', '/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include', '-internal-externc-isystem', '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include', '-internal-externc-isystem', '/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include', '-O0', '-Wall', '-Wthread-safety', '-Wself-assign', '-Wno-builtin-macro-redefined', '-Wno-reorder-init-list', '-Wno-implicit-int-float-conversion', '-Wno-c99-designator', '-Wno-final-dtor-non-final-class', '-Wno-extra-semi-stmt', '-Wno-misleading-indentation', '-Wno-quoted-include-in-framework-header', '-Wno-implicit-fallthrough', '-Wno-enum-enum-conversion', '-Wno-enum-float-conversion', '-Wno-elaborated-enum-base', '-Wno-reserved-identifier', '-Wno-gnu-folding-constant', '-Wno-cast-function-type', '-Wno-bitwise-instead-of-logical', '-std=c++11', '-fdeprecated-macro', '-fdebug-compilation-dir=/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example', '-fdebug-prefix-map=/private/var/tmp/_bazel_csnelson/4a04cd76de1e2dc3423011ea4f404830/sandbox/darwin-sandbox/4/execroot/com_github_rnburn_cpp20_module_example=.', '-ferror-limit', '19', '-pthread', '-stack-protector', '1', '-fstack-check', '-mdarwin-stkchk-strong-link', '-fblocks', '-fencode-extended-block-signature', '-fregister-global-dtors-with-atexit', '-fgnuc-version=4.2.1', '-fno-cxx-modules', '/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/module.modulemap', '-fcxx-exceptions', '-fexceptions', '-fmax-type-align=16', '-fcommon', '-fcolor-diagnostics', '-clang-vendor-feature=+messageToSelfInClassMethodIdReturnType', '-clang-vendor-feature=+disableInferNewAvailabilityFromInit', '-clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation', '-fno-odr-hash-protocols', '-clang-vendor-feature=+enableAggressiveVLAFolding', '-clang-vendor-feature=+revert09abecef7bbf', '-clang-vendor-feature=+thisNoAlignAttr', '-clang-vendor-feature=+thisNoNullAttr', '-mllvm', '-disable-aligned-alloc-awareness=1', '-D__GCC_HAVE_DWARF2_CFI_ASM=1', '-o', 'bazel-out/darwin_arm64-fastbuild/bin/toolchain/_Builtin_stddef_max_align_t.pcm', '-x', 'c++', '-fmodule-name=_Builtin_stddef_max_align_t']' returned non-zero exit status 1.
INFO: Elapsed time: 23.161s, Critical Path: 1.25s
INFO: 19 processes: 16 internal, 3 darwin-sandbox.
FAILED: Build did NOT complete successfully
rnburn commented 1 year ago

This project was more of an experiment.

I would check out https://github.com/eomii/rules_ll if you want to use modules with bazel

nadiasvertex commented 1 year ago

I see... well, it's linked from isocpp.org, which seems pretty official. It might make sense to indicate that this is not supposed to be an "official" example, it's just an experiment that might not actually work for people.

On Tue, May 2, 2023 at 7:37 PM Ryan Burn @.***> wrote:

This project was more of an experiment.

I would check out https://github.com/eomii/rules_ll if you want to use modules with bazel

— Reply to this email directly, view it on GitHub https://github.com/rnburn/cpp20-module-example/issues/2#issuecomment-1532386745, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPQTPH6VFWMWXFFFWXJRLLXEHAHJANCNFSM6AAAAAAXTZ55XU . You are receiving this because you authored the thread.Message ID: @.***>