alire
alire copied to clipboard
External crates which are provided natively by a particular OS
While looking at libexpat-external.toml with a view to updating it for macOS, I found that there was no need, because it’s already provided by macOS in the SDK.
alr update says
warn: The following external dependencies are unavailable within Alire:
warn: libexpat*
warn: They should be made available in the environment by the user.
I find that if I add
--- a/index/li/libexpat/libexpat-external.toml
+++ b/index/li/libexpat/libexpat-external.toml
@@ -11,3 +11,8 @@ kind = "system"
"debian|ubuntu" = ["libexpat1-dev"]
arch = ["expat"]
msys2 = ["mingw-w64-x86_64-expat"]
+
+[[external]]
+kind = "hint"
+hint = ["native on macOS"]
alr update says
warn: The following external dependencies are unavailable within Alire:
warn: libexpat*
warn: Hint: native on macOS
warn: They should be made available in the environment by the user.
which should reduce any anxiety felt by users.
I did an experiment, and as far as I can tell alr will only output the hint if it hasn’t found a system external. Is this the case?
Yes, hints are printed if there was no other way to solve the dependency. But we have discussed their removal as we don't really use them (yours would be first?) and they complicate matters with the solver for arguable benefit.
Rather than adding a hint, you could try adding a "tool" external using some OS tool that is also always natively available. Problem this way would be that the version would not correspond with the library. Unless...
Is there some way to determine the available libexpat version? That could give me some clue on how is better to proceed.