You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The postinstall script was added to allow the compilation of external C libraries when a Shard is installed as a dependency. But, it may be used to build Crystal binaries that the library (or the project that installed the dependency) could leverage. This may happen more often when #95 is implemented.
The issue is for transitive dependencies, that is when a dependency requires other dependencies to build the executables: they must be 1. installed and 2. accessible.
Shards currently installs dependencies in no specific order —they're actually installed in the order they are found— and immediately runs the postinstall script. It's thus likely that the dependencies of a dependency won't be available when a Shard tries to build Crystal code. Furthermore, dependencies are installed inside a single lib folder, thus even though they are accessible when building the main project, they aren't made accessible when building inside the dependency (i.e. there is no lib folder inside the dependency).
Possible solutions to the availability of transitive dependencies:
install all shards and postpone the postinstall script (and executables installation) until they are all installed (basic, can fail if a shard requires a dependency binary);
sort dependencies, install them in a manner that when installing a library, it's dependencies have already been installed (complex, beware of recursive dependencies).
Possible solution to the accessibility of transitive dependencies:
manipulate the CRYSTAL_PATH environment variable when running the postinstall script, so it includes the main project's lib folder.
The text was updated successfully, but these errors were encountered:
The
postinstall
script was added to allow the compilation of external C libraries when a Shard is installed as a dependency. But, it may be used to build Crystal binaries that the library (or the project that installed the dependency) could leverage. This may happen more often when #95 is implemented.The issue is for transitive dependencies, that is when a dependency requires other dependencies to build the executables: they must be 1. installed and 2. accessible.
Shards currently installs dependencies in no specific order —they're actually installed in the order they are found— and immediately runs the
postinstall
script. It's thus likely that the dependencies of a dependency won't be available when a Shard tries to build Crystal code. Furthermore, dependencies are installed inside a singlelib
folder, thus even though they are accessible when building the main project, they aren't made accessible when building inside the dependency (i.e. there is nolib
folder inside the dependency).Possible solutions to the availability of transitive dependencies:
postinstall
script (and executables installation) until they are all installed (basic, can fail if a shard requires a dependency binary);Possible solution to the accessibility of transitive dependencies:
CRYSTAL_PATH
environment variable when running thepostinstall
script, so it includes the main project'slib
folder.The text was updated successfully, but these errors were encountered: