-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Factor out rustc_apfloat into a standalone crate #55993
Comments
cc @rust-lang/compiler |
Also, I think we need to figure out copyright. I remember talking to a few people about it and our licensing setup deals with LLVM, but I'm not sure about a crate in isolation. |
What's there about copyright to figure out? The copyright header of that LLVM file implies it's licensed under the Illinois Open Source License, which is an FSF- and OSI-approved permissive license. Surely the Rust translation should be licensed as the same, unless somebody has a good reason for wanting to change it? |
@bstrie |
Ah, I see. I'm also not a lawyer, but I'm fairly confident that it isn't compliant with the license for us to create a derivative work of apfloat that doesn't use the Illinois license, at least not without explicit permission of the copyright holder. Those license headers claiming that rustc_apfloat is MIT/Apache seem somewhat dubious. On the one hand I want to say that we should just change the license headers to be compliant (under this interpretation this doesn't count as relicensing, since we didn't have permission to use a different license in the first place); shipping more Illinois-licensed code when we already ship all of LLVM isn't a problem. However--and here's the thing you might really need a lawyer for--if there's anyone who's contributed to rustc_apfloat while it's been erroneously licensed, I have absolutely no idea what license their contributions are actually licensed under. The conservative response would be to reach out to anyone who's ever contributed to it and ask them if they're okay with their contributions being licensed as Illinois. |
@bstrie Wasn't it decided that we can just remove copyright headers? |
Looking at https://github.com/rust-lang/rust/commits/master/src/librustc_apfloat, it's mostly sweeping changes across the the codebase, with only a few Some of the more specific ones, like fixing comments, need to be upstreamed to LLVM as well, IMO. |
Note to self: write an email to Mozilla legal about this situation. |
Oops, this really slipped through the cracks. I remembered about it at the All-Hands in Berlin (back in February IIRC), but forgot about it again. Also, this is now completed: https://llvm.org/foundation/relicensing/ - LLVM moved to the Apache2 license. |
Once we move this out of tree we might want to have (as per #63416 (comment)):
This would even allow upstreaming some of the changes to LLVM, but at our own pace. |
However, in this thread here it sounds like things are fine as LLVM moved to Apache2 licensing. Are there further licensing issues not yet mentioned in this thread? |
Not a lawyer but these are a few open problems/questions I would have:
|
At least we can split out the modifications somewhat, I'm more interested in the original port.
All I know is people more qualified than me are going to look into it (or are already doing that). I haven't heard anything to suggest it's solved, though. |
The current situation where people seem too afraid to approve changes to rustc-apfloat seems untenable. Instead of not approving any changes, get approval from the people submitting changes that they consent to having their changes optionally released under some set of licenses that you come up (say, Illinois, MIT, Apache 2). |
Similar to @bstrie's suggestion. Can we change the rustbot comment to something like "You agree that the license of your contributions to |
Cc #96784 which also mentions apfloat licensing |
It's been a while (my bad) since potential solutions were discussed, but I come bearing good news. With @pnkfelix and @wesleywiser coordinating things and also e.g. painstakingly verifying the licensing side (unsurprisingly, LLVM's colossal relicensing effort didn't go perfectly smooth - I'm very grateful they're handling those aspects, so that we'll never end up again, hopefully), I finally managed to find some time to execute on the plan we discussed late last year: start fresh all the way back from the original port. My main focus this time was correctness: we kept stumbling onto bugs, and, personally, I don't think This is a library of 100% pure integer math, there are better ways. Here's a rundown of the notable commits from the WIP
|
Small update regarding the port advancing PR: Specifically, these new commits are significant:
At this point, all previously-known
|
Both
I've also tried to describe as much I could in the README. Next steps are probably to perf+crater switching to the new version, and releasing on crates.io if everything goes well (ideally fully replacing the old |
librustc_apfloat is a Rust translation of LLVM's APFloat library, written in C++, and provides software implementations of
f32
,f64
, and other floating-point types, which are useful for performing host-independent floating-point computation. We made a standalone crate of this for use in Cranelift, however other compiler projects could make use of such a library as well, and in general it'd be good to have only one copy of this code.Where's the best place for the code live?
What should the crate be called?
rustc_apfloat
-- the current name. "apfloat" isn't very descriptive, except that it's the name of the upstream code this crate is based on. And the crate isn't specific to rustc :-).software_float
-- a more descriptive name, and not yet claimed on crates.iocc @eddyb @lachlansneff
The text was updated successfully, but these errors were encountered: