CLI: sanitize/validate uses of the bundled app name per context - #5743
Open
nicoburns wants to merge 1 commit into
Open
CLI: sanitize/validate uses of the bundled app name per context#5743nicoburns wants to merge 1 commit into
nicoburns wants to merge 1 commit into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
staging-devin-ai-integration
Bot
force-pushed
the
devin/1786027330-sanitize-app-name
branch
from
August 6, 2026 17:00
7278be5 to
4b0f30f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #5533 (its commit is included), which lets
application.namein Dioxus.toml override the bundled app name. That name flows into many contexts with different rules (file names, XML, NSIS script literals, identifiers), so this PR makes each use context-appropriate instead of interpolating the raw display name everywhere:BuildRequest::bundled_app_file_name()/BundleContext::product_file_name()always return the PascalCase crate name (pre-feat(cli): Set bundle application name from config #5533 behavior) and are now used for artifact file names and identity-bearing values, so those stay shell-friendly and stable when the display name changes:.msi/NSIS installer file names and.wxs/.wixobj/.nsiintermediatesapplication.nameno longer changes the upgrade code).ipaand.aabfile names, updater.app.tar.gzarchives, the Linux resource dircom.example.{PascalCrateName}— a display name with spaces would otherwise produce an invalid CFBundleIdentifier / Android application ID.desktopName=, the.appdirectory), but is validated once atBuildRequest::new:validate_bundled_app_namerejects empty names, leading/trailing whitespace, a trailing., control chars, and/ \ : * ? " < > |(it is used as a file name in the.appdir and Windows shortcuts). Spaces and unicode are allowed — that's the point of feat(cli): Set bundle application name from config #5533.render_templateintentionally disables Handlebars escaping (for\{{...}}path handling), so text values were injected raw:product_name,publisher,short_descriptionnow go throughxml_escape(e.g. "Tom & Jerry's" no longer produces invalid XML)copyrightandstart_menu_foldergo throughnsis_escape($→$$,"→$\").desktopgeneration now useshandlebars::no_escape— it previously HTML-escaped names into e.g.Name=Foo & Barbuild/windows.rshad its ownconfig.application.namefallback for the exe's ProductName resource; it now just callsbundled_app_name().Testing
validate_bundled_app_name,xml_escape,nsis_escapecargo fmt --check,cargo clippy -p dioxus-cli --all-features --all-targets,dx config schema(no schema changes)Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/05868b37e8e249ecbd616270007bc37a
Requested by: @nicoburns