Skip to content

Conversation

@lumag
Copy link
Contributor

@lumag lumag commented Jun 12, 2025

In order to evaluate upstream Mesa on the RB1 board, package the snapshot of the Mesa development tree. This package will go away once Mesa 25.2 gets released and enters Debian experimental or unstable.

@lool
Copy link
Contributor

lool commented Jun 12, 2025

I gave this a cursory read to review the general approach, and it's as we discussed. I'm not super happy that we duplicate packaging in this repo and that we allow for calling random scripts, but that works in the short-term.

@basak-qcom Would you be able to do a full review? Or I can do one on Monday

@github-actions
Copy link

github-actions bot commented Jun 12, 2025

Test Results

 2 files  ±0   4 suites  ±0   6m 20s ⏱️ +23s
15 tests ±0  15 ✅ ±0  0 💤 ±0  0 ❌ ±0 
38 runs  ±0  38 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ba0c2a3. ± Comparison against base commit ca08110.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

Test jobs for commit e5f2734

@github-actions
Copy link

Test jobs for commit 7ea28c1

Copy link
Contributor

@basak-qcom basak-qcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Comment only] Ideally we'd have a better mechanism to do all of this, such as packaging repositories in git that can derive from upstream and Debian packaging commits. But in the meantime to make progress we already have overlay-debs debdiffs as a compromise. Adding a generic script mechanism seems like a clean way of approaching this. Even though it's more creep towards the less ideal, I can't think of a better general approach.

[No change needed] We have a service dependency on gitlab.freedesktop.org being introduced here, whereas before we depended on Debian apt archives only I think. Again, given this is a stop-gap solution, I guess that's OK. Perhaps we should start noting these somewhere though.

[For discussion before landing] The debian/ directory and packaging inside gives me some concern. It's being copied from Debian experimental I think, and then being modified? Since our goal is to minimise any "delta" to upstream over time, ideally we'd store the diff rather than a copy. Notably this approach is the one we take with the overlay-debs debdiff mechanism, which is what this is building upon. I wouldn't do that for the entire upstream snapshot, but perhaps we can do that for the packaging, supplying a debdiff to apply over the source package once it has been constructed from the upstream git commit and the debian directory from Debian experimental? Otherwise, it took me some effort to fetch and generate a diff against Debian experimental to review, and then I'm finding it difficult to understand why you've changed some aspects of the packaging against Debian experimental. For someone else to understand that is key to allowing that difference to be eliminated in the future. What do you think about storing a diff against experimental instead, and then generating that dynamically as part of the script?

[Changes requested] Please could you link directly to the upstream PRs or commits that you are cherry-picking from the patch files themselves? For example there's dep3 which describes what metadata should go into a patch in debian/patches. In this case of squashing multiple commits together, I think that's fine in which case maybe just dump the headers at the top? I don't know of any tool that reads these; it's just really useful when rebasing in the future, so I'd like to make it a standard that the information is available. I think this should be in the source tree itself rather than just in commits.

@lumag
Copy link
Contributor Author

lumag commented Jun 17, 2025

@lool @basak-qcom reworked the PR

Corresponding packages were uploaded to OBS

@github-actions
Copy link

Test jobs for commit 53e17b8

Copy link
Contributor

