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

FIX: ./configure.py --with-build-dir= #4245

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Jul 22, 2024

Pull Request Dependencies

  • Use @response_files.txt for linking in Ninja #4350 | This produces many absolute paths to object and source files in the commands, potentially exhausting Windows' limit on command line argument byte length. Using Ninja (and its excellent support for @response_files.txt) this can be worked around.

Description

Running ./configure.py --with-build-dir=mybuild didn't work properly, because it produced a Makefile/ninja.build with paths relative to the base-directory of the configure.py invocation (i.e. argv[0]). It did work when invoking it like that: $(pwd)/configure.py --with-build-dir=mybuild.

The idea behind this patch is to always produce absolute paths in the Makefile/ninja.build. As a side effect, this allows us to remove a mingw workaround. Also, I cleaned up the ninja.build of botan_bogo_shim and botan_ct_selftest that both dropped their intermediate object files in the top-level build directory.

Closes #4232
Closes #4342

@reneme reneme added this to the Botan 3.6.0 milestone Jul 22, 2024
@reneme reneme requested a review from randombit July 22, 2024 15:43
@reneme reneme self-assigned this Jul 22, 2024
Comment on lines -3558 to +3557
source_paths = SourcePaths(os.path.dirname(argv[0]))
source_paths = SourcePaths(os.path.dirname(os.path.realpath(__file__)))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused the explained issue. argv[0] may be a valid relative path (seen from $($pwd)), but it is not valid when --with-build-dir= drops the generated build files somewhere else and paths in there are relative to whatever argv[0] was.

@coveralls
Copy link

coveralls commented Jul 22, 2024

Coverage Status

coverage: 91.003% (+0.001%) from 91.002%
when pulling 0fc18fc on Rohde-Schwarz:fix/configure_paths
into 7624371 on randombit:master.

@reneme
Copy link
Collaborator Author

reneme commented Sep 10, 2024

Rebased to master (to resolve a conflict with #4336).

@reneme
Copy link
Collaborator Author

reneme commented Sep 10, 2024

Turns out that listing all the object files with their absolute path can overwhelm Windows' upper limit on command lengths. I'll have a look into that as soon as I can.

reneme added 3 commits October 7, 2024 13:33
This allows using the cmake-ish flow of `mkdir build && cd build && ../configure.py`
resulting in all build artefacts being dropped in build or build/build respectively.
@reneme reneme force-pushed the fix/configure_paths branch from 471925b to 0fc18fc Compare October 7, 2024 11:37
@reneme
Copy link
Collaborator Author

reneme commented Oct 7, 2024

Rebased after #4350 was merged.

@randombit randombit modified the milestones: Botan 3.6.0, Botan 3.7.0 Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--with-build-dir= don't find src files configure.py drops build.ninja in the repository root
3 participants