Skip to content
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

nix: create initial version of flake #3253

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

markoburcul
Copy link
Contributor

@markoburcul markoburcul commented Jan 24, 2025

It includes also androidndk and files needed for nimbus-build-system

Referenced issue: #3232

Description

Adding Nix flake to build Android app library

How to test

  1. nix build '?submodules=1#'

Issue

#3232
closes #

Copy link

github-actions bot commented Jan 24, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

Unknown release type "nix" found in pull request title "nix: create initial version of flake".

Available types:

  • chore
  • docs
  • feat
  • fix
  • refactor
  • style
  • test

@markoburcul
Copy link
Contributor Author

I've managed to overcome building the Nim compiler using nimbus-build-system. The issue I've encountered is that nwaku is using Nim 2.0.12 while for nim-codex it is 2.0.14. The part in the preBuild phase that had to be added is a bit different:

    pushd vendor/nimbus-build-system/vendor/Nim
    mkdir dist
    cp -r ${callPackage ./nimble.nix {}}    dist/nimble
    chmod 777 -R dist/nimble
    mkdir -p dist/nimble/dist
    cp -r ${callPackage ./checksums.nix {}} dist/checksums  # need both
    cp -r ${callPackage ./checksums.nix {}} dist/nimble/dist/checksums
    cp -r ${callPackage ./atlas.nix {}}     dist/atlas
    chmod 777 -R dist/atlas
    mkdir dist/atlas/dist
    cp -r ${callPackage ./sat.nix {}}       dist/nimble/dist/sat
    cp -r ${callPackage ./sat.nix {}}       dist/atlas/dist/sat
    cp -r ${callPackage ./csources.nix {}}  csources_v2
    chmod 777 -R dist/nimble csources_v2
    popd

In nimbus-build-system the directory vendor/Nim was missing rightly placed atlas and sat git repositories.

@jakubgs
Copy link
Contributor

jakubgs commented Jan 24, 2025

Seems a bit different than what we had when nimbus-eth2 was using Nim 2.0.12, but if it works it works.

It includes also androidndk and files needed for nimbus-build-system

Referenced issue: #3232

Signed-off-by: markoburcul <[email protected]>
@markoburcul
Copy link
Contributor Author

It is possible to compile using system nim, tried it on this branch for both libwaku-android-arm64 and libwaku-android-amd64:

nix develop
make update
make libwaku-android-arm64 USE_SYSTEM_NIM=1

I'm still facing issue when building it:

nwaku> /build/nim-2.0.12/compiler/nimblecmd.nim(144, 12) compiler msg initiated here [MsgOrigin]
nwaku> /build/source/waku.nimble(1, 2) Error: cannot open file: ""
nwaku> /build/nim-2.0.12/compiler/modulepaths.nim(75, 17) compiler msg initiated here [MsgOrigin]
nwaku> make[1]: *** [Makefile:409: build-libwaku-for-android-arch] Error 1
nwaku> make[1]: Leaving directory '/build/source'
nwaku> make: *** [Makefile:417: libwaku-android-arm64] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants