-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Precompiled diesel_cli binaries for major operating systems #2379
Comments
In theory this it should be possible to build binaries for all major operation systems. As this should be as easy as possible for us maintains I would like to have this as part of our CI workflow. https://github.com/rust-analyzer/rust-analyzer/blob/master/.github/workflows/release.yaml As we are planing to migrate our CI to github actions anyway sometime soon this should probably be integrated into #2269. rust-anaylzer is already doing something like this for their release process, so maybe some parts from there could be reused? At least I personally do not have currently the bandwidth to work on that, so if someone wants to do that feel free to submit a corresponding PR integrating that with our current CI. Open questions that needs to be answered:
|
The way Diesel define migration in pure SQL statements makes source control of DB schema extremely easy to deploy. One just need to check out SQL files, have the Diesel CLI binary, execute migrations. However, having to compile Diesel CLI for every system in which it needs to run is a dealbreaker. (forgive my ignorance) Being a nodeJS/web developer I'm checking whether I can use Diesel CLI to handle migrations. I usually handle migrations with knexJS, but it requires node and package installation to be able to do its job. Both Knex and Golang's implementation require code in the framework's language ( However, Diesel CLI's approach of migrations makes it (almost) language agnostic: Any DBA and database-connected app developer can write pure SQL (I'm not aware of other small binary that does the job). Diesel (at least its CLI) can then potentially reach beyond Rust developers. Is it possible to static link all DB client libraries (I mean, bake it in the compiled binary)? I had no problem connecting to PG11.x server using psql v12. Arch Linux has (precompiled) binaries as well (requiring dependencies of client libs, though). |
It is certainly possible to link all DB client libraries statically. For sqlite this can be done via the As mentioned above: I won't work by myself on this issue, but I will accept a well written PR here. |
To clarify this is my use-case, I'm working with projects written in Erlang rather than Rust and find Diesel an attractive alternative to Flyway as it requires us to install and run the JVM. |
@lpil Probably the only part giving away Diesel CLI's power as not a migration toolkit is that it requires I tried do dive into Rust toolchain the best that I could, but with setting @weiznich I understand that this might not be a priority, but I believe that this would be a great feature. |
With #2069 it does not require a
https://github.com/emk/rust-musl-builder might be helpful as they have explicit examples how to build diesel applications using musl and diesel-cli is in the end just a diesel application. |
@GopherJ I do not see what this adds to the discussion, that's already written in my comment above. If you've nothing to say, please stop adding comments here. |
ok @weiznich I'll delete my comment above, I just want to say it's important while seeing so many However, pls don't use github as being a good contributor doesn't mean:
|
@GopherJ It's not about stopping someone from speaking, it's just about increasing the signal to noise ratio for potential contributors. I'm happy to hear out comments that add something to the discussion, but I dislike going though my notifications and spend my time with reading basically "me too messages" coming up in my post box. |
After applying the following changes: I'm able to use
|
@GopherJ Your last comment looks helpful. Can you share in more detail, maybe on a separate branch on your fork or maybe using github gist? It's quite hard for me to understand what you've done by looking at a screenshot. |
@benedictjohannes Hi, basically what I did comes from: https://github.com/emk/rust-musl-builder#making-diesel-work and https://github.com/emk/rust-musl-builder#making-openssl-work without these I ran into: emk/rust-musl-builder#69 fork:https://github.com/GopherJ/diesel (not tested, just added patch for you) |
I'd like to confirm that the patch GopherJ@26060a4 allows to statically compiling diesel_cli against postgres+openssl, thank you @GopherJ so much for helping here! I've made a little progress and could also compile in the SQLite3 client using the above mentioned docker container (emk/rust-musl-builder) and just changing the sqlite3 crate used. My final goal is to have a diesel_cli binary also with the MySQL/MariaDB client statically compiled so I have one binary to cover all three DB supported by the cli. But the MySQL/MariaDB client is a tough nut to crack, I couldn't compile yet compile it with musl. I have published my progress in this repo and will be happy to share my learnings. Also super happy to receive suggestions and/or patches. |
I apologize for this possibly inappropriate question, but why does Diesel need dynamic linking at all? (At least in the case of Postgres) |
@nanoqsh I think you are mixing up a few things here. Let me try to clarify those points. rust-postgres on the othet hand is a pure rust implementation of a postgres client library. This means they do not depend on libpq internally as they implement similar functionality in pure rust. |
@weiznich Thanks for the clarification |
Since the last comment here is almost a year ago, I wonder if there has been any progress achieved on this? |
@tifrel This issue is not closed, so nothing has changed. Also please stop asking these questions on such issues. |
This is now fixed with the release of diesel 2.2. The github release now contains prebuild binaries for several platforms: https://github.com/diesel-rs/diesel/releases/tag/v2.2.0 |
Hello! Thank you for this excellent project!
I wish to make use of diesel_cli on machines that are both resource constrained and do not have Rust installed.
Would it be possible to make precompiled binaries availible so they can be downloaded and run without needing to install Rust and compile them ourselves?
Thank you,
Louis
The text was updated successfully, but these errors were encountered: