Allow creation of empty .cmxa files on macOS (PR#6550)#1094
Merged
damiendoligez merged 1 commit intoocaml:trunkfrom Mar 13, 2017
Merged
Allow creation of empty .cmxa files on macOS (PR#6550)#1094damiendoligez merged 1 commit intoocaml:trunkfrom
damiendoligez merged 1 commit intoocaml:trunkfrom
Conversation
Member
|
Looks good. I'll merge and cherry-pick to 4.05. |
stedolan
pushed a commit
to stedolan/ocaml
that referenced
this pull request
Mar 21, 2023
…rt part of ocaml/PR11198) (ocaml#1094) Port part of ocaml#11198
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
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.
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.