Skip to content
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

auto_generate_cdp comes under GPL-3.0 whereas rust-headless-chrome that uses this crate is licensed under MIT #16

Open
Subhra264 opened this issue Mar 4, 2024 · 2 comments

Comments

@Subhra264
Copy link

Subhra264 commented Mar 4, 2024

I have a deny.toml with copyleft = "deny" that simply means I can't use any dependency that is licensed under a copyleft license. So, even if I want to use headless_chrome since it is MIT licensed, the cargo-deny license checks fail, as it uses GPL licensed auto_generate_cdp for build.

As far as I know (not an expert on this, so correct me if I am wrong), GPL requires the dependent crate to also be licensed under GPL (same license condition of GPL). How is it then possible for headless_chrome to have a different license other than GPL? Is there a possibility of changing the license of this crate from GPL to something like MIT or any other non-copyleft license?

@yuhr
Copy link

yuhr commented Aug 30, 2024

@Subhra264 I noticed that rust-headless-chrome is using auto_generate_cdp as a build dependency and not embedding auto_generate_cdp itself into their code, thus the license is irrelevant (see the FAQ of GPL). Maybe cargo-deny is overdefensive here and you have to wait for EmbarkStudios/cargo-deny#563 to be implemented (or use exceptions?).

@yuhr
Copy link

yuhr commented Aug 30, 2024

Hmm, looking into the code, it seems many portions of GPL-licensed code are outputted into the generated code e.g.:

let modv = quote! {
#[allow(unused)]
#[allow(non_camel_case_types)]
#[allow(non_snake_case)]
pub mod cdp {
pub mod types {
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
pub type JsFloat = f64;
pub type JsUInt = u32;
pub type WindowId = JsUInt;
pub type CallId = JsUInt;
#[derive(Serialize, Debug)]
pub struct MethodCall<T>
where
T: Debug,
{
#[serde(rename = "method")]
method_name: &'static str,
pub id: CallId,
params: T,
}
impl<T> MethodCall<T>
where
T: Debug,
{
pub fn get_params(&self) -> &T {
&self.params
}
}
pub trait Method: Debug {
const NAME: &'static str;
type ReturnObject: serde::de::DeserializeOwned + std::fmt::Debug;
fn to_method_call(self, call_id: CallId) -> MethodCall<Self>
where
Self: std::marker::Sized,
{
MethodCall {
id: call_id,
params: self,
method_name: Self::NAME,
}
}
}
#[derive(Deserialize, Debug, Clone, PartialEq)]
#[serde(tag = "method")]
#[allow(clippy::large_enum_variant)]
pub enum Event {
#(#browser_events)*
#(#js_events)*
}
}
#(#js_mods)*
#(#browser_mods)*
}
};

This way the generated code should be considered as a derived work unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants