build2 / build2

build2 build system
MIT License
564 stars 13 forks source link

Assertion failed: `r_->mode_ != members_mode::always` #364

Open boris-kolpackov opened 4 months ago

boris-kolpackov commented 4 months ago
$ bdep test
error: no rule to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\impl_target{cuda_nvrtc-windows-x86_64-11.6.124-archive}
  info: target ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\impl_target{cuda_nvrtc-windows-x86_64-11.6.124-archive} is not declared in any buildfile
  info: re-run with --verbose=4 for more information
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\libs{nvrtc}
  info: while applying rule bin.lib to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\lib{nvrtc}
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\dir{libnvrtc\}
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\dir{libnvrtc\}
info: failed to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\dir{libnvrtc\}
$ bdep test
error: no rule to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\impl_target{cuda_nvrtc-windows-x86_64-11.6.124-archive}
  info: target ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\impl_target{cuda_nvrtc-windows-x86_64-11.6.124-archive} is not declared in any buildfile
  info: re-run with --verbose=4 for more information
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\libs{nvrtc}
  info: while applying rule bin.lib to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\libnvrtc\lib{nvrtc}
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\libnvrtc\dir{libnvrtc\}
  info: while applying rule test to update (for test) ..\..\..\sw-build2-cuda-toolkit-msvc\dir{libnvrtc\}
Assertion failed: r_->mode_ != members_mode::always, file C:\build2-build\build2-toolchain-0.17.0-a.0.20231214073339.6d7df2370760\build2\libbuild2/target.ixx, line 614
error: process b terminated abnormally: aborted

Feel like the assert is the consequence of the preceding error (which maybe causes the group member resolution to fail?)

helmesjo commented 4 months ago

Possibly related: #366

These two errors are both related to the (ab)use of depdb dyndep --dyn-target AFAIK.

helmesjo commented 1 week ago

@boris-kolpackov I managed to get this again and sniped a reproducer (macos).

$ bdep --version
bdep 0.17.0
libbpkg 0.17.0
libbutl 0.17.0

build2-assert.tar.gz

$ tar -xf build2-assert.tar.gz && cd cppfront/cppfront
$ b
warning: configured src_root ../../../cppfront/cppfront/ does not match forwarded ./
synchronizing /Users/fho/git/b2pkgs/cppfront-gcc/:
  update cppfront-tests/0.1.0-a.0.20240622165335
Assertion failed: (r_->mode_ != members_mode::always), function switch_mode, file target.ixx, line 614.
error: process bpkg terminated abnormally: aborted (SIGABRT)
../../../cppfront-gcc/build/bootstrap/pre-bdep-sync.build:10:9: error: process bdep exited with code 1
  info: command line: bdep sync --hook=1 --verbose 1 --config /Users/fho/git/b2pkgs/cppfront-gcc