<div dir="ltr"><div><div>(b and bpkg versions at the end of this email)<br></div><div>Repro sources: <a href="https://klaimsden.net/temp/jlamotte-build2-bugreport-fail-build-all-targets.zip">https://klaimsden.net/temp/jlamotte-build2-bugreport-fail-build-all-targets.zip</a></div><div>Windows 10 64bit - VS2017 15.6.x</div><div><br></div><div>When building the following buildfile scripts separately (after a "clean")</div><div>I observe that only case B builds all the library and exe targets (also tested with shared libs).</div><div>With all other cases there is no error. The build just stops after the first target and there is no mention of the others. (I suspect that syntax issues appearing after the first library/exe <br></div><div>target in the buildfile  were also ignored,</div><div>so maybe it's just the lexer that stops too early.)</div><div><br></div><div>The only condition I found so far to trigger this problem is to not use/refer-to the other</div><div>targets in the first exe or library target appearing in the file.</div><div>If any library is used by the first exe/lib target, it will be built.</div><div><br></div><div>My understanding so far was that the target name order is not important for build2.</div><div>Looking at the build2 repo I realized before that it might not be important (like in make?).</div><div><br></div><div>Even if my assumption is incorrect, not building declared targets looks like a real bug.</div><div>In particular for packages that are only a set of libraries.</div><div><br></div><div>Its easy to reproduce this with dummy files, the repro sources are just setup for that.</div><div>I don't now how exactly but maybe they can be setup as unit tests.</div><div><br></div><div>A. Joël Lamotte</div><div><br></div><div>-------------------------------------------------------------------------------</div><div><br></div><div>Case B output (as expected):</div><div><br></div><div>PS E:\Tests\build2-experiment> bpkg build .\fail_build_all_libs\ -d .\whoops\</div><div>c++ fail_build_all_libs\cxx{y}@whoops\fail_build_all_libs\</div><div>c++ fail_build_all_libs\cxx{app_linking}@whoops\fail_build_all_libs\</div><div>c++ fail_build_all_libs\cxx{x}@whoops\fail_build_all_libs\</div><div>c++ fail_build_all_libs\cxx{z}@whoops\fail_build_all_libs\</div><div>ld whoops\fail_build_all_libs\liba{lib_x}</div><div>ld whoops\fail_build_all_libs\liba{lib_y}</div><div>ld whoops\fail_build_all_libs\liba{lib_z}</div><div>ld whoops\fail_build_all_libs\exe{app}</div><div>updated fail_build_all_libs/0.1.0</div><div><br></div><div>Case A output (not expected):</div><div><br></div><div>PS E:\Tests\build2-experiment> bpkg build .\fail_build_all_libs\ -d .\whoops\ -v</div><div>E:\tools\build2\build2-install\bin\b -v info: .\fail_build_all_libs\</div><div>E:\tools\build2\build2-install\bin\b -v update('.\whoops\fail_build_all_libs\')</div><div>cl /std:c++latest /D__cpp_modules=201704 /experimental:module /nologo /EHsc /MD /Fo: whoops\fail_build_all_libs\x.lib.obj /c /TP E:\Tests\build2-experiment\fail_build_all_libs\x.cpp</div><div>lib /NOLOGO /MACHINE:x64 /OUT:whoops\fail_build_all_libs\lib_x.lib whoops\fail_build_all_libs\x.lib.obj</div><div>updated fail_build_all_libs/0.1.0</div><div><br></div><div><br></div><div><br></div><div>-------------------------------------------------------------------------------</div><div># buildfile cases:</div><div><br></div><div>#####################################################</div><div>## A. The following stops building after the first target:</div><div><br></div><div># OK:built</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div># ISSUE: not built?</div><div>exe{app} : cxx{app_linking} liba{lib_x} liba{lib_y} liba{lib_z}</div><div><br></div><div>####################################################</div><div>## B. The following works as expected, compiles everything:</div><div><br></div><div># OK:built</div><div>exe{app} : cxx{app_linking} liba{lib_x} liba{lib_y} liba{lib_z}</div><div><br></div><div># OK:built</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># OK:built</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># OK:built</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div>###################################################</div><div>## C. Stops at the first target, whatever the order:</div><div><br></div><div># OK:built</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>exe{app} : cxx{app_linking} liba{lib_x} liba{lib_y} liba{lib_z}</div><div><br></div><div>##################################################</div><div># D. Stops at the first target, whatever the target type (same with shared libraries):</div><div><br></div><div># OK:built</div><div>exe{app_1}: cxx{app_standalone}</div><div><br></div><div># ISSUE: not built?</div><div>exe{app_2}: cxx{app_standalone}</div><div><br></div><div># ISSUE: not built?</div><div>exe{app_3}: cxx{app_standalone}</div><div><br></div><div><br></div><div>###################################################</div><div>## E. Stops at the first target if not used by the first target:</div><div><br></div><div># OK:built</div><div>exe{app} : cxx{app_standalone}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div>###################################################</div><div>## F Only build targets used by the first one:</div><div><br></div><div># OK:built</div><div>exe{app} : cxx{app_standalone} liba{lib_x}</div><div><br></div><div># OK:built</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div><br></div><div>###################################################</div><div>## G Only build targets used by the first one:</div><div><br></div><div># OK:built</div><div>exe{app} : cxx{app_standalone} liba{lib_z}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># OK:built</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div>###################################################</div><div>## H Only build targets recursively used by the first one:</div><div><br></div><div># OK:built</div><div>exe{app} : cxx{app_standalone} liba{lib_z}</div><div><br></div><div># OK:built</div><div>liba{lib_x}: cxx{x}</div><div><br></div><div># ISSUE: not built?</div><div>liba{lib_y}: cxx{y}</div><div><br></div><div># OK:built</div><div>liba{lib_z}: cxx{z} lib{lib_x}</div><div><br></div><div><br></div><div>###################################################</div><div>## I Only build targets used by the first one:</div><div><br></div><div># OK:built</div><div>liba{lib_x}: cxx{x} liba{lib_y}</div><div><br></div><div># OK:built</div><div>liba{lib_y}: cxx{y} liba{lib_z}</div><div><br></div><div># OK:built</div><div>liba{lib_z}: cxx{z}</div><div><br></div><div># ISSUE: not built?</div><div>exe{app} : cxx{app_standalone} liba{lib_x}</div><div><br></div><div><br></div><div><br></div><div><br></div><div>--------------------------------------------------------------------------------</div><div><br></div><div><br></div><div><br></div><div>PS E:\Tests\build2-experiment> bpkg --version</div><div>bpkg 0.7.0-a.0.d6e7058475ee</div><div>libbpkg 0.7.0-a.0.f8bee7e57187</div><div>libbutl 0.7.0-a.0.26efe301f4a7</div><div>Copyright (c) 2014-2017 Code Synthesis Ltd</div><div>This is free software released under the MIT license.</div><div><br></div><div>PS E:\Tests\build2-experiment> b --version</div><div>build2 0.7.0-a.0.903eeb2c681f</div><div>libbutl 0.7.0-a.0.26efe301f4a7</div><div>host x86_64-microsoft-win32-msvc14.1</div><div>Copyright (c) 2014-2017 Code Synthesis Ltd</div><div>This is free software released under the MIT license.</div></div><div><br></div></div>