Skip to content

fix: normalize icon names to lowercase in darwinBundleDocumentTypes for case-sensitive filesystems#307865

Open
Diode11-Alt wants to merge 1 commit intomicrosoft:mainfrom
Diode11-Alt:fix/case-sensitive-darwin-icons
Open

fix: normalize icon names to lowercase in darwinBundleDocumentTypes for case-sensitive filesystems#307865
Diode11-Alt wants to merge 1 commit intomicrosoft:mainfrom
Diode11-Alt:fix/case-sensitive-darwin-icons

Conversation

@Diode11-Alt
Copy link
Copy Markdown

Summary

Fixes #129665

The darwinBundleDocumentTypes (plural) function was not calling .toLowerCase() on the icon parameter when constructing the iconFile path. This is inconsistent with the singular darwinBundleDocumentType function which correctly lowercases the icon name.

Root Cause

In build/lib/electron.ts, two helper functions construct icon file paths:

  • darwinBundleDocumentType (singular) — correctly uses icon.toLowerCase():

    iconFile: 'resources/darwin/' + icon.toLowerCase() + '.icns'
  • darwinBundleDocumentTypes (plural) — was NOT lowercasing:

    iconFile: 'resources/darwin/' + icon + '.icns'  // ⚠️ Missing .toLowerCase()

Since all icon files in resources/darwin/ are lowercase (e.g., bower.icns, html.icns), this inconsistency causes builds to fail on case-sensitive filesystems (e.g., macOS APFS with case sensitivity enabled).

Fix

Added .toLowerCase() to the icon path construction in darwinBundleDocumentTypes to match the behavior of darwinBundleDocumentType:

- iconFile: 'resources/darwin/' + icon + '.icns'
+ iconFile: 'resources/darwin/' + icon.toLowerCase() + '.icns'

Testing

  • Currently, all callers of the plural function pass lowercase icon names ('c', 'config', 'html', 'default'), so this change is functionally a no-op for current usage
  • However, it prevents future breakage if an uppercase icon name is ever passed to the plural function
  • This makes the API consistent between the two helper functions

…or case-sensitive filesystems

The `darwinBundleDocumentTypes` (plural) function was not calling `.toLowerCase()` on the icon parameter when constructing the `iconFile` path, unlike the singular `darwinBundleDocumentType` function which correctly lowercases the icon name.

This inconsistency causes builds to fail on case-sensitive filesystems (e.g., macOS APFS with case sensitivity enabled) because the icon filenames in `resources/darwin/` are all lowercase.

Fixes microsoft#129665
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.

[Mac OSX 11.5] Cannot launch code after build from source on a case sensitive partition

2 participants