so a friend tried to grab roc from nightly and run it
problem being
error while loading shared libraries: libasound.so.2 No such file or directory
now (I think) I get why, guess the editor depends on alsa for audio
and ofc he does not have a DE so it is not installed by default, and again he can't (and perhaps shouldn't need to ideally) install it himself for roc to operate
so then what would people who can only to run/ program in a tty environment do?
I think there should be an option to ignore it with the warning that only partial functionality will be enabled, no?
There is a feature flag when compiling from source to disable it.
Not a direct solution, but does enable a workaround
I think ideally we could also gracefully degrade regarding audio
we use a Rust crate for audio, and I'm not sure what their options are regarding that
honestly I wouldn't mind if we removed rodio
as a dependency for now
we aren't using it for anything, and I'd really like to avoid having roc
depend on shared libraries like this which aren't always available
because in general I want to avoid support requests of the form "I don't have lib_____
and roc
won't work without it, how do I fix this?" - they are really terrible UX
what do others think about removing rodio
as a dependency for now (we aren't actually using it for anything real yet anyway, it just makes it so that pressing F12 plays a bell sound - basically "hello world")
Silly question - what does the editor need audio for?
(I say this as someone who takes pains to turn off the terminal bell)
short answer is accessibility
text-to-speech
so we definitely need it in the future, but I don't know that solving the shared library problem right now is worth the trouble until we actually have something to use that library with :big_smile:
Ahhh interesting
I would have thought that text-to-speech is something you'd generally depend on OS functionality for, rather than having that built-in
Both mac & windows have accessibility APIs to expose text to screen readers
Would need to do some research on linux
yeah we talked about those options - short version is that it seems like for our use case we'll have an easier time getting to a good outcome if we go the direct audio route for the actual text, and just use OS APIs to detect user settings
Have you talked to people who actually use screen readers (for coding or otherwise)?
(I ask, not having done so myself - but I'm assuming such people would have important opinions on the matter)
Also, good TTS is hard.
I guess on the other hand if the Roc editor could really nail a good experience for visually-impaired people, that could be a good selling point for that niche market.
... but seems like a serious case of scope creep ;)
... and if you already talked to a visually impaired person to come to the current plan - definitely just ignore everything I said!
Joshua Warner said:
Have you talked to people who actually use screen readers (for coding or otherwise)?
yeah, @Jose Quesada - that's who I was referring to with the "we" who concluded we should do our own audio :big_smile:
I think actually the difference between doing a really good job and doing a functionally adequate job at all will be mostly a matter of design effort
I suspect the implementation effort will be pretty comparable either way, but I could be wrong!
I wonder how hard it would be to link to the underlying audio library dynamically - only when available on the system?
yeah I think that's ideally what we'd do - I assume the rodio
crate would have to support that, which I don't know if it does!
I think there is a second dependency on x/Wayland for visuals, correct? So that would have to go too for working in cli? Or does that work on Linux with no GUI.
Tangentially, I've kinda wanted to experiment with a terminal-only version of the editor ;)
^^ I would love to get roc-tui mature enough to do something like this.
I don't really have any long term ambitions for it at the moment other then just experimenting with ideas like this.
I'll take out rodio for now, I'll also set up a headless VM to check if no other issues pop up.
I've set up a PR here with rodio removed and I've confirmed it works on a headless ubuntu 22.04 server. It may not yet make it in tomorrow's nightly but the branch can be used to build a release with:
RUSTFLAGS="-C target-cpu=x86-64" cargo build --release
./ci/package_release.sh roc_release_no_alsa
uknow @Anton the more i think about it, why is it not possible to just dynamically load these stuff on demand, at runtime, when a user tries to open the editor?
Looks maybe possible, but also potentially a bit a fight with rust
Best discussion i have found on it so far: https://users.rust-lang.org/t/linux-executable-lazy-loading/65621
Dynamic loading on demand has an obvious benefit but also a significant downside, like that the editor suddenly breaks when you try to copy something because you don't have the correct dyn lib available. It's not a nice user experience and gives a very bad impression.
I think the way to go would be to start on a headless/CI/server nightly release.
In crates/cli/Cargo.toml
we can take out editor
from default = ["target-aarch64", "target-x86_64", "target-wasm32", "editor"]
.
I think I'll be able to set up the full headless release this week.
Anton said:
Dynamic loading on demand has an obvious benefit but also a significant downside, like that the editor suddenly breaks when you try to copy something because you don't have the correct dyn lib available. It's not a nice user experience and gives a very bad impression.
I think the way to go would be to start on a headless/CI/server nightly release.
In
crates/cli/Cargo.toml
we can take outeditor
fromdefault = ["target-aarch64", "target-x86_64", "target-wasm32", "editor"]
.
I think I'll be able to set up the full headless release this week.
yes that sounds bad, but what i had in mind is couldn't we just validate those dynamic libs when _opening_ the editor (not when trying to use the feature)?
having a headless release is a good idea too tho
couldn't we just validate those dynamic libs when _opening_ the editor
Yeah, that sounds good. It does seem like something that could potentially take a lot of time to figure out so I can't prioritize it right now but feel free to go ahead yourself if you like.
yea thanks. i will when i get the time. meanwhile the headless release is a good solution
@dank I've built a headless release, available here. The number of dynamic dependencies has dropped a lot but it's still possible that your friend will not be able to run it depending on how minimal their debian install is.
tnx anton we'll try it out
@dank I've slightly changed the name of the file, this is the new link. The old name caused issues with ci scripts.
no problem, thanks
was useful yesterday btw, only thing missing was glibc but that's ok for now
Happy to hear it :)
Last updated: Jul 06 2025 at 12:14 UTC