Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upInstalling diesel_cli on Windows : some assembly required #487
Comments
This comment has been minimized.
|
Is it safe to assume that the location of |
This comment has been minimized.
Shtong
commented
Nov 2, 2016
|
I did not have it in the path at the time I wrote the issue. I just made another test adding sqlite3 to the path and it allowed me to skip the "add sqlite3 the the |
This comment has been minimized.
|
I don't control the |
This comment has been minimized.
Shtong
commented
Nov 3, 2016
•
|
I'll see if I can find where that lib name ( (sorry for the close, clicked the wrong button) |
This comment has been minimized.
|
Closing this issue, as any changes to make this easier will happen to https://github.com/sgrif/pq-sys, not Diesel. I will also be releasing a new PG driver early next year which will not depend on libpq, and should make this easier. |
sgrif
closed this
Dec 10, 2016
This comment has been minimized.
viperscape
commented
May 24, 2017
|
@sgrif I know this is closed, but I am receiving linker errors when building with diesel for postgres. Interesting, I can use the rust-postgres lib without issue. Any news on the new pg driver for diesel? Thanks |
This comment has been minimized.
spasius
commented
Oct 25, 2017
|
Linker takes errors when building with diesel for postgres on Windows 7 64-bit, both stable and nightly. |
This comment has been minimized.
gbip
commented
Nov 13, 2017
•
|
I can't build diesel for sqlite on windows 10 64 bit with the stable and the nightly toolchain.
I tried adding the sqlite dll in It seems that this link present some steps to correctly setup sqlite3. |
This comment has been minimized.
spease
commented
Dec 5, 2017
|
I'm also getting this error. I was able to generate sqlite3.lib, but I don't know how to set the libpath arguments for the linker. |
This comment has been minimized.
spease
commented
Dec 5, 2017
|
Figured it out. As admin: As dev user: |
This comment has been minimized.
ForsakenHarmony
commented
Feb 13, 2018
|
@sgrif what happened to that postgres driver? |
This comment has been minimized.
martinth
commented
Aug 24, 2018
•
|
Since this page is ranked high when you search for "diesel sqlite windows": For reference , if you want to install
Not really straightforward if you aren't a Window developer (which I'm not) but this should work |
This comment has been minimized.
|
@martinth Would love to get that info as a PR to some part of our documentation (not entirely sure where the right place would be) |
This comment has been minimized.
spease
commented
Aug 31, 2018
|
You might be able to simplify those instructions if you use chocolatey to install sqlite. Of course, that assumes you have chocolately installed. That being said, a cholocatey package that provides the lib would make it virtually painless if you had chocolatey installed. Is there a license-related reason for it not being provided with SQLite? I can’t help but think there should also be a better way...eg have the application check for the library and generate it using the above commands if needed. But I don’t know enough about the executable format to know if it’s impossible to execute any code before it attempts to load dependant libraries. |
This comment has been minimized.
shawntabrizi
commented
Oct 23, 2018
|
I think the best way to address this issue now is following these instructions:
|
This comment has been minimized.
spease
commented
Oct 23, 2018
|
This is fantastic |
Shtong commentedOct 27, 2016
Hello
I was about to do the Diesel tutorial, but had to do some unexpected work at the "install diesel_cli" step, in order to make diesel_cli actually compile.
The command I wanted to run is:
rustup run nightly cargo install diesel_cliMy environment is a Windows 10 x64 with VS14 installed, as well as PostgreSQL 9.6 (installed with the official installer) and the SQlite .dll and .def that I manually downloaded and put into some folder.
While I had several errors, they were all pretty similar to this one (missing .lib input files):
What I had to do in order to successfully compile:
SQLITE3_LIB_DIRenvvar to the directory containing the sqlite3 dll. This was not required by diesel itself but by one of its dependencies, and the error message suggested to set that var, so I guess it's not that badLIBenvvar to both the PostgreSQL lib directory, and the directory containing the Sqlite3 binaries. Required forlinkto find the required librarieslink /lib /def:sqlite3.def /MACHINE:X64in my case)libpq.libfile located in the PostgreSQL lib directory intopq.libAfter compilation was done, I had to copy the following DLLs in my ~/.cargo/bin
I'm not sure if Diesel was designed to build on Windows in the first place (I couldn't find any mention of platform-specific instructions or warnings), but these steps allowed me to build Diesel and successfully run the migrations.