KillingSpark / rustysd

A service manager that is able to run "traditional" systemd services, written in rust
MIT License
506 stars 15 forks source link

Redox Support #14

Closed MggMuggins closed 1 year ago

MggMuggins commented 4 years ago

Hi, I'm a contributor to RedoxOS and have been thinking about working on init for the past year or so as real life sorta took over. I dove into getting rustysd running as a normal application on Redox today, and have read through all your notes on the subject.

So far I've been working my way up the dependency tree to try and get to actually compiling rustysd. I talked to AdminXVII (who ported nix) and I'm just pulling his branch for the time being. I also had to [replace] time, there's a redox fork which supports 0.1 until chrono updates its dependency. Still running into issues with signal-hook, due to a couple of missing symbols in libc.

My understanding is that there is some magic that connects libc to relibc during compilation so that relibc is the backend of libc, so you can make libc calls in your program without needing to depend on relibc directly. Given that, I think it may not be too difficult to get things to compile initially, and then it's a bunch of debugging. For that, redoxer should be helpful.

Essentially I opened this issue so that we can get some dialog going and hopefully see rustsd running on Redox soon.

KillingSpark commented 4 years ago

Very nice! It's certainly good to have someone with deeper knowledge on redox agreeing that rustysd shouldn't be too hard to get running.

If chrono becomes too big of a problem rustysd could also use another logger on redox. I think that is the only place where it's used. Unfortunately I don't exactly know how redox handles the relibc/libc stuff.

Please keep me updated if you hit any roadblocks / get it running successfully!

MggMuggins commented 4 years ago

Will do. I've ended up needing to make some additions to relibc where things aren't implemented in order to get things to compile, I have no idea whether most of it will work. We shall see.

MggMuggins commented 4 years ago

@KillingSpark The branch of nix with redox support is based on something past 0.15.0 and there's a little API breakage in there. Would you be willing to update the deps here (specifically bump nix to 0.16.1) so that your codebase just works with that branch?

cdbattags commented 4 years ago

Link to that branch for the curious?

MggMuggins commented 4 years ago

The branch branches after 0.16.1, just checked. https://github.com/AdminXVII/nix/tree/add-redox-support-bis

cdbattags commented 4 years ago

@MggMuggins any idea if @AdminXVII is going to be looking to upstream this work?

AdminXVII commented 4 years ago

@cdbattags I'm periodically rebasing the branch to try and merge it upstream. Nix is taking quite some time to merge the PR, though. I will try to re-ping the maintainer soon.

AdminXVII commented 4 years ago

Here's the PR: https://github.com/nix-rust/nix/pull/1098

KillingSpark commented 4 years ago

@MggMuggins I will bump the nix to the newest version when I get to it, upgrading nix shouldn't take too much time

KillingSpark commented 4 years ago

c03f1e83cf56af05587e3b2487d9203841b27ced bumped the nix version to 0.16.1

KillingSpark commented 4 years ago

@AdminXVII Any idea why your PR isn't getting merged? I'd like to see how this works out :)

AdminXVII commented 4 years ago

@KillingSpark They want to try to compile Redox to debug I think. The thing is that they are on BSD and the compilation isn't really smooth on non-linux systems.

KillingSpark commented 1 year ago

Hi just doing a bit of cleanup. It's been a while and I'll be honest, redox support isn't high on my TODO list. Is this issue still relevant?

MggMuggins commented 1 year ago

I haven't spent a ton of time thinking about Redox much since I've been at university; I think they've made some substantial progress in terms of compatibility. There was some change in std that made porting crates a lot easier. It's possible Rustysd would work without much modification. Could be an interesting use case.

But I'm not working on anything for Redox right now (nor planning on it), so certainly not a priority.