Comments (11)
@clux I am trying to get rustc to build on alpine but not having much luck. As soon as I figure it out will submit a PR for the upgrade.
from muslrust.
libpq is added now, new build on the way. pq-sys linking does work (which is what the test does), however, full usage of diesel with diesel_codegen
(in particular) fails. new issue for that incoming.
from muslrust.
Hey, yeah libpq is definitely the kind of thing we'd want in here. Particularly with the usage numbers from diesel :)
Ideally we'd probably move this image to alpine entirely soon - at which point we can just use their package - but in the mean time you'd have to compile it here. I'm a bit busy for a few days, so please have a go :)
It generally should be a case of adding a new line to the docker file where you curl the libpq source tarball (looks like it's part of postgres), pipe it into the correct incantation of tar, calling ./configure with some minimal set of parameters (need ssl support at least, but we don't need all of postgres either), then make && make install
. Everything else should be set in the container for that to work.
It'd be good to write a small test crate that at least uses diesel in a minimal way (just to test that we can link - don't need to actually connect to a db).
from muslrust.
Wow thanks for all the information. I'm actually out for the weekend but I'll take a look when I get back!
from muslrust.
Alright, I'm giving a shot at building postgresql-libs. So far I've curled and extracted the source from postgresql's ftp. Now I'm trying to configure. So far, my command is: ./configure --with-openssl --without-readline --without-zlib
. I added the last two args because configure
suggested them after errors. Now this is the error I'm getting:
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL
How do I get around this one?
from muslrust.
Ugh, depends on the configure
script essentially. It needs to know where to find our custom openssl (the one compiled with musl right above). I remember battling with curl
to do the right thing as well until I set PKG_CONFIG_PATH
, maybe there's a way to tell it to read openssl's pkg config file in its options.
from muslrust.
Ok, a couple good things:
- I actually was able to get past that issue and get postgresql lib completely compiled!
- When trying to compliek my project, it successfully compiles all dependencies.
And a bad thing: when it starts to compile my project, cargo/rustc chokes on the first line:
Compiling league_db v0.1.0 (file:///volume/db)
error: /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
--> db/src/lib.rs:1:14
|
1 | #[macro_use] extern crate diesel_codegen;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Could not compile `league_db`.
To learn more, run the command again with --verbose.
from muslrust.
hm, yeah, seems it's trying to use glibc rather than something like /usr/lib/x86_64-linux-musl/libc.a
. Maybe this is a configuration error of a crate that needs evars, or maybe it's compiled wrong. Hard to tell. At any rate, maybe the documentation for pq-sys is useful, they have some configurables.
from muslrust.
Hey, did you get anywhere further with this? Got a branch somewhere? :)
Edit: you seem to have updated it now.
from muslrust.
Yes! I was able to get the postgre lib compiled and installed, but I didn't get past that build issue in the last comment I had here unfortunately. I have actually switched deployment directions a bit however, and gone with pushing the rust web app to heroku using the rust buildpack. Can't hardly beat the deployment process of git push heroku master
!
Edit: spelling
from muslrust.
Hehe, that's fair. Thanks for that push at least.
I have absorbed your work in a branch here to have a little bit more of a go :)
from muslrust.
Related Issues (20)
- Please rebuild "stable" less often or add a "LTS" version HOT 3
- What do you think about using tags like official Rust Docker image? HOT 1
- feature request: add protoc into the image HOT 3
- Add zlib-ng? HOT 4
- Changes needed to get rust-rdkafka built
- must-ar not executing successfully while building ring HOT 6
- Add test for latest tonic HOT 3
- Make builder cancellable with Ctrl-C? HOT 1
- Failed to find tool. Is `musl-g++` installed? HOT 1
- failed to compile diesel_cli in clux/muslrust image HOT 1
- WORKDIR defaults to /volume -- is this desired? HOT 1
- It would be awesome to use mold to build HOT 2
- What do you think about this anti-musl post? HOT 6
- How to disable `cc1: all warnings being treated as errors` HOT 1
- DNS errors in binaries built with muslrust when run in rootless Docker HOT 1
- Linker errors when building binaries (failed to set dynamic section sizes: bad value) HOT 5
- Unable to build prost due to old version of cmake on ubuntu:xenial HOT 3
- Build and fetch errors with clux/muslrust:1.60.0 HOT 18
- explore possibility of removing older C libraries
- explore building an arm64 variant HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from muslrust.