-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postinstall
flexibility
#507
Comments
This is too much of a build system in shards. I don't think going in that direction is a good idea. Shards is a dependency resolver. Other tools are much better at building stuff. And it's really not necessary that shards switches over platform-specific instructions. You can do that as easily in a shell script or with a build tool. Shards should just get a single command to run, and - if necessary - that command can be used to take different paths depending on the environment. postinstall:
linux: ./build.sh
windows-msvc: .\build.cmd |
Is there any specific reason for not implementing this? I don't find "too much of a build system" as a valid reason here. I would understand if this were an issue to redesign Shards as a build system which has its own set of issues, but the core of this issue is just platform-specific handling for I believe this is also a major blocker for Windows adoption within the Crystal community. For a long time (and to this day) the community has been very much Linux first, with Windows support being a fairly recent addition to Crystal and even newer to the community. As a result, there has been a big initiative to get existing shards to support Windows, but many that make use of external libraries or require platform-specific configurations can't (easily) do this because of Shards' own lack of support. Some alternatives have been to execute a Crystal file in At the very bare minimum, this functionality should be implemented to further help bridge support for Windows in the community, it wouldn't make Shards any less of a dependency resolver. That's just my 2 pence on the situation though. |
Yes, something needs to change, because |
I believe Building dependencies in a portable manner is hard. Not even talking about POSIX and Windows. It's already hard enough to consider different configurations of the same operating system or distribution. The idea of I don't know any other reasonable use case for |
Then we may have to update the expectation that's been there for years that one never needs to enter the But now @straight-shoota if I understand what you're saying, this sounds like maybe users would have to meddle with the directory then. Which is OK by me if that's the message we decide to send. |
Maybe. I don't think that's a necessary conclusion. It's a possible one, for sure. All I'm saying is that I believe |
Gitter discussion provided to save time and not misquote @oprypin .
@oprypin
@didactic-drunk
@oprypin
Why my build scripts are so complicated
Attempting to improve UX (developer experience DX, is that thing?). There are 3 unix use cases. 1) Building a rpm/deb package (or personal executable) that relies on the distribution packaged libraries. 2) Building a run on any distro binary that can't rely on a system installed libsodium. 3) Same as 1 but the system libsodium is ancient and can't be used (This is very common). The build scripts check the system version (but allow overrides) and uses them by default if new enough otherwise download and build the version tested with sodium.cr. None of this is a concern for windows which never has a packaged libsodium
shards install
takes care of everything unless you want to override a value provides the best DX even if the build script is more complex. I doubt I'd have half as many users if it required: manually check your distro version. If it's >= x install else download and build it yourself.Assume you make a program using compression and encryption (not too uncommon). I'll use
zstd.cr
andsodium.cr
for this example. More than half the timezstd
andlibsodium
are too old and need to download a newer version. For windows it always requires downloading a prebuilt package. If I ask users to do this manually the friction in either building for their own use or forking to make a small improvement is too large.Not just building. Do I ask them to check
sha256
andminisign
?On windows. Click download. Find the download. Move it to the build directory. Unzip it. Rename from libsodium-1.0.18 to libsodium or have a complicated build script that attempts to use the latest version in the specified directory. If I go with a build script finding the version I may as well just download and unzip it for them and I'm back where I started.
The text was updated successfully, but these errors were encountered: