From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 243CD39E176 for ; Thu, 5 Mar 2026 12:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772713660; cv=none; b=qOvQMguF6p68krIMpod9dqZ9pTIWKEIRV8zA/JbLptxQiG53YuhAOsHR9Q33dRdqFYp9LkYjYYqSGtErtK+B0sgFXx0ChyQQS7Lev7L73Yko72C54S/dLJUVKV1P1aw77ttDEIZ82s4TiqP1NU5It8pOzAf17eJ9wVwMsF11Ivo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772713660; c=relaxed/simple; bh=vSFxoSamHOgqgycN5FV6H8qcnNORRtZLiI0fLgGU90s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eKGyFXPM6B1ZL6hjRHwajVCMQRIpeZG3p0W9Z4BFCEEWv0WedDQXCx4aQbv3qbi9MUrroCyQ6KTU0q5Q30nnfz8tgh2Lg7FFlK/uaqdg8lXn3icj+hfwMeAPstAE9cfI04O/RkIdCzM4138xbbwcjQN0f4M40e3b8pvEM/Lc/TI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=34WjHYz9; arc=none smtp.client-ip=209.85.208.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="34WjHYz9" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-65bf356457aso9537887a12.2 for ; Thu, 05 Mar 2026 04:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772713655; x=1773318455; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=vSFxoSamHOgqgycN5FV6H8qcnNORRtZLiI0fLgGU90s=; b=34WjHYz9uJvJgc3j9YbYqMQtNu6uRFYZJiHBxdRRDtb/ii/Eg+NOHCgvTVkw2/X+LX D/wDTACrXeNb8VspqSD5PuiuHmsIU825KbXOGrSfLkSAMuj+8+o7JaxhhEauDUI706AW AhqZX/kMs6ztUJ0cLrkyJewjRgY2ElwRsDBWK1Te9WtNWq5KB5XXU26fqM0RmoiBZ0L/ gzKU069VHLH+jHu581b53zpbWkh78UbNW9dA4IRQFu4uoSEtsfbGgtrWE761Py/gJKcH zQcKu7unZh8LD/aduMj2IIXnOn0e4mVIStvzASeMPAgPAJ1MkS+x7MU+tOcFpq47DIzY v8mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772713655; x=1773318455; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=vSFxoSamHOgqgycN5FV6H8qcnNORRtZLiI0fLgGU90s=; b=bQG/wHwwKcDsFikFlHTs1OiJCXT0lK64TaAtZxE2Q/lStZwvyshE4/zXz1aAG/vOSQ vS/rjZ7kYCbQi8xQ7Q/t4Z2CQ34S045UlXIQSe+d8g/8rp54iIkKK3mXpUd5n9QEubJ7 Q26grIzAlhBH4BhmppCttTHmXL/r14Z0/z4LyLigcbDf4fTOJdqgQddBVH1/cMMAHErZ BXeMapCjDrqC5s+WcBddp8f9NYGnyc1vCLsXRSGiM9MOm3t/FIoj1t89XRaofzBIWV+i Hz/j4K40VAfr9sM4ny8UV2+LbufH44WfLuyno24df9ArN8NQqNksVIcOPALVt6tVEIEI 4mwQ== X-Forwarded-Encrypted: i=1; AJvYcCV0XNxjSNcmxv85W5wSBoMbFaeWKX90FVpZp9SCJYd6IeUWhvqOPGg+GioCwoixp1V6JSkvfBvxnie59GA=@vger.kernel.org X-Gm-Message-State: AOJu0YxhK8RdHw/zBroCSHhhvSaamXWJWw1gxWYJ0NddarWBOAaa4RQr A8rrqQkWMHaPNlr/GuvlQq84qt9nycLHASPsOCGt2eNMOzQNQ1VkXGuRMqXYLD0AFkOHp5lFJB1 afrXcVYIs2c7Ot64MZQ== X-Received: from eddp24.prod.google.com ([2002:a05:6402:46d8:b0:660:bf79:1ded]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:278e:b0:660:b590:f4c7 with SMTP id 4fb4d7f45d1cf-660efb9495fmr3204846a12.4.1772713655280; Thu, 05 Mar 2026 04:27:35 -0800 (PST) Date: Thu, 5 Mar 2026 12:27:34 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260224-binder-crate-name-v1-0-7dfc1289abbd@google.com> Message-ID: Subject: Re: [PATCH 0/2] Change Rust Binder crate name to rust_binder From: Alice Ryhl To: Gary Guo Cc: Miguel Ojeda , Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Boqun Feng , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Tamir Duberstein , Jesung Yang , Greg Kroah-Hartman , Carlos Llamas , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 05, 2026 at 12:17:52PM +0000, Gary Guo wrote: > On Thu Mar 5, 2026 at 10:49 AM GMT, Alice Ryhl wrote: > > On Tue, Feb 24, 2026 at 03:17:16PM +0000, Alice Ryhl wrote: > >> On Tue, Feb 24, 2026 at 02:24:59PM +0100, Miguel Ojeda wrote: > >> > On Tue, Feb 24, 2026 at 10:38=E2=80=AFAM Alice Ryhl wrote: > >> > > > >> > > Currently the crate name of the Rust Binder driver is rust_binder_= main, > >> > > but I'd like it to be called rust_binder instead. This affects e.g= . > >> > > symbol names in stack traces. > >> >=20 > >> > We discussed allowing to customize crate names years ago, at least f= or > >> > dashes vs. underscores, for matching C names more closely and perhap= s > >> > other needs. > >> >=20 > >> > Back then, we decided to keep things simple to avoid confusion (i.e.= a > >> > single identifier used everywhere the same way is simpler, at least > >> > for humans) and to avoid having to deal with those dual names > >> > everywhere (e.g. adding workarounds for rust-analyzer here). > >> >=20 > >> > I talked with Alice about what she needed here -- could we rename th= at > >> > source file to just something like `binder`? That would avoid the ne= ed > >> > to have a custom name, so everything would still match (symbols, > >> > source file, object file...), and it would give you even shorter > >> > names. > >>=20 > >> Sure just renaming rust_binder_main.rs to binder.rs would work too. > > > > I realized that there's a much simpler way to allow crates to rename > > themselves: do not pass the --crate-name argument at all. > > > > Because if you do not pass this argument, then rustc will use the > > name of the .rs file as the crate name by default, *but* if the crate > > contains #![crate_name =3D "..."], then that will be used instead. > > > > Do you still want to enforce that the crate name always matches the > > file name? It seems unfortunate that it's currently impossible to creat= e > > a Rust module where the .ko file and crate name is the same, unless no > > extra object files are linked into the module. >=20 > I think previously a fixed crate name is load-bearing because we need rus= tc to > emit outputs to a fixed location. >=20 > This shouldn't be needed after commit 295d8398c67e ("kbuild: specify outp= ut > names separately for each emission type from rustc"), so if nothing break= s with > `--crate-name` removed, then I think it makes sense to drop it to allow c= ustom > rustflags to override them. Are you sure? I know this commit shows up in blame, but it just adds a backslash to the --crate-name argument. I do not believe that omitting --crate-name changes anything in cases where the crate name already matches the file name. Alice