Skip to content

Commit

Permalink
build: remove all trace of DEVELOPER.
Browse files Browse the repository at this point in the history
If you previously configured with `--enable-developer` we turn that into `--enable-debugbuild`.

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Removed: build: `--enable-developer` arg to configure (and DEVELOPER variables): use `./configure --enable-debugbuild` and `developer` setting at runtime.
  • Loading branch information
rustyrussell committed Jul 9, 2023
1 parent 8ef3a48 commit bd25861
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
git config --global --add safe.directory `pwd`
git submodule update --init --recursive
./configure CC="$CC" --enable-developer --disable-valgrind
./configure CC="$CC" --disable-valgrind
cat config.vars
Expand Down
54 changes: 17 additions & 37 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,14 @@ jobs:
fail-fast: true
matrix:
include:
- CFG: gcc-dev1
DEVELOPER: 1
VALGRIND: 1
COMPILER: gcc
- CFG: gcc-dev0
DEVELOPER: 0
- CFG: compile-gcc
VALGRIND: 1
COMPILER: gcc
# While we're at it let's try to compile with clang
- CFG: clang-dev1
DEVELOPER: 1
- CFG: compile-clang
VALGRIND: 1
COMPILER: clang
- CFG: clang-sanitizers
DEVELOPER: 1
- CFG: compile-clang-sanitizers
COMPILER: clang
ASAN: 1
UBSAN: 1
Expand All @@ -106,7 +99,6 @@ jobs:
- name: Build
env:
DEVELOPER: ${{ matrix.DEVELOPER }}
COMPILER: ${{ matrix.COMPILER }}
ASAN: ${{ matrix.ASAN }}
UBSAN: ${{ matrix.UBSAN }}
Expand Down Expand Up @@ -145,7 +137,7 @@ jobs:
fail-fast: true
matrix:
include:
- CFG: gcc-dev1
- CFG: compile-gcc
VALGRIND: 1
- CFG: clang-sanitizers
VALGRIND: 0
Expand Down Expand Up @@ -203,7 +195,7 @@ jobs:
- name: Build
run: |
./configure --enable-debugbuild --enable-fuzzing --enable-developer --disable-valgrind CC=clang
./configure --enable-debugbuild --enable-fuzzing --disable-valgrind CC=clang
make -j $(nproc) check-fuzz
integration:
Expand All @@ -221,47 +213,36 @@ jobs:
fail-fast: true
matrix:
include:
- NAME: gcc-dev1
CFG: gcc-dev1
DEVELOPER: 1
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
- NAME: gcc-dev0
CFG: gcc-dev0
DEVELOPER: 0
- NAME: gcc
CFG: compile-gcc
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
# While we're at it let's try to compile with clang
- NAME: clang-dev1
CFG: clang-dev1
DEVELOPER: 1
- NAME: clang
CFG: compile-clang
TEST_DB_PROVIDER: sqlite3
COMPILER: clang
TEST_NETWORK: regtest
# And of course we want to test postgres too
- NAME: postgres
CFG: gcc-dev1
DEVELOPER: 1
CFG: compile-gcc
COMPILER: gcc
TEST_DB_PROVIDER: postgres
TEST_NETWORK: regtest
# And don't forget about elements (like cdecker did when
# reworking the CI...)
- NAME: liquid
CFG: gcc-dev1
DEVELOPER: 1
CFG: compile-gcc
COMPILER: gcc
TEST_NETWORK: liquid-regtest
TEST_DB_PROVIDER: sqlite3
# And dual funding!
- NAME: dual-fund
CFG: gcc-dev1
CFG: compile-gcc
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
DEVELOPER: 1
EXPERIMENTAL_DUAL_FUND: 1
steps:
- name: Checkout
Expand All @@ -287,7 +268,6 @@ jobs:

- name: Test
env:
DEVELOPER: ${{ matrix.DEVELOPER }}
COMPILER: ${{ matrix.COMPILER }}
EXPERIMENTAL_DUAL_FUND: ${{ matrix.EXPERIMENTAL_DUAL_FUND }}
COMPAT: 1
Expand All @@ -310,7 +290,7 @@ jobs:
BITCOIN_VERSION: "25.0"
ELEMENTS_VERSION: 22.0.2
RUST_PROFILE: release # Has to match the one in the compile step
CFG: gcc-dev1
CFG: compile-gcc
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800
needs:
- compile
Expand Down Expand Up @@ -359,10 +339,10 @@ jobs:
- name: Download build
uses: actions/download-artifact@v3
with:
name: cln-gcc-dev1.tar.bz2
name: cln-compile-gcc.tar.bz2

- name: Unpack build
run: tar -xvjf cln-gcc-dev1.tar.bz2
run: tar -xvjf cln-compile-gcc.tar.bz2

- name: Test
env:
Expand Down Expand Up @@ -432,10 +412,10 @@ jobs:
- name: Download build
uses: actions/download-artifact@v3
with:
name: cln-clang-sanitizers.tar.bz2
name: cln-compile-clang-sanitizers.tar.bz2

- name: Unpack build
run: tar -xvjf cln-clang-sanitizers.tar.bz2
run: tar -xvjf cln-compile-clang-sanitizers.tar.bz2

- name: Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
slow_test: marks tests as slow (deselect with '-m "not slow_test"')
EOF
python3.10 -m poetry run ./configure --enable-developer --disable-valgrind --disable-compat
python3.10 -m poetry run ./configure --disable-valgrind --disable-compat
python3.10 -m poetry run make
1 change: 0 additions & 1 deletion .github/workflows/prototest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
-e NETWORK=${{ matrix.network }} \
-e TARGET_HOST=${{ matrix.TARGET_HOST }} \
-e VALGRIND=${{ matrix.valgrind }} \
-e DEVELOPER=1 \
-e PYTEST_PAR=2 \
-e PYTEST_OPTS="--timeout=300" \
-e TEST_CMD="make check-protos" \
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ COPY . /tmp/lightning
RUN git clone --recursive /tmp/lightning . && \
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)

ARG DEVELOPER=1
ENV PYTHON_VERSION=3
RUN curl -sSL https://install.python-poetry.org | python3 - \
&& pip3 install -U pip \
&& pip3 install -U wheel \
&& /root/.local/bin/poetry install

RUN ./configure --prefix=/tmp/lightning_install --enable-static && \
make DEVELOPER=${DEVELOPER} && \
make && \
/root/.local/bin/poetry run make install

FROM debian:bullseye-slim as final
Expand Down
16 changes: 3 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -453,20 +453,16 @@ check-protos: $(ALL_PROGRAMS)
ifeq ($(PYTEST),)
@echo "py.test is required to run the protocol tests, please install using 'pip3 install -r requirements.txt', and rerun 'configure'."; false
else
ifeq ($(DEVELOPER),1)
@(cd external/lnprototest && PYTHONPATH=$(MY_CHECK_PYTHONPATH) LIGHTNING_SRC=../.. $(PYTEST) --runner lnprototest.clightning.Runner $(PYTEST_OPTS))
else
@echo "lnprototest target requires DEVELOPER=1, skipping"
endif
@(cd external/lnprototest && PYTHONPATH=$(MY_CHECK_PYTHONPATH) LIGHTNING_SRC=../.. $(PYTEST) --runner lnprototest.clightning.Runner --runner_args=--developer $(PYTEST_OPTS))
endif

pytest: $(ALL_PROGRAMS) $(DEFAULT_TARGETS) $(ALL_TEST_PROGRAMS) $(ALL_TEST_GEN)
ifeq ($(PYTEST),)
@echo "py.test is required to run the integration tests, please install using 'pip3 install -r requirements.txt', and rerun 'configure'."
exit 1
else
# Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line.
PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS)
# Explicitly hand VALGRIND so you can override on make cmd line.
PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS)
endif

check-fuzz: $(ALL_FUZZ_TARGETS)
Expand Down Expand Up @@ -729,13 +725,7 @@ pyln-release: $(PYLNS:%=pyln-release-%)
pyln-release-%:
cd contrib/pyln-$* && $(MAKE) prod-release

# These must both be enabled for update-mocks
ifeq ($(DEVELOPER),1)
update-mocks: $(ALL_TEST_PROGRAMS:%=update-mocks/%.c)
else
update-mocks:
@echo Need DEVELOPER=1 to regenerate mocks >&2; exit 1
endif

$(ALL_TEST_PROGRAMS:%=update-mocks/%.c): $(ALL_GEN_HEADERS) $(EXTERNAL_LIBS) libccan.a ccan/ccan/cdump/tools/cdump-enumstr config.vars

Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ of the `startup_regtest.sh` file for details on how to use it.
. contrib/startup_regtest.sh
```

Note that your local nodeset will be much faster/more responsive if
you've configured your node to expose the developer options, e.g.

```bash
./configure --enable-developer
```

#### Mainnet Option
To test with real bitcoin, you will need to have a local `bitcoind` node running:

Expand Down Expand Up @@ -222,7 +215,7 @@ If you encrypt your `hsm_secret`, you will have to pass the `--encrypted-hsm` st
### Developers

Developers wishing to contribute should start with the developer guide [here](doc/HACKING.md).
You should also configure with `--enable-developer` to get additional checks and options.
You should also enable developer mode by running with `--developer` to get additional checks and options.

[blockstream-store-blog]: https://blockstream.com/2018/01/16/en-lightning-charge/
[std]: https://github.com/lightning/bolts
Expand Down
11 changes: 0 additions & 11 deletions common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,6 @@ STRUCTEQ_DEF(ripemd160, 0, u);
* complained on, so we can re-test as gcc evolves. */
#define COMPILER_WANTS_INIT(compiler_versions) = 0

/* For case where we want one thing if DEVELOPER, another if not, particularly
* for function parameters.
*
* Usefully, you can refer to DEVELOPER-only fields here. */
#if DEVELOPER
/* Make sure that nondev is evaluated, and valid */
#define IFDEV(dev, nondev) ((void)(nondev), (dev))
#else
#define IFDEV(dev, nondev) (nondev)
#endif

/* Context which all wally allocations use (see common/setup.c) */
extern const tal_t *wally_tal_ctx;

Expand Down
8 changes: 0 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,7 @@ set_defaults()
PREFIX=${PREFIX:-/usr/local}
CC=${CC:-cc}
CDEBUGFLAGS=${CDEBUGFLAGS--std=gnu11 -g -fstack-protector-strong}
DEVELOPER=${DEVELOPER:-0}
DEBUGBUILD=${DEBUGBUILD:-0}
# --enable-developer forces debug build
[ "$DEVELOPER" = 0 ] || DEBUGBUILD=1
COMPAT=${COMPAT:-1}
STATIC=${STATIC:-0}
CLANG_COVERAGE=${CLANG_COVERAGE:-0}
Expand Down Expand Up @@ -199,8 +196,6 @@ usage()
echo "Options include:"
usage_with_default "--prefix=" "$PREFIX"
echo " Prefix for make install"
usage_with_default "--enable/disable-developer" "$DEVELOPER" "enable" "disable"
echo " Developer mode, good for testing"
usage_with_default "--enable/disable-debug" "$DEBUGBUILD" "enable" "disable"
echo " Extra debug checks in the build, good for testing"
usage_with_default "--enable/disable-compat" "$COMPAT" "enable" "disable"
Expand Down Expand Up @@ -264,8 +259,6 @@ for opt in "$@"; do
COPTFLAGS=*) COPTFLAGS="${opt#COPTFLAGS=}";;
PYTEST=*) PYTEST="${opt#PYTEST=}";;
--prefix=*) PREFIX="${opt#--prefix=}";;
--enable-developer) DEVELOPER=1;;
--disable-developer) DEVELOPER=0;;
--enable-debugbuild) DEBUGBUILD=1;;
--disable-debugbuild) DEBUGBUILD=0;;
--enable-compat) COMPAT=1;;
Expand Down Expand Up @@ -500,7 +493,6 @@ add_var SQLITE3_LDLIBS "$SQLITE3_LDLIBS"
add_var POSTGRES_INCLUDE "$POSTGRES_INCLUDE"
add_var POSTGRES_LDLIBS "$POSTGRES_LDLIBS"
add_var VALGRIND "$VALGRIND"
add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER.$$
add_var DEBUGBUILD "$DEBUGBUILD"
add_var COMPAT "$COMPAT" $CONFIG_HEADER.$$
add_var PYTEST "$PYTEST"
Expand Down
3 changes: 1 addition & 2 deletions contrib/docker/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ COPY . /tmp/lightning
RUN git clone --recursive /tmp/lightning . && \
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)

ARG DEVELOPER=0
ENV PYTHON_VERSION=3

RUN curl -sSL https://install.python-poetry.org | python3 - \
Expand All @@ -116,7 +115,7 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \
&& /root/.local/bin/poetry install

RUN ./configure --prefix=/tmp/lightning_install --enable-static && \
make DEVELOPER=${DEVELOPER} && \
make && \
/root/.local/bin/poetry run make install

FROM arm32v7/debian:bullseye-slim as final
Expand Down
3 changes: 1 addition & 2 deletions contrib/docker/linuxarm64v8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ COPY . /tmp/lightning
RUN git clone --recursive /tmp/lightning . && \
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)

ARG DEVELOPER=0
ENV PYTHON_VERSION=3

RUN curl -sSL https://install.python-poetry.org | python3 - \
Expand All @@ -117,7 +116,7 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \
&& /root/.local/bin/poetry install

RUN ./configure --prefix=/tmp/lightning_install --enable-static && \
make DEVELOPER=${DEVELOPER} && \
make && \
/root/.local/bin/poetry run make install

FROM arm64v8/debian:bullseye-slim as final
Expand Down
1 change: 0 additions & 1 deletion contrib/docker/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export BOLTDIR=bolts
export CC=${COMPILER:-gcc}
export COMPAT=${COMPAT:-1}
export TEST_CHECK_DBSTMTS=${TEST_CHECK_DBSTMTS:-0}
export DEVELOPER=${DEVELOPER:-1}
export PATH=$CWD/dependencies/bin:"$HOME"/.local/bin:"$PATH"
export PYTEST_OPTS="--maxfail=5 --suppress-no-test-exit-code ${PYTEST_OPTS}"
export PYTEST_PAR=${PYTEST_PAR:-10}
Expand Down
6 changes: 3 additions & 3 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ lightning-cli dev-forget-channel $NODEID

This will perform additional checks on whether it is safe to forget
the channel, and only then removes the channel from the DB. Notice
that this command is only available if CLN was compiled with
`DEVELOPER=1`.
that this command is only available if CLN was run with
`--developer`.

### My channel is stuck in state `CHANNELD_AWAITING_LOCKIN`

Expand Down Expand Up @@ -245,7 +245,7 @@ There are 3 types of 'rescans' you can make:
(You can specify an exact block to start scanning from, instead of depth from current height,
by using a negative number.)
- `dev-rescan-outputs`: A `lightningd` RPC call. Only available if your node has been
configured and built in DEVELOPER mode (i.e. `./configure --enable-developer`) This
started in developer mode (i.e. `--developer`) This
will sync the state for known UTXOs in the `lightningd` wallet with `bitcoind`.
As it only operates on outputs already seen on chain by the `lightningd` internal
wallet, this will not find missing wallet funds.
Expand Down
2 changes: 1 addition & 1 deletion doc/FUZZING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ a few sanitizers for bug detections as well as experimental features for an exte
coverage (not required though).

```
./configure --enable-developer --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind CC=clang && make
./configure --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind CC=clang && make
```

The targets will be built in `tests/fuzz/` as `fuzz-` binaries, with their best
Expand Down
Loading

0 comments on commit bd25861

Please sign in to comment.