Commit Graph

180 Commits

Author SHA1 Message Date
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
yyforyongyu
edba938996
multi: add new build tag integration
This commit adds a new build tag `integration` and removes the old tag
`rpctest` for clarity. Multiple unnecessary usages of `build !rpctest`
is also removed.
2023-02-23 21:56:09 +08:00
yyforyongyu
0bc86a3b4b
multi: move itest out of lntest
This commit moves all the test cases living in `itest` out of `lntest`,
further making `lntest` an independent package for general testing.
2023-02-23 21:56:08 +08:00
Matt Morehouse
beb4d8c4df
build: remove go-fuzz dependency and references
We don't need go-fuzz now that we use native fuzzing.
2022-11-11 10:44:37 -06:00
Conner
25a7bb8b86
make+scripts+docs: update fuzzing script and make fuzz 2022-11-11 10:30:05 -06:00
positiveblue
85d88cd004
[skip ci] build: fix makefile targets using RELEASE_LDFLAGS
I forgot the `-ldflags` before setting the ldflags for the `install`
target.
2022-10-18 02:06:15 -07:00
positiveblue
5924964a9b
build: get binary build info from debug/buildinfo
Since `go1.18` the runtime has a package that provides information about module
versions, version control information, and build flags embedded in executable
files built by the go command.

The new packages allows us to get information needed by the `version` command
without having to rely on `ldflags` set at build time.

This can be really helpful while debugging errors from people using custom
binaries. For example a build from master.
2022-10-17 00:52:37 -07:00
yyforyongyu
859c5e5da4
Makefile+github: add make fmt-check to check for formatting 2022-08-23 22:10:27 +08:00
Evan Kaloudis
3e51a7a6fe
Makefile: Mobile builds: expose main sub-servers + set SUBSERVER_PREFIX flag by default 2022-05-11 13:18:17 -04:00
ErikEk
635cffa871 multi: add sub-server dep 2022-04-30 08:55:49 +02:00
Hampus Sjöberg
1786fdf4d4 mobile: Add iossimulator gomobile target to ios Makefile task 2022-03-31 12:10:13 +04:00
Hampus Sjöberg
a97b194574 mobile: Add apple Makefile task for compiling xcframework for all Apple platforms 2022-03-27 02:33:59 +04:00
Hampus Sjöberg
f015d885e4 mobile: Add macos Makefile task for compiling xcframework for macOS 2022-03-27 02:00:28 +04:00
Hampus Sjöberg
b19f5b9743 Fix error in log message in Makefile ios task 2022-03-27 02:00:28 +04:00
Oliver Gugger
09406f613a
make+tools: dockerize linting 2022-02-10 16:03:00 +01:00
naveen
192cee494f
mod+tools+Makefile:separate tools different module
Separated the tools to different go module to avoid having tools
dependencies on the main module.
2022-02-10 11:02:01 +01:00
Oliver Gugger
d1b512ff92
mod+make: replace goimports with gosimports 2022-02-10 11:02:00 +01:00
positiveblue
3c3bce3415
makefile: fail rpc-check after finding any changes
`rpc-check` is used in our CI pipeline to detect any difference
between the committed and the automatically generated rpc files.
Unfortunately, the current method only detects changes in the
already existing files and won't fail if `make rpc` generates
a totally new file.

`git status --porcelain` makes the trick, it returns a line for
each file that has been modified, created or deleted.
2022-01-29 11:23:24 -08:00
Joost Jager
2009aec59d
itest: increase pg database connection limit 2022-01-04 08:29:22 +01:00
Liviu
abada24899 make: don't optimize debug binaries
Disable compiler optimizations and function inlining on a debug build to
improve debugging experience.
2021-12-20 11:47:18 -08:00
yyforyongyu
0379b4f1bf
makefile: add itest-clean to kill uncleaned processes 2021-12-04 14:54:37 +08:00
naveen
b3ef3db0f2
multi: Remove GO111MODULE env variable in Makefile
The `GO111MODULE` variable is not required from go 1.16
https://go.dev/blog/go116-module-changes
2021-11-30 09:35:30 +01:00
Oliver Gugger
43158b6b59
mod+tools+Makefile: use go install to fetch dependencies
Instead of hard coding a commit to use for a binary tool that we use
during the build process, we now only use "go install" to install the
binaries and the golang builtin versioning system to pin the exact
version/commit we want to use in go.mod.
2021-11-30 09:35:25 +01:00
Oliver Gugger
44266f3889
GitHub+Makefile: remove travis goals 2021-11-29 12:52:26 +01:00
Oliver Gugger
8facc6f07e
docs+Makefile: remove goveralls
We use a GitHub Action for sending the coverage to coveralls.io and
don't need the goveralls binary anymore.
2021-11-29 12:49:29 +01:00
Joost Jager
274faff980
postgres: add connection limit 2021-11-17 11:08:43 +01:00
Olaoluwa Osuntokun
1bff146c43
build: add new WASM specific release/build tags
We need to drop things like postgres+etcd, as they don't understand the
WASM/JS build target.
2021-11-15 17:14:09 -08:00
Hampus Sjöberg
082aeab24a build: make gomobile iOS build to .xcframework folder
Recent gomobile versions are now building for the `xcframework`
packaging format instead of `framework`. This commit addresses
this by outputting to a `.xcframework` folder.
2021-10-08 00:21:53 +02:00