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

nixify the project #1

Merged
merged 4 commits into from
Dec 14, 2023
Merged

nixify the project #1

merged 4 commits into from
Dec 14, 2023

Conversation

rvolosatovs
Copy link

@rvolosatovs rvolosatovs commented Dec 13, 2023

  • Did a little reorganization of the repo:
    • moved RustStore to top-level
  • Check-in Cargo.lock
  • Check-in flake.lock
  • Removed .cargo target linker overrides etc. (note, that mold is already used by Nixify by default when possible)

Refs rvolosatovs/nixify#199

From root of this repo:

$ nix build -L

Produces:

$ ls result/bin 
server  sync  syncdb

Similarly (on aarch64-darwin):

$ nix build -L '.#RustStore-armv7-unknown-linux-musleabihf'

For android (only supported on x86_64-linux) at this time:

$ nix build -L '.#packages.x86_64-linux.RustStore-aarch64-linux-android'

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs
Copy link
Author

I encountered this while building for Android:

RustStore-deps>   = note: ld: error: cannot open Scrt1.o: No such file or directory
RustStore-deps>           ld: error: cannot open crti.o: No such file or directory
RustStore-deps>           ld: error: cannot open crtbeginS.o: No such file or directory
RustStore-deps>           ld: error: unable to find library -lgcc_s
RustStore-deps>           ld: error: unable to find library -lutil
RustStore-deps>           ld: error: unable to find library -lrt
RustStore-deps>           ld: error: unable to find library -lpthread
RustStore-deps>           ld: error: unable to find library -lm
RustStore-deps>           ld: error: unable to find library -ldl
RustStore-deps>           ld: error: unable to find library -lc
RustStore-deps>           ld: error: cannot open crtendS.o: No such file or directory
RustStore-deps>           ld: error: cannot open crtn.o: No such file or directory
RustStore-deps>           clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

It was caused by .cargo target build overrides, so I simply removed the config there and the build succeeded:

$ file ./result/bin/*         
./result/bin/server: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped
./result/bin/sync:   ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped
./result/bin/syncdb: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped

@mamcx mamcx merged commit 208a6e7 into mamcx:nixify Dec 14, 2023
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