Skip to content

Allow creation of empty .cmxa files on macOS (PR#6550)#1094

Merged
damiendoligez merged 1 commit intoocaml:trunkfrom
mshinwell:pr6550
Mar 13, 2017
Merged

Allow creation of empty .cmxa files on macOS (PR#6550)#1094
damiendoligez merged 1 commit intoocaml:trunkfrom
mshinwell:pr6550

Conversation

@mshinwell
Copy link
Contributor

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.

@mshinwell mshinwell added the bug label Mar 10, 2017
@damiendoligez
Copy link
Member

Looks good. I'll merge and cherry-pick to 4.05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants