Commit Graph
207 Commits
Author SHA1 Message Date
ziggie 61d82fd1f2 build: update CI+release version to Go 1.25.5
This updates the toolchain which we require to build the LND
executable.
2026-01-13 16:07:38 +01:00
Olaoluwa Osuntokun a21d436fb2 make: use Docker named volumes for ~21x faster local linting
This commit optimizes Docker cache mounting for the linter with a
CI-aware strategy:

**Local development (macOS/Windows)**: Uses Docker named volumes which
keep data inside Docker's native Linux filesystem, avoiding the slow
host-syncing overhead of bind mounts. This yields ~21x faster linting
on warm cache.

**CI (GitHub Actions)**: Uses bind mounts to host paths (`~/.cache/go-build`,
`~/go/pkg/mod`) that GitHub Actions already caches via the setup-go
action. This ensures CI benefits from cached dependencies across runs.

The Makefile detects CI mode via the `CI` environment variable that
GitHub Actions sets automatically.

Local benchmark results:
- Cold run (empty cache): ~2m 28s
- Warm run (cached): ~11s (~21x faster)

Key improvements in warm runs:
- Go packages loading: 1m 58s → 5.6s
- Linters execution: 20.5s → 2.7s
- Total execution: 2m 20s → 8.6s
2025-12-09 17:44:47 -08:00
ziggie 6cc7a88e99 makefile: add linter config check 2025-11-12 22:54:02 +08:00
ziggie b6dd3a32f7 CI: also use go tool for gosimports 2025-11-12 22:54:02 +08:00
Boris Nagaev 4fc8d8dda3 build: update CI+release version to Go 1.25.3
We also update the go.mod files to pin to Go 1.24.9.
2025-10-21 14:32:44 -03:00
Olaoluwa Osuntokun 7fcbbd44ca build: update CI+release version to Go 1.25.2
We also update the go.mod files to pin to Go 1.24.8.
2025-10-11 13:39:51 +01:00
Boris Nagaev 6ffe257004 multi: bump Go to 1.24.6 2025-08-30 14:13:44 -03:00
ziggie 87844cd5b4 multi: bump Golang version to v1.23.12 2025-08-07 16:53:45 +02:00
Oliver Gugger f96ad47d28 make: add flakehunter-unit-all and flakehunter-unit-race
These two new goals take all the usual flags like pkg=, case=, nocache= and so
on.
2025-07-21 13:48:42 +02:00
Boris Nagaev 643fbb8af6 multi: update Go to 1.23.10 2025-07-16 01:19:58 -03:00
ziggie c65cf7ffd1 makefile: fix linewrap for make help cmd 2025-05-26 08:45:21 +02:00
ziggie c624e4348d makefile: add lean cross-compile build
Different platforms can now be cross-compiled wihtout packing
all the source and vendor packages.
2025-05-26 08:37:10 +02:00
Olaoluwa Osuntokun 1c76c6198c build: bump Go version to v1.23.9 2025-05-06 15:50:16 -07:00
Oliver Gugger 124137e31a GitHub+make: debug failing test, use official coveralls action 2025-02-28 14:55:34 +01:00
Oliver Gugger 576da75a07 multi: remove unneeded env variables
With Go 1.23 we don't need to set any of these variables anymore, as
they're the default values now.
2025-02-28 14:55:34 +01:00
Oliver Gugger 70ac201cb8 make+tools: remove goacc, use Go 1.20 builtin functionality
Starting with Go 1.20 the -coverprofile flag does the same that GOACC
did before.
2025-02-28 14:55:33 +01:00
Elle Mouton 343bdff26b make+gh: add make helper and GH action
Add a makefile helper to run the neww backwards compatability test and
then add a new GH actions job to call it.
2025-02-27 11:33:15 +02:00
yyforyongyu fa8527af09 Makefile+scripts: add unit test flake hunter
This commit adds a script to hunt flakes for a specific unit test with
trace logs. Also rename the make commands to make them more clear on
whether it's a unit test, itest, or paralleled itest.
2025-02-25 21:10:40 +08:00
Oliver Gugger ad021a290d Makefile: add GOCC variable 2025-02-23 09:48:54 +01:00
Olaoluwa Osuntokun 61852fbe95 multi: update build system to Go 1.23 2025-02-13 16:57:06 -08:00
Oliver Gugger 191c838ad1 multi: bump Go version to v1.22.11 2025-01-30 16:13:26 +01:00
yyforyongyu 88bd0cb806 itest: shuffle test cases to even out blocks mined in tranches
This commit adds a new flag to shuffle all the test cases before running
them so tests which require lots of blocks to be mined are less likely
to be run in the same tranch.

The other benefit is this approach provides a more efficient way to
figure which tests are broken since all the differnet backends are
running different tranches in their builds, we can identify more failed
tests in one push.
2024-12-20 19:38:05 +08:00
Alex Akselrod c5d0976375 Makefile: log to file instead of console 2024-12-12 10:40:39 -08:00
Alex Akselrod 68e9aea40d Makefile: tune params for db-instance for postgres itests 2024-12-12 10:40:38 -08:00
Elle Mouton 88f5369066 tools+.: add custom linter configuration file
Add this file both to the main LND directory so that devs can use it for
local linter runs and also add it to the `tools` directory so that the
docker environment used to run the linter in CI has access to it. A
custom linter binary can be built via `golangci-lint custom`. This will
pull in and register all the plugins listed in the new config file when
building the new binary. The new binary can then be run using
`custom-gcl run`.
2024-12-02 09:14:21 +02:00
ffranr 7919b3f204 makefile+scripts: add Go version check to release command
This commit updates `scripts/release.sh` to include a check for the
correct Go version before executing the release build. This ensures that
the release binaries are built with the specified Go version,
maintaining consistency and integrity for developer signatures.
2024-10-23 13:34:35 +02:00
yyforyongyu db332db025 Makefile: add -test.v for make itest 2024-09-10 17:21:03 +08:00
Olaoluwa Osuntokun 19b5a1fb05 build: set min build version to Go 1.22.6
Go 1.23 was released this week, so with this PR we update the build
system to officially support the last two releases.
2024-08-20 19:13:23 +02:00
ffranr 2a6e54016f Makefile: add lint check for Go version in Dockerfile and YAML
Implemented linter scripts to ensure consistency of the Go version
specified in Dockerfiles and YAML files. These scripts verify that the
Go version used across these files is uniform, enhancing maintainability
and reducing configuration errors.

This commit also introduces a `GO_VERSION` Makefile variable to control
the Go version used throughout the project.
2024-08-01 14:09:58 +01:00
ffranr 077e6682fa Makefile: rename variable to ACTIVE_GO_VERSION
Renamed the Makefile variable `GO_VERSION` to `ACTIVE_GO_VERSION` for
improved clarity. This change also frees up the name `GO_VERSION` to be
used for defining the global Go version for reproducible binaries in a
subsequent commit.
2024-07-31 16:53:47 +01:00
Elle Mouton c577dae372 makefile+dev.Dockerfile: add install-all command
Add a new `make install-all` command that will perform all `make
install` actions along with generating the manpages. The `manpages`
command is then removed from the existing `make install` command. The
docker build is then updated to use the new `make install-all` command.
This is done because some users running `make install` may be doing so
in environments where they do not have write access to the directory
where the man pages need to be written to.
2024-05-08 09:30:46 +02:00
Oliver Gugger c68778d2f3 Merge pull request #7364 from guggero/itest-coverage
Add test coverage for integration tests
2024-05-07 21:05:35 +02:00
bitromortac ba34f220b9 make: add cache directory for linter
Mounts a local temporary folder to the linter docker container in order
to persist the linter cache across runs.
2024-04-26 13:47:50 +02:00
Oliver Gugger 8a5160e1de multi: add test coverage for integration tests 2024-04-23 19:15:33 +02:00
Mohamed Awnallah 158b802f49 lncli+makefile: generate man pages automatically for lncli and lnd 2024-03-13 21:18:23 +02:00
Oliver Gugger 834371c995 make: use Golang build and module cache for linter
This commit gives the linter container access to the local machine's
build and module cache, drastically decreasing the run time of
subsequent linter runs (no difference on first run with this change).
2024-03-06 13:38:51 +01:00
Mohamed Awnallah 1402ffd17b protolint: configure protolint and fix the protolinting issues
This PR addresses the following:
- Install and Configure protolint to enforce the protobuf style guide rules in the CI.
- Fix the protolinting issues (package and import ordering) while maintaining the comaptibility.
2024-01-22 22:00:00 +02:00
Oliver Gugger f35a3718ec Makefile: add make help command that describes goals
This commit adds a description to each make goal that is printed when
`make help` is run.
Idea borrowed from btcsuite/btcd#2107.
2024-01-22 10:31:48 +02:00
Olaoluwa Osuntokun 63a94ad987 build: build+install using GOEXPERIMENT=loopvar
We also update the release script to do the same as well.
2023-10-24 18:40:58 -07:00
Olaoluwa Osuntokun b1eaeb6ac6 build: prep for Go 1.22 by using GOEXPERIMENT=loopvar for tests
In this commit, [we prep for some upcoming changes in
Go](https://go.dev/blog/loopvar-preview) by running our tests with
`GOEXPERIMENT=loopvar`. This changes the loop semantics to fix a common
bug where a scoping issue causes a variable to be re-used, which can
cause unintended bugs down the line.

If everything passes with this flag on, then we can keep it on, and also
rest a bit easier knowing that the compiler will fix a class of bugs
that would previously pop up for us.
2023-10-24 18:40:49 -07:00
yyforyongyu ba007d9373 itest: fix itest logs upload
When one of the itest tranches fails, because we are running tests in
parallel, other tranches will still be running, which caused 7z to fail
at zipping the logs because race reads. This commit fixes it by making
sure we are waiting other tranches to finish before moving to zipping
and uploading the logs.
2023-10-06 16:34:47 -07:00
yyforyongyu c568ba9fa2 github+Makefile: add new action make tidy-module-check
This commit adds `tidy-module` and `tidy-module-check` to make sure the
modules are always tidy.
2023-09-06 02:48:13 +08:00
yyforyongyu 5296509474 Makefile+action: add make unit-module to test submodules
This commit adds a new command `make unit-module` to run unit tests for
submodules to avoid future build errors.
2023-09-06 02:47:55 +08:00
feelancer21 cbd8f0a819 Makefile: Calling the script check-sample-lnd-conf.sh
The existing sample-conf-check is replaced by a call of the
check-sample-lnd-conf.sh.
2023-08-03 18:04:25 +02:00
positiveblue 43a9e2f1ca multi: add sqlc support
sqlc is a tool that generates fully type-safe idiomatic code from SQL.
The result is Go code can then used execute the queries in the database.

The noraml flow looks like:
- The developer write some sql that will update the schema in the
  database: new tables, indices, etc
- The developer updates the set of queries that will use the new schema.
- `sqlc` generates type-safe interfaces to those queries.
- The developer can then write application code that calls the methods
  generated by sqlc.

The tool configuration needs to live in the repo's root and its name is
`sqlc.yaml`.

LND will support out of the box sqlite and postgres. The sql code needs to
be (almost) the same for both engines, so we cannot use custom functions
like `ANY` in postgres.

The SQLC config file needs to define what is the target engine, we will
set postgres but the generated code can be executed by sqlite too.

In some specific cases, we will `match and replace` some sql lines to be
sure the table definitions are valid for the targeted engine.
2023-07-10 17:36:58 -07:00
ziggie 469dfd5f42 make: add benchmark tests
Add benchmark tests as a separate test run besides the current
unit tests.
2023-05-09 16:47:47 +02:00
Matt Morehouse 526075be57 make: clean up container after linting
Currently `make lint` creates a new container each time it runs. We can
automatically delete these containers once linting is done by using the
--rm flag.
2023-04-18 15:20:14 -05:00
djkazic bb5faf0f5a make+docs: pull in modules patch 2023-03-31 10:15:21 -04:00
djkazic 2f994ceeae mobile+mod+make: fix Makefile ldflags for mac and mobile 2023-03-31 09:54:35 -04:00
yyforyongyu 941a33af31 Makefile: add testing_flags to coverage test 2023-03-16 04:23:07 +08:00