botan: --with-build-dir= don't find src files

Hello, I’m trying to move the build folder in another path, but makefile (linux) or ninja (windows) doesn’t find the src files:

for example from my makefile: /mnt/m/botan/build/linux/build/obj/lib/base_buf_comp.o: src/lib/base/buf_comp.cpp $(CXX) $(LIB_FLAGS) $(BUILD_FLAGS) -DBOTAN_IS_BEING_BUILT -I

the error I get on make (same on ninja): make: *** No rule to make target 'src/lib/base/buf_comp.cpp', needed by '/mnt/m/botan/build/linux/build/obj/lib/base_buf_comp.o'.

this is my command for linux, on windows it’s the same with platform and folder specifics: python3 configure.py --disable-deprecated-features --no-install-python-module --disable-shared-library --optimize-for-size --prefix=/mnt/m/botan-linux/release --build-targets=static --without-documentation --with-build-dir=/mnt/m/botan/build/linux --minimized-build

should I add something?

About this issue

Most upvoted comments

I fixed for my needs, I hope could help to fix out for the ninja “problems”

Thanks for sharing your patch. I’ll look into it before the Botan 3.6.0 release. (I’m assuming you’re unblocked for now and this isn’t super time critical at this point.)

Yes, I confirm that also command libs doesn’t work.

Thanks!

on linux only with the patch #4245 works fine, even tho the command is huge to

My best guess is that Windows has an upper limit on its command length and Linux doesn’t. Or at least, Linux’ limit is much bigger 😞 I’ll look into a way to fix this.

but then fail the ninja install: […] because takes all obj with the full path…

Oh no. I’m guessing the actual “install” isn’t what is actually failing here, right? But rather the link command for the static and/or shared library. Hence, ninja libs probably fails as well, correct?

Yes, I confirm that also command libs doesn’t work. It’s because obj keep the full path in the command, creating a very long command that ninja doesn’t like at all.

the solution I found on windows it’s remove the path and it works, but that edit then doesn’t work on linux