@lool lool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for implementing this, and sorry for the delay in reviewing on my side; I've left mostly minor comments but please could you:

  • change the Debian revision to 0qcom1
  • add some notes on how you created the debdiff, either in the commit message or in debian/changelog inside the debdiff
  • pass this new script through the shellcheck workflow (.github/workflows/static-checks.yml only runs against ci/*.sh).

Thanks!

@basak-qcom
Copy link
Contributor

basak-qcom commented Jun 20, 2025

I like the overall mechanism now - thanks! It's quite clean given the compromise we're already making - still based on a Debian dsc from the Debian snapshot archive, and the script doing the quite minimal upstream snapshot extraction before the debdiff is applied afterwards as normal for the packaging changes.

Next I looked at the packaging changes themselves. Here's a summary of all the changes I see to packaging against the base Debian 25.1.0-1 package:

  • Revert to LLVM 19 (LLVM 20 is not in trixie so this makes sense)
  • Build against librust-rustc-hash-2-dev, not librust-rustc-hash-dev (although both are in trixie?)
  • Drop packages
    • libxatracker2
    • libxatracker-dev
    • libd3dadapter9-mesa
    • libd3dadapter9-mesa-dev
  • Update libegl-mesa0.symbols with three new symbols
  • mesa-opencl-icd.install: drop some files
  • debian/patches/35316.patch: new patch ("freedreno: Add sampling support for RGB/BGR 24-bit component texture formats")
  • debian/patches/etnaviv-add-support-for-texelfetch.patch: drop (but it doesn't reverse-apply to this snapshot cleanly)
  • debian/patches/path_max.diff: tweak
  • debian/rules: various tweaks
  • debian/control regenerated from debian/control.in

With my Ubuntu background, I'm used to maintaining a delta against an upstream distribution, including upstream snapshots. In that context, there are usually a couple of concerns driven by the desire to converge back with upstream in the future:

  1. When it comes time to drop the delta, will this cause an unwanted change in user behaviour?
  2. When rebasing our delta onto a newer upstream version (because we can't or don't want to drop the delta yet), is each part of the delta appropriate to keep, does it need adjusting, or can we drop it without causing an unwanted change in user behaviour?

For this reason my default expectation is that the delta should be minimal and the reason for each part of the delta existing should be obvious or explained. In Ubuntu we have largely moved to using git to maintain the delta directly, so each part is a commit with an explanation. Here, with everything being squashed into the single debdiff, we don't have that ability yet, unfortunately. Nevertheless I can still apply my usual expectations, consider the debdiff and try to understand why each part is there.

How does my default expectation from Ubuntu map to this project? I'm not sure yet! With our "upstream first" philosophy, I think we are agreed that the delta needs to be kept at a minimum. I think the depth we need to spend on the details of the delta itself depends on what user stories we need to support with this package, together with our expectations on how long we will need to maintain this delta for. Is it possible that a mesa snapshot delta isn't short-lived because of another requirement that comes along in the future before the current requirement is upstreamed, for example?

Before we used git in Ubuntu, our convention was to explain the delta in debian/changelog including upon every rebase, and we still do that today. Since we can't use git, perhaps we could do the same here? For example:

mesa (25.2~2640-g8d13fc447e3-0qcom1) trixie; urgency=medium

  [ Dmitry Baryshkov ]
  * New upstream snapshot to evaluate upstream Mesa on the RB1 board. 
  * Backport to trixie:
    - Revert to building with LLVM 19 since 20 is not in trixie.
    - Drop packages: libxatracker2, libxatracker-dev,
      libd3dadapter9-mesa, libd3dadapter9-mesa-dev.
    - Build against librust-rustc-hash-2-dev, not librust-rustc-hash-dev
      [both are in trixie?].
    - Update libegl-mesa0.symbols.
    - d/mesa-opencl-icd.install: drop some files [does it fail to build without this?].
    - d/p/35316.patch: freedreno: Add sampling support for RGB/BGR
      24-bit component texture formats.
    - d/p/etnaviv-add-support-for-texelfetch.patch: drop [although it doesn't reverse apply exactly?]
    - debian/patches/path_max.diff: [tweak].
    - debian/rules: [tweak; multiple hunks here and the reasons for most aren't clear to me].
    - debian/control regenerated from debian/control.in.

 -- Robie Basak <[email protected]>  Fri, 20 Jun 2025 13:06:04 +0100

I've tweaked the version string to include qcom1 as Loic requested, and also tried to select something that should work for future updates smoothly.

Proposed next steps:

  1. I'm open to taking a different approach, or in less detail, if that seems appropriate.
  2. Otherwise, please could I have some help in explaining why we're making these changes to packaging by adjusting my changelog example above, replacing my lack of understanding annotated in the square brackets?

With help as above, I'd be happy to take over driving this to getting it landed if you like.

@lumag
Copy link
Contributor Author

lumag commented Jun 20, 2025

@basak-qcom too many words for a package that is going to be obsoleted in July or August. Could you please make your comments easier to comprehend?

@github-actions
Copy link

Test jobs for commit ca86dfe

@github-actions
Copy link

Test jobs for commit ba0c2a3

@basak-qcom
Copy link
Contributor

@lumag I pushed 76162c8 directly to your branch to fix some shellcheck warnings. I'm confident that's unobjectionable. I trust that's appropriate process/etiquette here?

Three more changes to come: one remaining shellcheck issue, I'll add a README, and I'll rebase onto main in order to pick up the shellcheck CI changes. Please let me know if I should do this differently.

Copy link
Contributor

@basak-qcom basak-qcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to talk about CI and lint tools.

The culture I think we need to be heading towards is:

  1. Use linting in CI to give immediate contributor feedback and achieve a baseline of quality, both for our repositories and to set an example across the company.
  2. Lint tools are indeed dumb. They will make us do things that aren't necessary. That's the cost of achieving the previous point, but the benefit is worth the cost.
  3. When the lint tool is wrong, a simple override should be enough, using whatever mechanism the lint tooling provides. Best practice is to explain how the lint tool is wrong in a comment, to avoid suppressing the lint tooling when not appropriate ensuring that this can be reviewed effectively.
  4. If the linter is wrong, just override it and move on. I don't think it's worth the effort of trying to figure out how to work around the linter so that it won't alert.
  5. Fixing the linter is out of scope. Perfect is the enemy of the good. We have better uses for our time. Just using the linter gives us enough bang for the buck.
  6. This does mean apparently unnecessary noise, but the general best practice I'm used to is that it's worth the cost.

I'm surprised to see this being nitpicked here, and indeed this isn't something that's worth debating in a PR. The above should just be in a documented best practice document so that we do not endlessly debate this in PRs.

@lumag
Copy link
Contributor Author

lumag commented Jun 27, 2025

@basak-qcom No, no and no. If linters require changing the source code, then those linters should go to /dev/null. I don't want to worry about adding extra comments to make the tool happy. The tools must be helping us, not the other way around. If's fine to provide a config file for the tool or a set of args in the makefile (like we do for -Wsomething for cc), but having to add comments to C source file doesn't make sense.

@basak
Copy link

basak commented Jun 27, 2025

The linter was already there. I just fixed it to scan the script you're adding here, rather than just scripts/*, as requested, and that has landed now.

If you want to change how we do linting as a project, then presumably that's a general policy question and an issue for a different PR. If you refuse to add a lint override to the script you're adding here, then this PR is blocked on that.

lumag and others added 5 commits June 29, 2025 19:27
In order to build upstream mesa snapshot we need to manually prepare
source directory. Add support for using the external script instead of
just fetching the dsc from Debian.

Signed-off-by: Dmitry Baryshkov <[email protected]>
In order to evaluate upstream Mesa on the RB1 board, package the
snapshot of the Mesa development tree. This package will go away once
Mesa 25.2 gets released and enters Debian experimental or unstable.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Import patchset from Mesa MR 35316, implementing 24-bit texture formats
support.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Opt-in and use the gallium-rusticl-enable-drivers in order to enable
RustiCL drivers which can be enabled by default: asahi, freedreno and
radeonsi. The rest of the drivers still need an explicit RUSTICL_ENABLE
environment variable.

Signed-off-by: Dmitry Baryshkov <[email protected]>
DSC_FILE is guaranteed to be defined as part of the call API from
build-deb.py here.

Signed-off-by: Robie Basak <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
@lumag lumag deleted the mesa branch June 29, 2025 18:02
@lumag lumag reopened this Jun 29, 2025
Ignore the "Double quote to prevent globbing and word splitting" error
from shellcheck. Script authors should have knowledge whether the
variable can contain spaces or shell glob symbols or not.

Signed-off-by: Dmitry Baryshkov <[email protected]>
@lool
Copy link
Contributor

lool commented Jun 30, 2025

I went through all the requested changes and saw that the latest pull request was addressing all, so closed them and will merge; thanks!

@lool
Copy link
Contributor

lool commented Jun 30, 2025

(NB: build failure is unrelated to this PR / repo and is being fixed in a separate PR.)

@lool lool merged commit ab891f5 into qualcomm-linux:main Jun 30, 2025
7 of 8 checks passed
@lool
Copy link
Contributor

lool commented Jun 30, 2025

@lumag I kicked a build, but it failed due to git not being installed:
https://github.com/qualcomm-linux/qcom-deb-images/actions/runs/15966677844/job/45028450825

I'd suggest either adding a sudo apt install git to the shell script, or to add an entry in the yaml with list of dependencies to install prior to running the script.

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

Successfully merging this pull request may close these issues.

4 participants