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

Use Zig tool chain to cross compile C sshnpd for a variety of standard targets #1208

Closed
cpswan opened this issue Jul 22, 2024 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@cpswan
Copy link
Member

cpswan commented Jul 22, 2024

Is your feature request related to a problem? Please describe.

Present builds are slow for arm targets, and we don't offer musl based builds.

Describe the solution you'd like

If we make use of Zig cc to cross compile a CMake project it should be possible to speed up builds and offer a wider variety of targets.

Describe alternatives you've considered

There are probably ways to do this with the gcc cross compilers (and likely clang also).

@cpswan cpswan added the enhancement New feature or request label Jul 22, 2024
@cpswan cpswan self-assigned this Jul 22, 2024
@cpswan
Copy link
Member Author

cpswan commented Jul 22, 2024

Putting P3 for now, as we don't have many folk using the binaries, and we're not yet doing frequent releases.

@cpswan
Copy link
Member Author

cpswan commented Aug 2, 2024

Zig appears to work (for trivial cases), but doesn't get us a working sshnpd binary.

From the cpswan-zig-cc branch I've been able to create binaries that output help on their respective platforms, so the basics are there.

But when attempting a connection to the daemon it's unable to invoke srv with the command line being echoed to STDOUT e.g.:

[INFO] sshnpd | Starting main loop
[INFO] 2024-08-02 15:35:41.944013 | E2E TESTS | Monitor .*monitor started
[INFO] 2024-08-02 15:35:41.944013 | refresh_device_entry | Saving username entries for this device
[INFO] 2024-08-02 15:35:42.390470 | refresh_device_entry | Refreshing device info entries for this device
 srv -h 85.239.63.180 -p 43973 --local-port 22 --local-host localhost --rv-auth --rv-e2ee
[WARN] 2024-08-02 15:35:55.392265 | child_exit_handler | Received signal: -1501258096

Reading through zig cc: a Powerful Drop-In Replacement for GCC/Clang there's a section on compiler-rt which concludes:

Zig's compiler-rt is not yet complete. However, completing it is a prerequisite for releasing Zig version 1.0.0.

I suspect that how we invoke srv is trying to use some of the missing functionality.

For now, it would be prudent of us to wait until Zig hits v1.0.0 before returning to this approach.

@cpswan cpswan closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant