Skip to content

dev desktop entry: the packaged MIME types too (dev_icon test green again) - #1958

Open
schnierk wants to merge 1 commit into
storytold:mainfrom
schnierk:fix/dev-desktop-entry-mimetype
Open

schnierk wants to merge 1 commit into
storytold:mainfrom
schnierk:fix/dev-desktop-entry-mimetype

Conversation

@schnierk

Copy link
Copy Markdown
Contributor

What

dev_icon::tests::desktop_file_matches_the_packaged_fields fails on main.

69a6c4b ("packaging: Linux file managers offer FilmCraft for .fcproj projects and video files") added a MimeType= line to packaging/linux/ai.storyteller.filmcraft.desktop. The opt-in dev desktop entry that dev_icon::desktop_file_content writes still has the old field list. The test is there so the two cannot drift; it now compares them and fails.

Fix

The dev entry writes the same MimeType= line as the packaged one, in the same place. With FILMCRAFT_DEV_DESKTOP_ENTRY=1, a source build is then offered for projects and video files like the installed app, which is what the test's contract ("the entry mirrors the packaged one") says.

Tests

  • cargo test --release -p filmcraft --bin filmcraft dev_icon: 6 passed (it failed before).
  • cargo fmt --check passes.

Found while running cargo xtask ci for #1957 on Linux. Prepared with Claude Code (Opus 5.5).

🤖 Generated with Claude Code

69a6c4b added MimeType to packaging/linux/ai.storyteller.filmcraft.desktop
so file managers offer FilmCraft for projects and video files, but the
opt-in dev entry written by dev_icon kept the old field list, and
dev_icon::tests::desktop_file_matches_the_packaged_fields (which compares
the two) fails on main. The dev entry now writes the same MimeType line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is right, and it is the smallest way to fix it. packaging/linux/ai.storyteller.filmcraft.desktop on main has a MimeType= line, and dev_icon::desktop_file_content does not write it, so desktop_file_matches_the_packaged_fields fails: it compares the whole generated file with the packaged one line by line (dev_icon.rs:272-283), minus TryExec= and with Exec= replaced. I compared the added line with the packaged one and the 12 MIME types are the same, in the same order, and the line sits between Categories= and Keywords= as in the packaged file, so the exact comparison holds.

Hosted CI does not build or test filmcraft, so the failure only shows when someone runs the suite. I am leaving this as a comment, with a request for a receipt for this exact head.

This is also the PR the others should defer to. The same one-line change is carried by #2092, #2122, #2012, #1980 and #1978, and #2370 (a Linux xtask ci fix) also touches dev_icon.rs for the same failing test; #1958 is the one that does only this. Whichever lands first makes the others conflict, so the authors of those should drop the hunk. I will say so on them as I get to them.

One small point: the line is a second copy of a long MIME list, so the next change to the packaged file breaks the test again. The test is what keeps the two in step, so that is acceptable; I would not ask for more here.

Validation request (head e225371cae16e74522d43d0445c7cc02bf65e57e):

  • os: linux
  • commands: cargo fmt --all -- --check; cargo clippy --workspace --all-targets --locked --offline -- -D warnings; cargo test -p filmcraft --bin filmcraft --locked --offline dev_icon
  • expected: filtered run 6 matched, 6 passed, 0 ignored (as the PR text says, desktop_file_matches_the_packaged_fields was the failing one)
  • holds: none (clippy nonminimal_bool on main, #2007, is not caused by this PR)

This branch has not been deployed

No deployments
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