Skip to content

Commit

Permalink
Merge bitcoin#31742: contrib: fix BUILDDIR in gen-bitcoin-conf script…
Browse files Browse the repository at this point in the history
… and gen-manpages.py

63a8791 contrib: fix BUILDDIR in gen-bitcoin-conf script and gen-manpages.py (jurraca)

Pull request description:

  The `gen-bitcoin-conf.sh` and `gen-manpages.py` scripts assume a top level `src/` build dir, but in-tree builds are no longer allowed, nor recommended in the build steps. If a user builds `bitcoind` as recommended, these scripts fail. To fix it, we update the `BUILDDIR` env var and update the README accordingly.
  Follows up on initial work and discussion in bitcoin#31332 .

ACKs for top commit:
  fjahr:
    Code review ACK 63a8791
  achow101:
    ACK 63a8791

Tree-SHA512: cf4d5b0d2e8b1f5db759bec01e131d8a0c511a2fd183389d2a0488d5fe4a906db2579d944f408b5c966f619edc6b2534023c3521f1fa5f8edd0216d29f3e48db
  • Loading branch information
achow101 committed Feb 20, 2025
2 parents 77bf990 + 63a8791 commit 9d7672b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions contrib/devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ gen-manpages.py
A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option.
This requires help2man which can be found at: https://www.gnu.org/software/help2man/

With in-tree builds this tool can be run from any directory within the
repository. To use this tool with out-of-tree builds set `BUILDDIR`. For
example:
This script assumes a build directory named `build` as suggested by example build documentation.
To use it with a different build directory, set `BUILDDIR`.
For example:

```bash
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.py
BUILDDIR=$PWD/my-build-dir contrib/devtools/gen-manpages.py
```

headerssync-params.py
Expand All @@ -127,12 +127,12 @@ Generates a bitcoin.conf file in `share/examples/` by parsing the output from `b
release process to include a bitcoin.conf with the release binaries and can also be run by users to generate a file locally.
When generating a file as part of the release process, make sure to commit the changes after running the script.

With in-tree builds this tool can be run from any directory within the
repository. To use this tool with out-of-tree builds set `BUILDDIR`. For
example:
This script assumes a build directory named `build` as suggested by example build documentation.
To use it with a different build directory, set `BUILDDIR`.
For example:

```bash
BUILDDIR=$PWD/build contrib/devtools/gen-bitcoin-conf.sh
BUILDDIR=$PWD/my-build-dir contrib/devtools/gen-bitcoin-conf.sh
```

security-check.py
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/gen-bitcoin-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export LC_ALL=C
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
BUILDDIR=${BUILDDIR:-$TOPDIR}
BUILDDIR=${BUILDDIR:-$TOPDIR/build}
BINDIR=${BINDIR:-$BUILDDIR/src}
BITCOIND=${BITCOIND:-$BINDIR/bitcoind}
SHARE_EXAMPLES_DIR=${SHARE_EXAMPLES_DIR:-$TOPDIR/share/examples}
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/gen-manpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
topdir = r.stdout.rstrip()

# Get input and output directories.
builddir = os.getenv('BUILDDIR', topdir)
builddir = os.getenv('BUILDDIR', os.path.join(topdir, 'build'))
mandir = os.getenv('MANDIR', os.path.join(topdir, 'doc/man'))

# Verify that all the required binaries are usable, and extract copyright
Expand Down

0 comments on commit 9d7672b

Please sign in to comment.