Giter Club home page Giter Club logo

Comments (11)

corbinu avatar corbinu commented on June 10, 2024 1

@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.

clux avatar clux commented on June 10, 2024 1

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.

clux avatar clux commented on June 10, 2024

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.

freiguy1 avatar freiguy1 commented on June 10, 2024

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.

freiguy1 avatar freiguy1 commented on June 10, 2024

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.

clux avatar clux commented on June 10, 2024

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.

freiguy1 avatar freiguy1 commented on June 10, 2024

Ok, a couple good things:

  1. I actually was able to get past that issue and get postgresql lib completely compiled!
  2. 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.

clux avatar clux commented on June 10, 2024

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.

clux avatar clux commented on June 10, 2024

Hey, did you get anywhere further with this? Got a branch somewhere? :)
Edit: you seem to have updated it now.

from muslrust.

freiguy1 avatar freiguy1 commented on June 10, 2024

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.

clux avatar clux commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.