Libs Meetings
Minutes
Meeting Link: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
Attendees: Amanieu, David, JoshT, Mara, Eric Holk, TC
11 rust-lang/rust T-libs-api FCPs
nikomatsakis (2), scottmcm (2), BurntSushi (8), joshtriplett (5), m-ou-se (4), dtolnay (2), tmandry (1), Amanieu (7)
Amanieu: we discussed this previously. not coming to any conclusion
Amanieu: skip this one for now? since chris isn't here
JoshT: even with chris we might not be able to make progress
Amanieu: prefer to push back on this. push linux to support ptr+len
Mara: acp seems fine to me
JoshT: our previous argument against this was overhead, but it looks like it has no overhead..
Amanieu: could be come a sliding scale. e.g. if we provide function name, should that also be nul terminated?
JoshT: can we make it flexible somehow, such that the kernel people can provide this themselves?
Mara: With nul terminated paths in Location, we could make Location smaller on our side too.
JoshT: Nora tried that. (Tiny performance improvement)
Mara: Are there any platforms that allow nul bytes inside paths?
Amanieu: No, all platforms support C.
JoshT: To my knowledge, no.
Mara: Seems fine to me
JoshT: I'd check my box, no objection
https://github.com/rust-lang/libs-team/issues/466#issuecomment-2461603806
Amanieu: bit of a weak argument
Amanieu: Somewhat opposed, but wouldn't block it if everyone else wanted it.
David: Same opinion as Amanieu. Not worried about performance. Bit worried about lack of pushback, could result in more requests
Mara: It seems reasonable to use FFI in a panic handler, to integrate Rust in an existing program.
David: Would like clear examples of that.
JoshT: Sounds like nobody has hard objections but the overall conclusion is 'meh', and there isn't a sufficiently compelling case for enthusiastic support.
David: We should have a higher bar for ACPs.
Mara: sgtm.
David: The bar can be low. but that bar hasn't been met. e.g. show that it requires a 2000 line kernel patch or something. or showing that their community is very opposed.
Amanieu: we would have to support this foverer. linux kernel doesn't have internal stability guarantees.
Mara: Even without FFI, i think it makes sense to use a nul terminated string here, considering paths can't contain nul. but maybe i'm a bigger fan of nul terminated strings than most rustaceans.
TC: Maybe we should hear from other people doing C/C++ interop.
JoshT: It would be good to have at least N==2 here.
Mara: Here's an example where we copy an entire string just to add a 0 byte. This is for the panic message, not the file location. https://github.com/rust-lang/rust/blob/master/library/panic_abort/src/android.rs
David: I don't know if there's a consensus in software engineering if ptr+size is 'better'.
Josh / Mara: Doesn't seem to be such a consensus. (but also no consensus for the opposite)
Josh: Also not clear that it's a win for a few C libraries to unilaterally switch if that means having to convert back and forth.
Conclusion: we need more compelling evidence (N=2 for people other than the Linux kernel wanting this, and evidence that this is sufficiently painful to work around in Linux)
Amanieu to reply
Still stuck on the 0 thing.
TC: Shame it's stuck on this. Super useful function.
Poll from last time: https://hackmd.io/@rust-libs/SJWKrCToyx#nominated-rusttf74985-Tracking-Issue-for-slicearray_chunks
TC: Maybe we just resolve this in favor of doing a runtime panic. Then when on the lang side we add a const match
feature for this, we deprecate this one and add the one we really want.
JoshT: Do we actually know of any case where someone does this on N with a runtime N!=0 check?
JoshT: Once we ship this as a runtime error, people can rely on it not being a compile time error.
David: I see the opposite as more 'two way': we can always add a warning. Almost as good, if not better, than an error.
Mara: +1. runtime check + lint
David: Yup, that's always been my preference.
Mara: we already have lints for similar cases, where we lint for things that will always panic, no?
David: The lint doesn't need to be perfect. If it catches basic cases, that's fine.
JoshT: I'd be happy, whatever is easiest to ship.
Amanieu: I don't think the compile time warning will be very useful. If the size is known in non-generic context, it doesn't add a lot of value. More likely to have bugs when you're forwarding some generic parameter. That's not something we have a warning for.
David: I agree that the lint isn't going to be super helpful. There's people interested in always improving diagnostics, but in general I don't think this is high on the list of worth putting effort in.
David: Wouldn't want to block stabilizing this.
Amanieu: So, start FCP? Current impl uses runtime panic
Amanieu to start FCP on tracking issue
Mara: If this only accepts T: Copy anyway, Cell::get() before or afterwards is basically free (and no other thread can interfere anyway), so maybe just return nothing for clarity?
David: Fine either way
Amanieu: Returning nothing sounds good. need new FCP
TC: What's the advantage of returning nothing?
Mara: Avoiding confusion. might be unclear if we're giving the new or old value back.
David: The point of .update() is to make code more obvious.
Mara to (re)start FCP.
Mara: not convinced
JoshT: not convinced either. it feels closer to match than select. select works on multiple objects.
TC: Fine with match
. From a programming theory perspective, cfg_cond
might be more correct.
JoshT: Non-lisp people might not like that.
Amanieu: How about we make everyone unhappy and call it switch
.
Conclusion: FCP for cfg_match
.
Amanieu: put it in the crate root, like the others?
Josht: Breaks some ecosystem.
Amanieu: Has the ecosystem fixed itself?
David: Should format!() and assert_eq!() be in the same module? Shouldn't format!()
be in std::fmt
?
Amanieu: don't care much about modules nowadays. mostly relevant for rustdoc.
David: We need you, Amanieu, for this one, as it needs changes in hashbrown
.
Amanieu: Let's change it as proposed here. I'm happy to make the change in hashbrown
.
David: What we need is to remove the bound on the struct. https://docs.rs/hashbrown/0.15.2/hashbrown/hash_map/struct.ExtractIf.html
Sounds good.
David to respond.
Josh: Propose skipping for now, it's a long discussion with context, let's go through a bunch of ACPs instead.
Josh to reply.
Approved. David to respond.
Agreed to close. David to respond.
Waiting on ACP author to incorporate Josh's feedback.
We agree that as_bytes
should have a T: Freeze
bound, so we'd like to approve this conditional on that.
Josh to respond with details.
(The meeting ended here.)
Generated by fully-automatic-rust-libs-team-triage-meeting-agenda-generator