Now that Firefox has switched to git as its canonical source code repository a number of us have been longing for all the nice features that Mercurial used to provide that are much more awkward with git. So many of us have been experimenting with Jujutsu which provides a lot of what is missing. It’s pretty good, I recommend giving it a go if you are also forced to use git!
But it has an annoying bug. If you’re on a case insensitive filesystem (the default on macOS and Windows) and a change renames a file in a way that only changes the case of the filename then Jujutsu gets confused. I think what’s going on is when it tries to apply the change it tells the OS to rename the file and then the OS sees that the filename is the “same” and does nothing. Subsequently Jujutsu constantly thinks there is a change because the filename on disk doesn’t exactly match what it expects and everything gets messy. The workaround is to manually rename those files to the correct names but that is annoying. I don’t know if Mozilla are particularly bad at this but the two examples in the issue are us and another just landed recently 😂.
In lieu of a fix the workaround is to move the source tree to a case sensitive filesystem. And this turns out to be fairly easy on both Windows and macOS.
On Windows
Update: I’ve since discovered that it is a really bad idea to do this for the Mozilla source or build directories, it breaks many things.
On Windows you can change the case sensitivity of a directory from a simple powershell command when running as administrator:
F:\> fsutil.exe file setCaseSensitiveInfo f:\mozilla enable
The only catch is that the directory must be empty first, but once files are moved into it they are treated case sensitively.
On macOS
On macOS the main disk is (normally) an APFS volume group and you can go to Disk Utility, add a new APFS volume and format it as case sensitive. Volumes in the group all share space so you don’t need to worry about resizing partitions or figuring out how much space you need in advance.
If you’re like me and prefer to have your code under your home directory then there is a bit of work to make the new volume mount where you want it. Run mount
to get the volume’s device (/dev/disk?s?
) then diskutil info <device>
to get the volume UUID. Then run a few commands to unmount and edit fstab
:
sudo diskutil unmount <device>
sudo EDITOR=nano vifs
Add the following line:
UUID=<UUID> /Users/dave/mozilla apfs rw -o owners
And then re-mount it, and fix the ownership:
sudo diskutil mount /dev/disk3s7
sudo diskutil enableOwnership /dev/disk3s7
sudo chown dave:staff /Users/dave/mozilla