Dependencies for artifacts

I met something like

ERROR: LoadError: InitError: could not load library "${USER}\.julia\artifacts\${SHA}\bin\libiomp5md.dll"
The specified module could not be found. 

But the file is just there. Strangely, another PC is fine.

After some digging, I find the actual reason. libiomp5md need C:\WINDOWS\system32\VCRUNTIME140.dll as its dependency, which is missing in one of my PCs.

Such problems are annoying, there might be two ways to handle this.

One is to have more clear error message for such failure. Sadly, it seems impossible, because dlopen will directly call C function jl_load_dynamic_library, and there might be no way to know about the real cause.

Another is to prevent such problems from the beginning. It seems that VCRUNTIME140 are part of Microsoft Visual C++ 2015 Redistributable or something similar, which is one of the so-so-many run-time library-collections MS offers.
If I understand it correctly, such dependencies are related to the environment in which the artifact is compiled. To make it clear, they are related to what run-time library-collections you use when compiling.

If we can decide a common Windows environment where every Julia artifact works, something like manylinux in python community, then users only need to make sure their PC have the required dependencies to be sure that everything works.
I know that such run-time libraries are in a total mess in the whole Windows ecosystem, but maybe we the Julia community can do something on our own?

The recommended way to build artifacts is to use BinaryBuilder, which cross-compiles between platforms and doesn’t involve any VC runtimes on Windows.

Some artifacts are, however, just repackaged from other builds, possibly because they are a real pain to build from source. In this specific case it’s imported from anaconda.

So, yes, for the most part something own is being done and the rest is difficult to control.