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

Build failure: ocamlPackages.bap #268641

Closed
katrinafyi opened this issue Nov 20, 2023 · 1 comment
Closed

Build failure: ocamlPackages.bap #268641

katrinafyi opened this issue Nov 20, 2023 · 1 comment
Labels
0.kind: build failure A package fails to build

Comments

@katrinafyi
Copy link
Member

katrinafyi commented Nov 20, 2023

Steps To Reproduce

Steps to reproduce the behavior:

  1. build ocamlPackages.bap

Build log

Full log: https://gist.github.com/katrinafyi/399d96db126155a9670d198564eaa557

+ /nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0/bin/c++ -O2 -std=c++11 -fPIC -I/nix/store/dpk6p6z5zwl1jfn7hwkgyfwaj7zdpg77-ocaml-4.14.1/lib/ocaml -I/nix/store/ynx5b72yqhqlixrv78ad0zr7m55vzh2x-ocaml4.14.1-bap-2.5.0/lib/bap -Ilib/bap_disasm -I/nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include -std=c++17   -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -c lib/bap_llvm/llvm_disasm.cpp -o lib/bap_llvm/llvm_disasm.o

lib/bap_llvm/llvm_disasm.cpp: In function 'void parse_environment_options(const char*, const char*)':
lib/bap_llvm/llvm_disasm.cpp:652:11: error: 'Optional' is not a member of 'llvm'; did you mean 'llvm::cl::Optional'?
  652 |     llvm::Optional<std::string> env_value = llvm::sys::Process::GetEnv(llvm::StringRef(env_var));
      |           ^~~~~~~~
In file included from lib/bap_llvm/llvm_disasm.cpp:8:
/nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include/llvm/Support/CommandLine.h:114:3: note: 'llvm::cl::Optional' declared here
  114 |   Optional = 0x00,        // Zero or One occurrence
      |   ^~~~~~~~
lib/bap_llvm/llvm_disasm.cpp:652:31: error: expected primary-expression before '>' token
  652 |     llvm::Optional<std::string> env_value = llvm::sys::Process::GetEnv(llvm::StringRef(env_var));
      |                               ^
lib/bap_llvm/llvm_disasm.cpp:652:33: error: 'env_value' was not declared in this scope; did you mean 'env_var'?
  652 |     llvm::Optional<std::string> env_value = llvm::sys::Process::GetEnv(llvm::StringRef(env_var));
      |                                 ^~~~~~~~~
      |                                 env_var
In file included from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/shared_ptr.h:53,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/memory:76,
                 from /nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include/llvm/ADT/SmallVector.h:28,
                 from /nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include/llvm/ADT/ArrayRef.h:13,
                 from /nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include/llvm/MC/MCTargetOptions.h:12,
                 from /nix/store/waq6fnibkdvq7rmglm86yk95dfg87lj5-llvm-16.0.6-dev/include/llvm/MC/MCAsmInfo.h:20,
                 from lib/bap_llvm/llvm_disasm.cpp:1:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/shared_ptr_base.h: In instantiation of 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*) [with _Yp = llvm::MCSubtargetInfo; <template-parameter-2-2> = void; _Tp = const llvm::MCSubtargetInfo; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]':
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/shared_ptr.h:214:46:   required from 'std::shared_ptr<_Tp>::shared_ptr(_Yp*) [with _Yp = llvm::MCSubtargetInfo; <template-parameter-2-2> = void; _Tp = const llvm::MCSubtargetInfo]'
lib/bap_llvm/llvm_disasm.cpp:241:71:   required from here
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/shared_ptr_base.h:1472:26: error: invalid application of 'sizeof' to incomplete type 'llvm::MCSubtargetInfo'
 1472 |           static_assert( sizeof(_Yp) > 0, "incomplete type" );
      |                          ^~~~~~~~~~~
Command exited with code 1.
Compilation unsuccessful after building 2199 targets (0 cached) in 00:08:02.
make: *** [Makefile:8: build] Error 1
error: builder for '/nix/store/isd6pfnd0sbcf97pfr9sgz3a8bm6bdin-ocaml4.14.1-bap-2.5.0.drv' failed with exit code 2;

Additional context

This looks like an incompatibility with newer LLVM versions. conf-bap-llvm accepts 6.0 through 14.0 but recent nixpkgs-unstable uses llvm = llvm_16.

Changing to llvm_11 does build successfully. For example,

$ nix-build -E 'with (import <nixpkgs> {}); ocamlPackages.bap.override { llvm = llvm_11; }'
/nix/store/zgbjmm78i8db3ycdvdmf1wbxwb3sxh40-ocaml4.14.1-bap-2.5.0

Notify maintainers

@maurer

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.1-1-default, openSUSE Tumbleweed, noversion, nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@katrinafyi katrinafyi added the 0.kind: build failure A package fails to build label Nov 20, 2023
@wegank
Copy link
Member

wegank commented Dec 12, 2023

Closed by #269127.

@wegank wegank closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

No branches or pull requests

2 participants