ShellCheck and meson ebuilds

15 views
Skip to first unread message

Sean Kau

unread,
Apr 25, 2023, 9:46:35 PM4/25/23
to ChromiumOS Development
I'm trying to uprev fontconfig to the latest version from upstream.  Looks like upstream switched from autotools to meson.  I have the updated ebuild working but Shellcheck doesn't recognize the functions from meson.eclass.

e.g.
    In media-libs/fontconfig/fontconfig-2.14.2.ebuild line 131:
      $(meson_native_use_feature doc)
                      ^-----------------------------^ SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).

Is there an allowlist to update somewhere?

It's also complaining about IDEPEND.


Thanks,
Sean

Bob Moragues

unread,
Apr 25, 2023, 10:04:13 PM4/25/23
to Sean Kau, ChromiumOS Development
I think they want it to look something like this: 

mapfile -t features_used < <(meson_native_use_feature doc)

"featrures_used" is a variable that fits into your code.

Hope this helps.  Paying forward a tip that I received from Jack.

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Benjamin Gordon

unread,
Apr 25, 2023, 11:09:11 PM4/25/23
to Sean Kau, ChromiumOS Development
The list of known shellcheck variables is in src/third_party/shellcheck/src/ShellCheck/Data.hs.  Feel free to send me a patch for that file if you need to add more entries, or we're about due for another pass of picking up all the recent eclass updates anyway.

For meson_native_use_feature, you can probably rewrite as "$(meson_native_use_feature doc)" if you want the output of that function to be treated as a single string.

Benjamin


--

Bob Moragues

unread,
Apr 25, 2023, 11:14:13 PM4/25/23
to Benjamin Gordon, Sean Kau, ChromiumOS Development
TBH - I would leave the upstream .ebuil essentially as is (with the shellcheck warnings).  It works and is valid.  Merges later in life will be easier.

Mike Frysinger

unread,
Apr 25, 2023, 11:45:40 PM4/25/23
to Bob Moragues, Benjamin Gordon, Sean Kau, ChromiumOS Development
send them fixes and you don't have to deviate
-mike
Reply all
Reply to author
Forward
0 new messages