Post AZM2WMEd6nVT7mwc9g by krh@fosstodon.org
(DIR) More posts by krh@fosstodon.org
(DIR) Post #AZM2WKFcU96syHONQ8 by gfxstrand@mastodon.gamedev.place
2023-09-02T01:29:59Z
1 likes, 0 repeats
A bit annoyed by the documentation situation with #rustLang... As with most things in Rust land, it's great if you use cargo and it really sucks if you don't.Unlike rustfmt, rustdoc actually has to be able to compile the code so it needs access to all your dependencies. You can't just invoke rustdoc on foo.rs and call it a day. It really needs to be invoked by the build system. Worse, it doesn't support all the same flags as rustc, some of which are used by meson.
(DIR) Post #AZM2WLJYWzqwGmF2C8 by gfxstrand@mastodon.gamedev.place
2023-09-02T01:38:46Z
0 likes, 0 repeats
I mean, it makes sense why they do that. You want to be able to run proc macros so you can determine auto-derived traits and stuff like that. Also, rustdoc for one package will generate links to docs for other packages which is pretty neat. You can't really do that without compiling and tying into cargo. Unfortunately, as with a lot of other stuff, that leaves those of us trying to use other build systems in a real pickle.
(DIR) Post #AZM2WMEd6nVT7mwc9g by krh@fosstodon.org
2023-09-02T06:41:15Z
0 likes, 0 repeats
@gfxstrand Meson is actively hostile towards rust and it has really soured me on meson. Declarative build system sounds nice until you realize what a gatekeeper it is.
(DIR) Post #AZM2WNOanF4Oiyc5K4 by krh@fosstodon.org
2023-09-02T06:43:41Z
0 likes, 0 repeats
@gfxstrand I'll admit to having thought, "if I just rewrite enough of the project in rust, we could switch to cargo and just use meson for the remaining C/C++ parts."
(DIR) Post #AZM2WOK1Lj0Vb5Twps by Conan_Kudo@fosstodon.org
2023-09-02T10:46:24Z
1 likes, 0 repeats
@krh @gfxstrand It's easy enough to see Rust is actively hostile to external build systems, though. It's really difficult to use Rust in a non-Cargo context and they don't have nice things to say when you ask for help trying to do it.That being said, I was soured on Meson for different reasons (mostly the unstable behavior/API from version to version) and generally prefer to use CMake.
(DIR) Post #AZM2WPTd3UHrBAz8S0 by gfxstrand@mastodon.gamedev.place
2023-09-02T01:46:38Z
0 likes, 0 repeats
Honestly, all that would be fine if it weren't for the fact that other options for Rust are limited or non-existent. Mesa uses Sphinx for a bunch of stuff but, in spite of Rust being a popular language for nearly a decade now, Sphinx has zero support for it. There doesn't even seem to be a plugin as far as I can tell.Best I can do is write code comments and hope people read them. That or write a bunch of totally disconnected .rst files for sphinx. 🤷🏻♀️
(DIR) Post #AZM2WRSdg8gRKgXNBY by gfxstrand@mastodon.gamedev.place
2023-09-02T01:47:35Z
0 likes, 0 repeats
If there's something I'm missing, I'd be happy to know what it is but the situation seems pretty dire from the bit of research I did today.
(DIR) Post #AZMZlPSmgXRJy5Lliq by lodurel@mastodon.social
2023-09-02T14:51:39Z
0 likes, 0 repeats
@Conan_KudoNot sure if the talk of hostility on either side of the pond is bringing a lot to the conversation tbh.meson has its way of working and cargo doesn't really fit that model. Rust devs have low interest to contribute to build systems other than cargo because cargo works well for its use case and is entrenched in the ecosystemAs a C++ dev turned Rustacean it is great not to have to think about "what build system this dep is using". Cargo monoculture has upsides @krh @gfxstrand
(DIR) Post #AZMZlQpraDUkDx9iKm by gfxstrand@mastodon.gamedev.place
2023-09-02T15:58:49Z
0 likes, 0 repeats
@lodurel For some, monoculture isn't an option. There's no way I can make Mesa use Cargo for everything. There's no way I can even break out the single rust component I'm building and make it pure cargo. We've got python which generates C in one part of the project which then gets run through bindgen and then the rust is compiled against that. The closest we could come to just using cargo would be something where meson invokes cargo and then goes back to building.@Conan_Kudo @krh
(DIR) Post #AZMZlRggPpkIrlrtfE by gfxstrand@mastodon.gamedev.place
2023-09-02T16:03:27Z
1 likes, 0 repeats
@lodurel This problem is actively hampering Rust's adoption in systems-level Linux software. You either RIIR or you fight with tooling indefinitely. Some code bases are way too big for RIIR to be an option.So we either abandon Rust or fight with the tools. The language is fantastic but this is a real problem. Unfortunately, the rust community hasn't really been investing in fixing the problem.@Conan_Kudo @krh