-
Notifications
You must be signed in to change notification settings - Fork 258
feat(development)_: add nix flake and expose devshells and packages through it #6529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Jenkins BuildsClick to see older builds (309)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6529 +/- ##
===========================================
+ Coverage 60.38% 60.51% +0.13%
===========================================
Files 849 849
Lines 105116 105116
===========================================
+ Hits 63470 63607 +137
+ Misses 34025 33946 -79
+ Partials 7621 7563 -58
Flags with carried forward coverage won't be shown. Click here to find out more. |
@jakubgs I added more changes to this PR but I think you will want to look at them since this was 'just to make it work' effort. I didn't want to touch |
00ea272
to
47f2f91
Compare
665f614
to
0bba7d6
Compare
2426d17
to
5ccf78b
Compare
1b83357
to
c3991b9
Compare
0bb8f14
to
076190e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly correct, just a few questions.
cb49b30
to
e94ba81
Compare
e8d5103
to
e806e32
Compare
✔️ status-go/prs/tests/PR-6529#33 🔹 ~34 min 🔹 e806e32 🔹 📦 tests package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick test, works blazingly fast, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder mostly about previous nwaku
dependency setup, how it was pinned and docs on pinning it in README.
ifneq ($(detected_OS),Windows) | ||
SHELL := ./nix/scripts/shell.sh | ||
# No need for shell.sh script anymore, we use nix develop directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do that separately, this is already big enough.
}; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/df27247e6f3e636c119e2610bf12d38b5e98cc79"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have a comment on this commit hash.
Whats the aim of this pin? Some tools versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is that we should be using thet ultimately same nixpkgs
commit across zerokit
, nim-waku
, status-go
, and status-desktop
, but we might need to align those later.
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/df27247e6f3e636c119e2610bf12d38b5e98cc79"; | ||
# We cannot do follows since the nim-unwrapped-2_0 doesn't exist in this nixpkgs version above | ||
nwaku.url = "git+https://github.com/waku-org/nwaku?submodules=1&rev=e755fd834f5f3d6fba216b09469316f0328b3b6f"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How nwaku
was downloaded/pinned before?
How it will be synchronised to flake input version?
Would be nice to have a comment on this particular pin.
Is it smth developers need to update? Maybe add to README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good question, normally it's done via vendor
submodule/commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add it in the _docs/how-to-build.md a special section about building with nix and how to update the dependencies(nwaku) to have the CI(I need to add this) always green. But I think here they are adding nwaku as a submodule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in that PR we aren't adding directly nwaku as a submodule, what we did was adding waku-go-bindings as a go module, and when building waku-go-bindings
it clones nwaku and builds libwaku
It can definitely be improved, but as an initial implementation it works decently well :)
|
||
## Resources | ||
|
||
You can learn more about Nix by watching these presentations: | ||
|
||
* [Nix Fundamentals](https://www.youtube.com/watch?v=m4sv2M9jRLg) ([PDF](https://drive.google.com/file/d/1Tt5R7QOubudGiSuZIGxuFWB1OYgcThcL/view?usp=sharing), [src](https://github.com/status-im/infra-docs/tree/master/presentations/nix_basics)) | ||
* [Nix in Status](https://www.youtube.com/watch?v=rEQ1EvRG8Wc) ([PDF](https://drive.google.com/file/d/1Ti0wppMoj40icCPdHy7mJcQj__DeaYBE/view?usp=sharing), [src](https://github.com/status-im/infra-docs/tree/master/presentations/nix_in_status)) | ||
|
||
And you can read [`nix/DETAILS.md`](./DETAILS.md) for more information. | ||
* [Nix Flakes](https://wiki.nixos.org/wiki/Flakes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this also available publicly?
https://docs.infra.status.im/presentations/nix_flakes/content.html
f028768
to
88d0d6e
Compare
Expose status-go library, mobile-android and mobile-ios as packages of this flake. Referenced issue: * waku-org/nwaku#3232
Remove old nix commands from Makefile and files from the repo. Adapt Jenkinsfiles to the flake.nix. Update docs for building and nix. Referenced issue: * waku-org/nwaku#3232
Referenced issue:
Creating Nix flake to simplify Nix usage in the repo.
Nix Flake is added with exposed devShells, so a user can type
nix develop
in the repo root and instantiate a shell or use already existingmake shell
.The following packages are exposed: