Skip to content

Add docs and spread task for updating Mir's Wayland Explorer entry#4784

Draft
Copilot wants to merge 11 commits intofeature/wayland-explorer-how-tofrom
copilot/sub-pr-4783
Draft

Add docs and spread task for updating Mir's Wayland Explorer entry#4784
Copilot wants to merge 11 commits intofeature/wayland-explorer-how-tofrom
copilot/sub-pr-4783

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

Adds contributor documentation and CI automation for keeping Mir's entry on Wayland Explorer up to date.

What's new?

  • doc/sphinx/contributing/how-to/how-to-update-wayland-explorer.md: Step-by-step guide for regenerating mir.json using wlprobe + miral-app --add-wayland-extension=all
  • doc/sphinx/contributing/how-to/index.md: Links to the new guide
  • spread.yaml: Added WLPROBE environment variable (false by default, true only for the plain ubuntu variant) to gate the wlprobe workflow
  • spread/sbuild/task.yaml: Automates the wlprobe workflow in CI — installs wlprobe via cargo install wlprobe and inotify-tools, installs stub graphics/input and egl rendering platform packages directly from the locally-built sbuild .deb files (e.g. ${SPREAD_PATH}/../mir-demos_*.deb), reads the Mir version from CMakeLists.txt, runs miral-app headlessly, waits for the Wayland socket using inotifywait (with a fallback socket existence check to handle the race between inotify timeout and socket creation), and generates a fresh mir.json. The generated mir.json is written to the task directory and registered under artifacts so it can be collected with spread -artifacts.
  • .github/workflows/spread.yml: Adds an Upload Wayland Explorer JSON step that uploads mir.json as a GitHub Actions artifact when the ubuntu variant runs.

How to test

Run the spread task:

spread lxd:ubuntu-24.04:spread/sbuild:ubuntu

The wlprobe step will run only for the ubuntu variant and upload mir.json as a GitHub Actions artifact.

To collect the artifact locally via spread:

spread -artifacts=./artifacts lxd:ubuntu-24.04:spread/sbuild:ubuntu

The resulting mir.json will be available under ./artifacts/.

For the manual flow, follow the steps in the new how-to guide.

Checklist

  • Tests added and pass
  • Adequate documentation added
  • (optional) Added Screenshots or videos

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Copilot AI changed the title [WIP] Add docs describing how to update Mir's supported protocols on Wayland Explorer Add docs and spread task for updating Mir's Wayland Explorer entry Mar 19, 2026
Copilot AI requested a review from Saviq March 19, 2026 15:08
Copy link
Contributor

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

@copilot add a spread variable that's only true on the ubuntu variant, and key that new functionality off that.

Use spread's artifacts feature: https://github.com/canonical/spread?tab=readme-ov-file#artifacts to collect the JSON and upload it as an artefact, if produced.

@Saviq
Copy link
Contributor

Saviq commented Mar 19, 2026

@copilot don't install mir-demos from the archive, install the packages produced by sbuild in ../.

You also don't need to clone wlprobe, install it with cargo install wlprobe instead.

You don't need the virtual platform if you only install the stub graphics and input platforms, along with the egl rendering platform.

….json

Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot add a spread variable that's only true on the ubuntu variant, and key that new functionality off that.

Use spread's artifacts feature: https://github.com/canonical/spread?tab=readme-ov-fil...

Done in bec1427.

  • Added WAYLAND_EXPLORER: false / WAYLAND_EXPLORER/ubuntu: true to spread.yaml — the variable is true only for the plain ubuntu variant.
  • Moved the wlprobe section out of the SPREAD_VARIANT == "ubuntu" shell check into its own top-level if [ "${WAYLAND_EXPLORER}" = "true" ]; then block keyed off the new variable.
  • Changed the output path from /tmp/mir.json to $SPREAD_PATH/$SPREAD_TASK/mir.json (task-relative).
  • Added artifacts: [mir.json] to spread/sbuild/task.yaml so the JSON is collected when spread is run with -artifacts.

Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot don't install mir-demos from the archive, install the packages produced by sbuild in ../.

You also don't need to clone wlprobe, install it with `cargo install wlpro...

Done in 19d5363.

  • mir-demos, mir-platform-graphics-stub23, mir-platform-input-stub10, and mir-platform-rendering-egl-generic are now installed via apt-get — they come from the local sbuild archive already set up by the ubuntu-variant block.
  • Replaced the git clone + cargo install --path approach with cargo install wlprobe (from crates.io), with $HOME/.cargo/bin added to PATH for the heredoc subshell.
  • Removed MIR_SERVER_PLATFORM_DISPLAY_LIBS=mir:virtual and MIR_SERVER_VIRTUAL_OUTPUT=800x600 — not needed with the stub graphics/input + egl rendering platforms.

@Saviq
Copy link
Contributor

Saviq commented Mar 19, 2026

@copilot use upload-artifact to store the JSON, and drop the diff as that's not visible in a successful spread run

Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot use upload-artifact to store the JSON, and drop the diff as that's not visible in a successful spread run

Done in 4f9d65b.

  • Added an Upload Wayland Explorer JSON step to .github/workflows/spread.yml using actions/upload-artifact@v4, conditional on endsWith(matrix['spread-task'], ':ubuntu').
  • Removed the diff line and the git clone wayland-explorer from spread/sbuild/task.yaml (the clone was only needed for the diff).

@Saviq Saviq force-pushed the copilot/sub-pr-4783 branch from d779694 to 052c728 Compare March 19, 2026 16:05
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Copilot AI requested a review from Saviq March 19, 2026 16:11

cargo install wlprobe

MIR_VERSION=$(dpkg-query -W -f='${Version}' libmiral-dev | sed 's/-.*//')
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot read this from CMakeLists.txt instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in af489f5. MIR_VERSION is now read from CMakeLists.txt:

MIR_VERSION=$(sed -n 's/.*VERSION \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' "$SPREAD_PATH/CMakeLists.txt" | head -1)

Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
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.

2 participants