Building profiled executables with hadrian doesn't force libraries to be built with profiling
If you build with
--flavour=default+no_profiled_libs then try to run the testsuite you get:
Error when running Shake build system: at want, called at src/Main.hs:104:30 in main:Main * Depends on: test at need, called at src/Rules/Test.hs:215:3 in main:Rules.Test * Depends on: _build/stage1/lib/bin/ghc-iserv-prof at registerPackages, called at src/Rules/Program.hs:99:3 in main:Rules.Program at need, called at src/Rules/Register.hs:81:5 in main:Rules.Register * Depends on: _build/stage1/lib/x86_64-linux-ghc-9.1.20210401/unix-126.96.36.199/libHSunix-188.8.131.52_p.a at error, called at src/Development/Shake/Internal/Rules/File.hs:179:58 in shake-0.19.4-f8cdc3e489342853f74786242c9a766272e61ed4562f4c435df2b56d21e8d3fd:Development.Shake.Internal.Rules.File * Raised the exception: Error, rule finished running but did not produce file: _build/stage1/lib/x86_64-linux-ghc-9.1.20210401/unix-184.108.40.206/libHSunix-220.127.116.11_p.a
This happens because we try to build
iserv-prof, which depends on profiling versions of it's dependencies which we didn't build (because of
What ends up happening is that
registerStaticLib parses the path of the library, then needs to the
.conf file for the library, which has already been built, but without profiling variants, so it doesn't built it again but then complains that the
p_a file is not there.
What should happen is that you demand a profiled variant for whatever reason then it builds the profiled version of the library. I don't have much appetite to fix this properly though so I record this information in a ticket.