-
Notifications
You must be signed in to change notification settings - Fork 570
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
--with-build-dir= don't find src files #4342
Comments
I added two lines into config file and now I can compile, but install fail because it doesn't find the script: at line 1935 after for (obj_file, src) in zip(objects, sources): and at line 2122 before variables definition: now I'm investigating how to fix the install script location |
Perhaps this open pull request is helpful: #4245 |
I tried it, instead of configure.py it takes all path, but fail to exec the script entirely on windows |
Could you be a bit more specific, please? I'm assuming you applied the patch in #4245. Then, it works for you on Linux but the script's execution fails on Windows entirely? |
I cloned again the repo because I saw a new update and now with that patch it compile without my edits but then fail the ninja install:
because takes all obj with the full path... |
On windows I fixed with brute edit at line 299 on def src_info(self, typ) update, maybe I can remove the prefix from it, but I must do it in that function and not before so the script create the right path for the make and ninja |
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, |
As a side note: there might be a workaround that lets you build out-of-source without the patch in #4245 for the time being: Like so: git clone https://github.com/randombit/botan my_botan_checkout
mkdir my_botan_build_dir
cd my_botan_build_dir
../my_botan_checkout/configure.py --build-tool=ninja
ninja ... regardless, we'll have to look into the issue with the "too long command line". |
I'll try for sure, on linux my edit doesn't work because make don't find anymore the obj |
Yes, I confirm that also command libs doesn't work. the solution I found on windows it's remove the path and it works, but that edit then doesn't work on linux |
on linux only with the patch #4245 works fine, even tho the command is huge too, but maybe I got an idea to test out |
Thanks!
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. |
I don't know if you will like this solution with the edit at line 299, but with patch #4245 it works both on linux and windows: def src_info(self, typ):
buildlen = len(self.build_dir) - 5 # keep build/
if typ == 'lib':
libobj_dir = self.libobj_dir
if libobj_dir.startswith(self.build_dir):
libobj_dir = libobj_dir[buildlen:]
return (self.lib_sources, libobj_dir)
if typ == 'cli':
cliobj_dir = self.cliobj_dir
if cliobj_dir.startswith(self.build_dir):
cliobj_dir = cliobj_dir[buildlen:]
return (self.cli_sources, self.cliobj_dir)
if typ == 'test':
testobj_dir = self.testobj_dir
if testobj_dir.startswith(self.build_dir):
testobj_dir = testobj_dir[buildlen:]
return (self.test_sources, self.testobj_dir)
if typ == 'fuzzer':
fuzzobj_dir = self.fuzzobj_dir
if fuzzobj_dir:
if fuzzobj_dir.startswith(self.build_dir):
fuzzobj_dir = fuzzobj_dir[buildlen:]
return (self.fuzzer_sources, self.fuzzobj_dir)
if typ == 'examples':
example_obj_dir = self.example_obj_dir
if example_obj_dir:
if example_obj_dir.startswith(self.build_dir):
example_obj_dir = example_obj_dir[buildlen:]
return (self.example_sources, self.example_obj_dir)
raise InternalError("Unknown src info type '%s'" % (typ)) |
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.) |
I fixed for my needs, I hope could help to fix out for the ninja "problems" |
I tested the edit I did also with the default build dir "build" and because I keep the folder also with longer build path string, I can compile on both linux and windows without problems |
@M4iKZ In #4350 I introduced support for "response files" in our Ninja builds. |
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?
The text was updated successfully, but these errors were encountered: