Use Nix shell in the Makefile for builds
Description
Use nix in Makefile and remove generated files from source control
Linked to :
- https://github.com/status-im/status-go/issues/4191
Steps
- [o] Add nix scripts & config
- [x] Scripts
- [x] Config file
- [x] Test build with new configuration
- Update Makefile
- [x] Add nix shell definition as default shell
- [x] Set simple shell for tasks which doesn't need Nix Shell
- [x] Remove tasks to install dependency provided by the nix shell
- [ ] Update gitignore file to remove the generated stuff
Hey @apentori, and thank you so much for making your first pull request in status-go! :heart: Please help us make your experience better by filling out this brief questionnaire https://goo.gl/forms/uWqNcVpVz7OIopXg2
Jenkins Builds
Click to see older builds (123)
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|---|---|---|---|---|---|---|
| :x: | fb72b13a | #1 | 2023-11-27 15:58:02 | ~22 sec | android |
:page_facing_up:log |
| :x: | fb72b13a | #1 | 2023-11-27 15:58:04 | ~24 sec | linux |
:page_facing_up:log |
| :x: | fb72b13a | #1 | 2023-11-27 15:58:12 | ~32 sec | ios |
:page_facing_up:log |
| :heavy_multiplication_x: | fb72b13a | #1 | 2023-11-27 15:58:22 | ~43 sec | tests |
:page_facing_up:log |
| :x: | 8cb60b52 | #2 | 2023-11-29 15:32:14 | ~20 sec | linux |
:page_facing_up:log |
| :x: | 8cb60b52 | #2 | 2023-11-29 15:32:16 | ~21 sec | android |
:page_facing_up:log |
| :x: | 8cb60b52 | #2 | 2023-11-29 15:32:16 | ~21 sec | ios |
:page_facing_up:log |
| :heavy_multiplication_x: | 8cb60b52 | #2 | 2023-11-29 15:32:21 | ~24 sec | tests |
:page_facing_up:log |
| :x: | f747e837 | #3 | 2023-11-29 16:27:25 | ~10 sec | linux |
:page_facing_up:log |
| :x: | f747e837 | #3 | 2023-11-29 16:27:26 | ~11 sec | ios |
:page_facing_up:log |
| :x: | f747e837 | #3 | 2023-11-29 16:27:42 | ~27 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | f747e837 | #3 | 2023-11-29 16:28:01 | ~44 sec | tests |
:page_facing_up:log |
| :x: | 28594c73 | #4 | 2024-02-19 11:48:05 | ~24 sec | android |
:page_facing_up:log |
| :heavy_check_mark: | 28594c73 | #4 | 2024-02-19 11:50:50 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | 28594c73 | #4 | 2024-02-19 12:21:31 | ~33 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 06b0ecaf | #5 | 2024-02-20 16:21:58 | ~1 min | linux |
:package:zip |
| :heavy_check_mark: | 06b0ecaf | #5 | 2024-02-20 16:25:41 | ~5 min | android |
:package:aar |
| :heavy_check_mark: | 06b0ecaf | #5 | 2024-02-20 16:52:26 | ~31 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | a49bb243 | #6 | 2024-02-21 15:16:55 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | a49bb243 | #6 | 2024-02-21 15:17:59 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | a49bb243 | #6 | 2024-02-21 15:50:30 | ~35 min | tests |
:page_facing_up:log |
| :x: | cda4aca6 | #7 | 2024-02-21 15:39:00 | ~13 sec | linux |
:page_facing_up:log |
| :x: | cda4aca6 | #7 | 2024-02-21 15:39:12 | ~31 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | cda4aca6 | #7 | 2024-02-21 15:50:49 | ~13 sec | tests |
:page_facing_up:log |
| :heavy_check_mark: | bcb1fa10 | #8 | 2024-02-22 14:43:39 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | bcb1fa10 | #8 | 2024-02-22 14:44:39 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | bcb1fa10 | #8 | 2024-02-22 15:17:41 | ~35 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | b47b0fd0 | #9 | 2024-02-23 08:36:36 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | b47b0fd0 | #9 | 2024-02-23 08:37:31 | ~2 min | linux |
:package:zip |
| :heavy_check_mark: | b47b0fd0 | #9 | 2024-02-23 09:10:22 | ~35 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | c7877c15 | #10 | 2024-02-23 09:13:43 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | c7877c15 | #10 | 2024-02-23 09:14:15 | ~2 min | linux |
:package:zip |
| :heavy_check_mark: | c7877c15 | #10 | 2024-02-23 09:47:12 | ~35 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | ac2dd4f8 | #11 | 2024-02-26 09:56:42 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | ac2dd4f8 | #11 | 2024-02-26 09:58:04 | ~6 min | android |
:package:aar |
| :heavy_multiplication_x: | ac2dd4f8 | #11 | 2024-02-26 10:21:10 | ~29 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 34fcea81 | #12 | 2024-02-27 16:10:35 | ~11 min | linux |
:package:zip |
| :heavy_check_mark: | 34fcea81 | #12 | 2024-02-27 16:12:39 | ~13 min | android |
:package:aar |
| :heavy_multiplication_x: | 34fcea81 | #12 | 2024-02-27 16:34:03 | ~35 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 85de5c84 | #13 | 2024-02-27 16:33:11 | ~6 min | android |
:package:aar |
| :heavy_check_mark: | 85de5c84 | #13 | 2024-02-27 16:34:40 | ~7 min | linux |
:package:zip |
| :heavy_check_mark: | 85de5c84 | #13 | 2024-02-27 17:12:25 | ~37 min | tests |
:page_facing_up:log |
| :x: | 2e85af09 | #14 | 2024-02-28 14:35:54 | ~12 sec | android |
:page_facing_up:log |
| :x: | 2e85af09 | #14 | 2024-02-28 14:36:07 | ~23 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 2e85af09 | #14 | 2024-02-28 14:36:59 | ~1 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | bf7a7bdd | #15 | 2024-03-01 10:36:10 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | bf7a7bdd | #15 | 2024-03-01 10:36:24 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | bf7a7bdd | #15 | 2024-03-01 11:15:27 | ~42 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | c5a712a3 | #16 | 2024-03-01 10:39:53 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | c5a712a3 | #16 | 2024-03-01 10:42:54 | ~5 min | linux |
:package:zip |
| :heavy_check_mark: | c5a712a3 | #16 | 2024-03-01 11:52:55 | ~37 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 348b49e7 | #17 | 2024-03-11 13:01:57 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | 348b49e7 | #17 | 2024-03-11 13:03:32 | ~6 min | android |
:package:aar |
| :heavy_multiplication_x: | 348b49e7 | #17 | 2024-03-11 13:05:49 | ~8 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | b6fee920 | #18 | 2024-03-11 13:06:35 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | b6fee920 | #18 | 2024-03-11 13:06:48 | ~2 min | android |
:package:aar |
| :heavy_multiplication_x: | b6fee920 | #18 | 2024-03-11 13:41:24 | ~35 min | tests |
:page_facing_up:log |
| :x: | 390db02a | #19 | 2024-03-18 11:00:53 | ~23 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | 390db02a | #19 | 2024-03-18 11:00:55 | ~21 sec | tests |
:page_facing_up:log |
| :x: | 390db02a | #19 | 2024-03-18 11:01:08 | ~34 sec | linux |
:page_facing_up:log |
| :x: | 5a206f36 | #20 | 2024-03-18 14:19:39 | ~21 sec | linux |
:page_facing_up:log |
| :x: | 5a206f36 | #20 | 2024-03-18 14:19:40 | ~22 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | 5a206f36 | #20 | 2024-03-18 14:19:47 | ~25 sec | tests |
:page_facing_up:log |
| :heavy_multiplication_x: | 43927ed7 | #21 | 2024-03-18 16:34:42 | ~13 sec | tests |
:page_facing_up:log |
| :x: | 43927ed7 | #21 | 2024-03-18 16:34:48 | ~18 sec | linux |
:page_facing_up:log |
| :x: | 43927ed7 | #21 | 2024-03-18 16:34:48 | ~19 sec | android |
:page_facing_up:log |
| :x: | 5c3df349 | #22 | 2024-03-19 12:26:09 | ~19 sec | android |
:page_facing_up:log |
| :x: | 5c3df349 | #22 | 2024-03-19 12:26:09 | ~20 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 5c3df349 | #22 | 2024-03-19 12:26:24 | ~35 sec | tests |
:page_facing_up:log |
| :x: | 720b0ee9 | #23 | 2024-03-19 12:52:37 | ~12 sec | android |
:page_facing_up:log |
| :x: | 720b0ee9 | #23 | 2024-03-19 12:52:40 | ~12 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 720b0ee9 | #23 | 2024-03-19 12:52:40 | ~12 sec | tests |
:page_facing_up:log |
| :x: | 1b82a8e1 | #24 | 2024-03-19 12:58:03 | ~12 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | 1b82a8e1 | #24 | 2024-03-19 12:58:05 | ~11 sec | tests |
:page_facing_up:log |
| :x: | 1b82a8e1 | #24 | 2024-03-19 12:58:07 | ~13 sec | linux |
:page_facing_up:log |
| :x: | 1f412273 | #25 | 2024-03-19 13:55:04 | ~13 sec | android |
:page_facing_up:log |
| :x: | 1f412273 | #25 | 2024-03-19 13:55:08 | ~12 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 1f412273 | #25 | 2024-03-19 13:55:08 | ~13 sec | tests |
:page_facing_up:log |
| :x: | 6357491e | #26 | 2024-03-19 13:59:39 | ~14 sec | android |
:page_facing_up:log |
| :x: | 6357491e | #26 | 2024-03-19 13:59:42 | ~14 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 6357491e | #26 | 2024-03-19 13:59:57 | ~30 sec | tests |
:page_facing_up:log |
| :x: | b66f490f | #27 | 2024-03-19 14:03:17 | ~13 sec | android |
:page_facing_up:log |
| :heavy_multiplication_x: | b66f490f | #27 | 2024-03-19 14:03:18 | ~11 sec | tests |
:page_facing_up:log |
| :x: | b66f490f | #27 | 2024-03-19 14:03:19 | ~13 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 66a84ab2 | #29 | 2024-03-21 12:32:47 | ~12 sec | tests |
:page_facing_up:log |
| :x: | 66a84ab2 | #29 | 2024-03-21 12:35:20 | ~13 sec | android |
:page_facing_up:log |
| :heavy_check_mark: | fd3cae9b0b8bb139ca2e12572e78c4318dc529f6 | #29 | 2024-03-21 13:35:06 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | fd3cae9b0b8bb139ca2e12572e78c4318dc529f6 | #30 | 2024-03-21 13:35:59 | ~4 min | unknown |
:package:aar |
| :heavy_multiplication_x: | 7cdcdcf877e9c8857b8a8ef47eedcd21a209f057 | #31 | 2024-03-21 14:01:28 | ~13 sec | tests |
:page_facing_up:log |
| :heavy_check_mark: | 7cdcdcf877e9c8857b8a8ef47eedcd21a209f057 | #31 | 2024-03-21 14:02:39 | ~1 min | unknown |
:package:aar |
| :heavy_check_mark: | 7cdcdcf877e9c8857b8a8ef47eedcd21a209f057 | #30 | 2024-03-21 14:02:59 | ~1 min | linux |
:package:zip |
| :heavy_check_mark: | 511cf08105e05f59be18a940d839fe664c94d716 | #32 | 2024-03-21 14:08:33 | ~1 min | unknown |
:package:aar |
| :heavy_check_mark: | 511cf08105e05f59be18a940d839fe664c94d716 | #31 | 2024-03-21 14:08:58 | ~1 min | linux |
:package:zip |
| :heavy_multiplication_x: | 511cf08105e05f59be18a940d839fe664c94d716 | #32 | 2024-03-21 14:10:31 | ~3 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 09fa2c5479182b75abbbd799d984789063427530 | #33 | 2024-03-21 17:27:20 | ~1 min | unknown |
:package:aar |
| :heavy_multiplication_x: | 09fa2c5479182b75abbbd799d984789063427530 | #33 | 2024-03-21 17:29:00 | ~3 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 09fa2c5479182b75abbbd799d984789063427530 | #32 | 2024-03-21 17:30:19 | ~4 min | linux |
:package:zip |
| :heavy_multiplication_x: | 09fa2c5479182b75abbbd799d984789063427530 | #34 | 2024-03-27 15:52:05 | ~22 sec | tests |
:page_facing_up:log |
| :heavy_multiplication_x: | 02f1a3380a3c8a14e224464ac7a44e092ca002ca | #35 | 2024-03-27 17:15:18 | ~1 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 02f1a3380a3c8a14e224464ac7a44e092ca002ca | #33 | 2024-03-27 17:18:12 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | 02f1a3380a3c8a14e224464ac7a44e092ca002ca | #34 | 2024-03-27 17:18:54 | ~4 min | unknown |
:package:aar |
| :x: | e66f18d16788a7a71225666340795d873986d446 | #35 | 2024-03-28 11:20:39 | ~1 min | android |
:page_facing_up:log |
| :heavy_multiplication_x: | e66f18d16788a7a71225666340795d873986d446 | #36 | 2024-03-28 11:22:56 | ~3 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | e66f18d16788a7a71225666340795d873986d446 | #34 | 2024-03-28 11:25:01 | ~5 min | linux |
:package:zip |
| :heavy_multiplication_x: | b60d425536d62368f3502a8689e70814f33af8f5 | #37 | 2024-04-03 07:20:54 | ~1 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | b60d425536d62368f3502a8689e70814f33af8f5 | #35 | 2024-04-03 07:23:40 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | b60d425536d62368f3502a8689e70814f33af8f5 | #36 | 2024-04-03 07:25:12 | ~5 min | android |
:package:aar |
| :heavy_multiplication_x: | b60d425536d62368f3502a8689e70814f33af8f5 | #38 | 2024-04-03 07:41:45 | ~59 sec | tests |
:page_facing_up:log |
| :heavy_multiplication_x: | 9dc8c79ea673b5bc930e3c740d402c770a3a01cc | #39 | 2024-04-03 08:13:33 | ~5 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 9dc8c79ea673b5bc930e3c740d402c770a3a01cc | #36 | 2024-04-03 08:14:06 | ~6 min | linux |
:package:zip |
| :heavy_check_mark: | 9dc8c79ea673b5bc930e3c740d402c770a3a01cc | #37 | 2024-04-03 08:14:19 | ~6 min | android |
:package:aar |
| :heavy_multiplication_x: | bf3faebf86700ea8013c7c25b96b7c0b48c087b1 | #40 | 2024-04-09 07:06:01 | ~2 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | bf3faebf86700ea8013c7c25b96b7c0b48c087b1 | #37 | 2024-04-09 07:07:34 | ~4 min | linux |
:package:zip |
| :heavy_check_mark: | bf3faebf86700ea8013c7c25b96b7c0b48c087b1 | #38 | 2024-04-09 07:07:57 | ~4 min | android |
:package:aar |
| :x: | 35d4790a4eae91870b3dfa3238d9be8600c8ef62 | #39 | 2024-04-09 07:41:15 | ~12 sec | android |
:page_facing_up:log |
| :x: | 35d4790a4eae91870b3dfa3238d9be8600c8ef62 | #38 | 2024-04-09 07:41:18 | ~11 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 35d4790a4eae91870b3dfa3238d9be8600c8ef62 | #41 | 2024-04-09 07:41:22 | ~13 sec | tests |
:page_facing_up:log |
| :x: | 5e9f3b3dfae31d4bd4f3a2a06bb95b2e3d76950b | #40 | 2024-04-09 07:48:51 | ~13 sec | android |
:page_facing_up:log |
| :x: | 5e9f3b3dfae31d4bd4f3a2a06bb95b2e3d76950b | #39 | 2024-04-09 07:48:51 | ~13 sec | linux |
:page_facing_up:log |
| :heavy_multiplication_x: | 5e9f3b3dfae31d4bd4f3a2a06bb95b2e3d76950b | #42 | 2024-04-09 07:48:53 | ~12 sec | tests |
:page_facing_up:log |
| :heavy_multiplication_x: | 77db6c1b70b17de273c532562c5afc7e4db84f44 | #43 | 2024-04-09 08:54:24 | ~2 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | 77db6c1b70b17de273c532562c5afc7e4db84f44 | #40 | 2024-04-09 08:56:54 | ~5 min | linux |
:package:zip |
| :heavy_check_mark: | 77db6c1b70b17de273c532562c5afc7e4db84f44 | #41 | 2024-04-09 08:58:25 | ~6 min | android |
:package:aar |
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|---|---|---|---|---|---|---|
| :heavy_check_mark: | 671b07d7db1cf07196abf82e555e8e33d08622d9 | #41 | 2024-04-09 09:26:48 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | 671b07d7db1cf07196abf82e555e8e33d08622d9 | #42 | 2024-04-09 09:27:03 | ~3 min | android |
:package:aar |
| :heavy_check_mark: | f9df853e4ae48d9abead6dcd5314dbd5d09172df | #42 | 2024-04-09 09:51:56 | ~2 min | linux |
:package:zip |
| :heavy_check_mark: | f9df853e4ae48d9abead6dcd5314dbd5d09172df | #43 | 2024-04-09 09:52:02 | ~2 min | android |
:package:aar |
| :heavy_check_mark: | f9df853e4ae48d9abead6dcd5314dbd5d09172df | #45 | 2024-04-09 10:41:49 | ~44 min | tests |
:page_facing_up:log |
| :heavy_check_mark: | f9df853e4ae48d9abead6dcd5314dbd5d09172df | #5 | 2024-04-09 11:02:33 | ~7 min | ios |
:package:zip |
I would't attempt to remove generated files in this PR. First I would try to get this to work in CI as-is.
Building with make seems to work
make statusgo
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
go build -mod=vendor -v \
-tags 'gowaku_no_rln' -ldflags=' -X github.com/status-im/status-go/params.Version=0.175.1 -X github.com/status-im/status-go/params.GitCommit=cda4aca61 -X github.com/status-im/status-go/params.IpfsGatewayURL=https://ipfs.status.im/ -X github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum/metrics.EnabledStr=true' \
-o ./build/bin/statusd ./cmd/statusd
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
google.golang.org/protobuf/internal/flags
google.golang.org/protobuf/internal/set
[...]
github.com/status-im/status-go/cmd/statusd
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
Compilation done.
Missing TARGET, assuming default target. See nix/README.md for more details.
Configuring Nix shell for target 'default'...
Run "build/bin/statusd -h" to view available commands.
- Need to understand why the
Missing TAGETmessage appear 3 times.
@apentori because in a Makefile every line in a given target starts a new instance of a shell:
https://github.com/status-im/status-go/blob/cda4aca611ac2c42c64f03fd1c11d04493828bd0/Makefile#L132-L137
In this case there's 3 lines, go build and two echo lines. Since they are not joined together with a && \ or ; \ they are separate commands that spawn separate shells.
This is one of the main reasons why people use the && \ hack. For example if they set env variables within a Makefile target and want to use them in the next command within the same target.
make statusgo: OKmake statusgo-android: KO - need to investigate on whymake statusgo-library: OKmake statusgo-shared-library: OKmake statusgo-ios: KO - can we build outside of macos ?make test: KO - need to confirm if its normal or not
Also, with this PR working we can remove all of those:
https://github.com/status-im/status-go/blob/bcb1fa1063009b194b7667be58a21973eb59f5f7/Makefile#L273-L316
Except for one that's missing from nixpkgs, which is modvendor package.
But it should be fairly easy to add it to the overlay.nix.
Also, your nix/scripts/shell.nix appears to be missing parts that prevent nesting of shells.
But it should be fairly easy to add it to the
overlay.nix.
I don't see how to do it :/
Shoud it be something like this ?
goModVendor = buildGoModule rec {
pname = "modvendor";
version = "0.5.0";
src = fetchFromGitHub {
owner = "goware";
repo = "nodvendor";
rev = "v${version}";
hash = "sha256-somesha";
};
}
Shoud it be something like this ?
Yes, essentially yes. You can see examples of this in status-mobile:
# Custom packages
aapt2 = callPackage ./pkgs/aapt2 { };
patchMavenSources = callPackage ./pkgs/patch-maven-srcs { };
goMavenResolver = callPackage ./pkgs/go-maven-resolver { };
xcbeautify = callPackage ./pkgs/xcbeautify { };
idb-companion = callPackage ./pkgs/idb-companion { };
https://github.com/status-im/status-mobile/blob/05a810b051605bd15cc92c502e955a896f98d26f/nix/overlay.nix#L83-L88
Also, you're missing gcroots changes here I applied in:
- https://github.com/status-im/status-mobile/pull/18742
I think we should align nix/scripts to be exactly the same as status-mobile to avoid confusion.
@igor-sirotin Yes, this is the issue I mentioned in comment above about new way to handle gcroots.
No, we should force devs and users to use Nix. That way we have full control over build tools and dependencies.
As for the warning, i agree, it's not necessary here as we only have the default shell.
compile: version "go1.20.13" does not match go tool version "go1.19.9"
Where does that come from? We do have bad version references in go.mod for sure:
https://github.com/status-im/status-go/blob/0aed93ff04b7d8194c650921ceb659441dc3d602/go.mod#L3
Using $(shell uname) will invoke Nix shell to run uname, it shouldn't be necessary and will make things slower.
No, we should force devs and users to use Nix. That way we have full control over build tools and dependencies.
I personally disagree with this, but won't complain as I am going to use Nix 😄 But I can simply imagine someone who don't want to use Nix, but he will be forced to use it or rewrite the Makefile. Or if we decide to switch the package manager, it shouldn't affect the Makefile, the build instructions should remain the same in theory.
As fro the "full control over build tools and dependencies": If we remove generated files from the repo, then it shouldn't be such a problem.
Again, I'm just posting my thoughts here. It's not a blocker or requirement from me.
compile: version "go1.20.13" does not match go tool version "go1.19.9"Where does that come from? We do have bad version references in
go.modfor sure:
As I mentioned:
This seem to happen because of
GOROOTenv variable defined by GoLand. SimpleGOROOT :=in makefile fixes the issue.
Why do you use a custom GOROOT? Is it common among devs?
Why do you use a custom
GOROOT? Is it common among devs?
I don't do this explicitly myself. This is done my IDE (JetBrains GoLand). And it could easily be that other devs have this env variable defined as well.
Settings GOROOT was previously required by Go. Not it's not. But I can't modify my IDE behaviour. And I would like not to switch from it 😄
That's fine, just trying to understand the behavior.
Hmm make statusgo-android is failing on this branch with :
unable to import bind/java: [-: # golang.org/x/mobile/bind/java
In file included from context_android.c:6:
../../../golang.org/x/mobile/bind/java/seq_android.h:9:10: fatal error: 'android/log.h' file not found]
/nix/store/0gm0yz51dh0j4afz3q2pmzkazd2n7y1l-gomobile-unstable-2022-05-18/bin/gomobile:
/nix/store/0gm0yz51dh0j4afz3q2pmzkazd2n7y1l-gomobile-unstable-2022-05-18/bin/gobind
-lang=go,java -outdir=/tmp/gomobile-work -tags=gowaku_no_rln
github.com/status-im/status-go/mobile failed: exit status 1
make: *** [statusgo-android] Error 1
perhaps with newer nixpkgs we also will have to upgrade gomobile overlay?
I guess for this PR we could stick with older nixpkgs if that solves the issue and we can upgrade nixpkgs for status-go separately to address these issues.
cc @jakubgs
I think we should use the same commit as status-mobile.
For future reference we had to apply some extra fixes for this:
status-go#ba042379- fix(nix)_: avoid warning about default shell fallbackstatus-go#c343d529- fix(nix)_: add USER var when sourcing profilestatus-go#9509fddd- nix: fix detecting install type in Dockerstatus-go#c57c8aab- ci: fix build