-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add Vendored Libdbus Support #408
Conversation
Without being an expert I am just wondering how the licensing works on vendored code, especially since some parts of libdbus are gpl only licenced? Vendoring this might make it necessary to either strip all gpl Code out if possible and use the afl license or dual licence this as Apache 2 (if not using the vendoring flag) and gpl if using it. |
I'm definitely not a lawyer/expert either when it comes to license issues. Best I could find is this answer: Which makes it sound like it's not much of an issue. But your suggestion to use GPL under this feature is probably the safest option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @landhb and thanks for the PR! This seems like a big improvement in usability for the cross compilation use case and I really like that :-)
Apart from the review comments below, I think we should also add a Github CI/workflow for this so it doesn't break without anyone noticing.
@diwic No problem! 100% agreed on the testing, I left the PR in draft form since I also wanted to add this to CI/CD. I also need to make sure it builds on multiple architectures. So far I've only tested x86_64. I'll try to work through the changes + testing over the next few days. |
@KillingSpark from https://github.com/freedesktop/dbus/blob/master/COPYING "dbus is licensed to you under your choice of the Academic Free From my layman's understanding, neither the AFL (which is a BSD-style license), nor the GNU GPL, make any significant differences depending on whether you link statically or dynamically. |
I don't know about BSD but I think for GPL it matters for the thing about being derivative work? If it's linked statically your binary is a derivative work but if it's linked dynamically it could be combined with any abi compatible library. But just as you I am a layman. Just wanted to raise awareness that this might be a topic to think about :) Edit: seems like there are different opinions on this. GNU seems to think that for GPL it doesn't matter if it's static or dynamic. For LGPL the situation is more or less as described above. Others seem to think the situation is as described above regardless of GPL or LGPL being used. So... well I dunno |
This discussion is not completely the same. This pr doesn't just use libdbus as a tool while building. I'd agree that that would be fine. It is pulling in and building the code and is necessary for using the library after it is built, making it, in my non-lawyer opinion, either a combined or derivative work. Edit: just wanna make sure I don't come off too harshly, I love the idea of the PR it would definitely be valuable to have this feature! I just think we should Honor the licensing of these projects :) |
Again in layman terms: If you pick GPL for libdbus, and you pick MIT for dbus-rs, then the entire application will most likely be a GPL derivative. How we link to the libdbus code does not change this. (LGPL does make a difference between static and dynamic linking, but that does not matter here because libdbus is not licensed under LGPL, and neither is dbus-rs.) |
@diwic The |
@landhb Thanks, this is getting better and better :-) Just to understand how this is all going to work for the end user, will the dbus source end up on crates.io and downloaded with the package? Or will Edit: Found the answer myself - the build system calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I hope this is the final set of review comments. After fixing, please squash the commits into one and I believe it should be ready for merging.
@diwic So my understanding is that publishing on So if users are using the crates.io version they won't need git. But developers who are working on this repo and have cloned it will either need to do a recursive clone/checkout or let |
@landhb
Inside |
Thanks for all the review work @diwic 🎉 |
@landhb Thanks for the contribution! Nice to see some improvement in this area :-) I'll wait a few days to see if any bugs come up as a result of this PR, otherwise I'll prepare a release of libdbus-sys and dbus-rs. Sounds like a plan? |
Sounds good to me! |
@landhb I notice tons of the following warnings in the CI output, anything to worry about?
|
@diwic Looks like it's the toolchain action: actions-rs/toolchain#221 Since we aren't explicitly using set-output. Looks like dtonly has a drop in replacement now, that we can swap for: https://github.com/marketplace/actions/rustup-toolchain-install |
@landhb Released now, enjoy! |
This PR adds vendoring behind a feature flag, much like many other
sys
crates in the ecosystem.libdbus-dev-1
installed. Since it will be compiled from source.cross
without needing a custom docker image.cc
crate directly, so neithercmake
ormeson
are required for downstream users.A downstream user would simply enable the
vendored
feature:And build with cross:
The PR is currently passing the existing test suite on x86_64: