All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: kraghava@qti.qualcomm.com, meta-virtualization@lists.yoctoproject.org
Cc: vkraleti@qti.qualcomm.com, anujmitt@qti.qualcomm.com,
	sbanerje@qti.qualcomm.com
Subject: Re: [PATCH v2 1/2] crosvm: add recipe for ChromeOS Virtual Machine Monitor (VMM)
Date: Fri, 19 Jun 2026 20:42:35 -0700 (PDT)	[thread overview]
Message-ID: <6a360c2b.eef12218.262e9b.f8ea@mx.google.com> (raw)
In-Reply-To: <20260613060743.3120135-2-kraghava@qti.qualcomm.com>

The big one is do_filter_minijail_cargo_config. The problem is real but
the workaround feels heavier than it needs to be — and I think we can
delete the task entirely with a one-character change to SRC_URI.

What's happening today: cargo_common_do_patch_paths() walks SRC_URI for
git entries with name= set, and for each one appends a [patch.crates-io]
entry to ${CARGO_HOME}/config.toml keyed on the name= value. So name=
minijail produces

    [patch.crates-io]
    minijail = { path = "${UNPACKDIR}/git/third_party/minijail" }

But crosvm's own upstream Cargo.toml already has

    [patch.crates-io]
    minijail = { path = "./third_party/minijail" }

Two entries, same key. Cargo doesn't allow duplicate [patch.crates-io]
keys regardless of whether the paths resolve to the same directory —
so the build breaks and the sed task exists to delete the auto-injected
line.

If we rename the SRC_URI name= to anything that isn't "minijail", the
collision disappears:

    SRC_URI = " \
        git://github.com/google/crosvm.git;branch=main;protocol=https;name=crosvm \
        git://github.com/google/minijail.git;branch=main;protocol=https;name=minijail_src;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/third_party/minijail \
    "

    SRCREV_crosvm       = "..."
    SRCREV_minijail_src = "..."
    SRCREV_FORMAT       = "crosvm_minijail_src"

The unpacked source still lands at the same place on disk (destsuffix
is what controls that), so crosvm's own Cargo.toml relative-path
patch still finds it and the build consumes the source as before.
The only change is that cargo_common now writes

    minijail_src = { path = "..." }

into config.toml — an entry keyed on a crate name nothing in the
dep graph references. Cargo will emit a non-fatal warning along the
lines of

    warning: Patch `minijail_src v...` was not used in the crate graph

That warning is expected and fine — please don't try to suppress it.
It's the price of having two patch tables (upstream's and OE-core's)
both pointing at the same on-disk source from different angles, and
making them silently co-exist is better than fighting either one.

With that, the entire do_filter_minijail_cargo_config task and its
addtask line can go away. A one-line comment above the SRC_URI noting
"name= is deliberately not 'minijail' so cargo_common's auto-injected
[patch.crates-io] entry doesn't collide with crosvm's own Cargo.toml,
which already patches minijail at ./third_party/minijail" would help
the next person who looks at this.

Smaller items:

  - LIC_FILES_CHKSUM points at ${COMMON_LICENSE_DIR}/BSD-3-Clause-Clear
    rather than the LICENSE file in the cloned source. The Yocto-shipped
    template is a generic copy; an edit to upstream's LICENSE (year
    bump, contributor line) won't trip do_populate_lic the way it
    should. Better as file://LICENSE;md5=<sum-from-actual-source>.

  - Three things I asked about on v4 that I don't see addressed:

    * BBCLASSEXTEND = "native" — I'd prefer we not have it in this
      first version. Do a runqemu alternative as a separate series
      and do it then.

    * DEPENDS includes wayland/wayland-native/wayland-protocols
      unconditionally. Is crosvm always built with the GPU/display
      feature on here? If those feature-bits can be disabled, please
      consider a PACKAGECONFIG so wayland is only pulled in when the
      display path is actually wanted. Acceptable to defer for now,
      but please call it out as a follow-up.

    * 966 pinned crates and a single BSD-3-Clause-Clear LICENSE
      declaration — there is almost certainly licence variation in
      that set. This isn't unique to crosvm (other recipes in the
      layer are guilty too and I'm working through them), so it
      isn't blocking, but please file/track it as a follow-up.

Bruce


  reply	other threads:[~2026-06-20  3:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13  6:07 [PATCH v2 0/2] Add crosvm recipe to meta-virtualization Keerthivasan Raghavan
2026-06-13  6:07 ` [PATCH v2 1/2] crosvm: add recipe for ChromeOS Virtual Machine Monitor (VMM) Keerthivasan Raghavan
2026-06-20  3:42   ` Bruce Ashfield [this message]
2026-06-13  6:07 ` [PATCH v2 2/2] crosvm-image-minimal: add a reference image for crosvm demo Keerthivasan Raghavan
2026-06-20  3:42   ` Bruce Ashfield
2026-06-20  3:42 ` [PATCH v2 0/2] Add crosvm recipe to meta-virtualization Bruce Ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a360c2b.eef12218.262e9b.f8ea@mx.google.com \
    --to=bruce.ashfield@gmail.com \
    --cc=anujmitt@qti.qualcomm.com \
    --cc=kraghava@qti.qualcomm.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=sbanerje@qti.qualcomm.com \
    --cc=vkraleti@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.