Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow creation of empty .cmxa files on macOS (PR#6550) #1094
In the event that a user attempts to create an empty .cmxa file on macOS, the "ar" utility fails with an error, complaining about trying to create an empty .a file. Fixing this is useful since it provides consistent cross-platform behaviour and less opportunity for special cases in users' build systems (for example if the presence of archive members is conditional).
I tried to make this atomic by creating a temporary file first, but lo and behold, the "ar" utility has an error for that too: you can't run "ar rc" if the file already exists and isn't a valid archive as far as I can tell. So this isn't atomic, but it's not really any worse than the existing two-step ar/ranlib process.