Skip to content
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

configure.py drops build.ninja in the repository root #4232

Open
learn-more opened this issue Jul 18, 2024 · 5 comments · May be fixed by #4245
Open

configure.py drops build.ninja in the repository root #4232

learn-more opened this issue Jul 18, 2024 · 5 comments · May be fixed by #4245

Comments

@learn-more
Copy link

learn-more commented Jul 18, 2024

Reproduction steps (Win10, VS2022, Python 3.12):

  • Open x64 Native Tools Command Prompt for VS 2022
  • Navigate to the folder where botan is cloned (git describe results in 1.11.30-9833-gb8af12b5c)
  • python3 configure.py --cc=msvc --os=windows --build-tool=ninja --prefix=build/install --disable-shared-library

The build.ninja is placed in the repository root instead of in the build folder

This results in some build artifacts also being dropped in the repository root (when building):

dir /B
.clang-format
.github
.gitignore
.ninja_deps
.ninja_log
botan-3.lib
botan-cli.exe
botan-test.exe
build
build.ninja
configure.py
doc
license.txt
news.rst
readme.rst
src
@randombit randombit added the bug label Jul 18, 2024
@reneme
Copy link
Collaborator

reneme commented Jul 19, 2024

That's just how it has always been. You can run ./configure.py from another location (much like you would typically do with cmake), to build out-of-source:

mkdir my_build
cd my_build
../configure.py --build-tool=ninja
ninja

Another option is $(pwd)/configure.py --with-build-dir=<...>, but that seems to not work properly, if configure.py isn't called with an absolute path (i.e. the $(pwd)). I'll look into that next week.

@learn-more
Copy link
Author

That's just how it has always been. You can run ./configure.py from another location (much like you would typically do with cmake), to build out-of-source:

mkdir my_build
cd my_build
../configure.py --build-tool=ninja
ninja

Another option is $(pwd)/configure.py --with-build-dir=<...>, but that seems to not work properly, if configure.py isn't called with an absolute path (i.e. the $(pwd)). I'll look into that next week.

That is quite surprising behavior, because when you specify an output dir for cmake (cmake -B build) it will put all files there, not just 'most' files.

@reneme reneme linked a pull request Jul 22, 2024 that will close this issue
@reneme
Copy link
Collaborator

reneme commented Jul 22, 2024

With #4245 ./configure.py --with-build-dir= (which is the equivalent of cmake -B) should work as expected now. It should not drop any generated files into the repository root, when running .

If you invoke configure.py from a different directory (as stated above), the build won't drop anything into the repo root either. And this has been the case for a while now. As mentioned, calling the configure script from some other (empty) directory, should be a viable workaround for the broken --with-build-dir= up to and including Botan 3.5.0.

@learn-more
Copy link
Author

With #4245 ./configure.py --with-build-dir= (which is the equivalent of cmake -B) should work as expected now. It should not drop any generated files into the repository root, when running .

If you invoke configure.py from a different directory (as stated above), the build won't drop anything into the repo root either. And this has been the case for a while now. As mentioned, calling the configure script from some other (empty) directory, should be a viable workaround for the broken --with-build-dir= up to and including Botan 3.5.0.

I can confirm that this does work for my case.

mkdir botan\build
pushd botan\build
python3 ../configure.py --cc=msvc --os=windows --build-tool=ninja --disable-shared-library --prefix=install
ninja install
popd

It does create a build/build folder, but other than that, the install is inside the build folder as expected so for now this works for me, thanks!

image

@reneme
Copy link
Collaborator

reneme commented Jul 24, 2024

It does create a build/build folder, but other than that, the install is inside the build folder as expected so for now this works for me, thanks!

Yeah, the build/build folder is expected. That's just how our build system works. It uses this as hard-coded scratch space inside the custom build location you define.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants