GithubHelp home page GithubHelp logo

Comments (13)

dmikusa avatar dmikusa commented on August 29, 2024 1

I also added paketo-buildpacks/jammy-base-stack#90 to add the dev files. If you want to 👍 that, it would be helpful.

from rust.

dmikusa avatar dmikusa commented on August 29, 2024 1

Hmm, I think I overlooked this originally and just assumed the dev files were missing:

run pkg_config fail: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 127

I believe this 127 is telling us that pkg-config isn't installed. Digging into the image, I don't see it either. I think we need that to be added too. Doing a manual test, after I install that, I can run the command Rust is complaining about. I'll send a PR. Sent in paketo-buildpacks/jammy-base-stack#92.

from rust.

dmikusa avatar dmikusa commented on August 29, 2024

No worries. The problem is happening because docker.io/paketocommunity/rust isn't a builder. It's a buildpack.

The easiest way to kick off a rust build is to pack build <image-name> -b docker.io/paketocommunity/rust. The lowercase -b says use this specific buildpack, which is the Rust buildpack.

If you need a builder, you can create one but we're not publishing a builder at this time.

There is a builder definition file in the repository though, and instructions here for customizing and creating a builder from that definition.

Hope that helps!

from rust.

ekwoka avatar ekwoka commented on August 29, 2024

Ah yes, and the control plane CLI doesn't have a buildpack option : 😩

Made it harder to tell that builder !== Buildpack.

I tried using pack with the paketo builder and this buildpack and it fails for other reasons...something about openssl. That made me hit the "okay, not a problem for tonight" wall

from rust.

dmikusa avatar dmikusa commented on August 29, 2024

I tried using pack with the paketo builder and this buildpack and it fails for other reasons...something about openssl.

Let me know specifically what command you're running and the error you're getting. The Paketo builders should have openssl & dev libraries installed, but things can happen. Happy to help sort it out.

from rust.

ekwoka avatar ekwoka commented on August 29, 2024

command is

pack build myapp --builder paketobuildpacks/builder:base --buildpack paketo-community/[email protected]

This is basically a little like 20 line webserver using warp and tokio but it seems to be related to

Compiling openssl-sys v0.9.87

and the error is

error: failed to run custom build command for `openssl-sys v0.9.87`

      Caused by:
        process didn't exit successfully: `/workspace/target/release/build/openssl-sys-f98e335d55700c71/build-script-main` (exit status: 101)
        --- stdout
        cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
        X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
        cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
        OPENSSL_LIB_DIR unset
        cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
        X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
        cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
        OPENSSL_INCLUDE_DIR unset
        cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
        X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
        cargo:rerun-if-env-changed=OPENSSL_DIR
        OPENSSL_DIR unset
        cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
        cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
        cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
        cargo:rerun-if-env-changed=HOST_PKG_CONFIG
        cargo:rerun-if-env-changed=PKG_CONFIG
        cargo:rerun-if-env-changed=OPENSSL_STATIC
        cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
        cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
        cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
        cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
        cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
        cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
        cargo:rerun-if-env-changed=PKG_CONFIG_PATH
        cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
        cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
        cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
        cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
        cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
        cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
        cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
        cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
        run pkg_config fail: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 127
        error: could not find system library 'openssl' required by the 'openssl-sys' crate


        --- stderr
        thread 'main' panicked at '

        Could not find directory of OpenSSL installation, and this `-sys` crate cannot
        proceed without this knowledge. If OpenSSL is installed and this crate had
        trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
        compilation process.

        Make sure you also have the development packages of openssl installed.
        For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

        If you're in a situation where you think the directory *should* be found
        automatically, please open a bug at https://github.com/sfackler/rust-openssl
        and include information about your system as well as this message.

        $HOST = x86_64-unknown-linux-gnu
        $TARGET = x86_64-unknown-linux-gnu
        openssl-sys = 0.9.87

        ', /layers/paketo-community_rustup/Cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.87/build/find_normal.rs:190:5
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

EDIT: appears to work with paketobuildpacks/builder:buildpackless-full

from rust.

dmikusa avatar dmikusa commented on August 29, 2024

That's a pain. I thought the openssl dev files would be installed in the base stack, but it doesn't look like they are there.

One thing you can do use use the openssl-sys feature vendored which will have it build its own copy of openssl. It'll take a little longer to compile, but then you're not dependent on what libraries are shipped in your image.

Using the full stack is also an option, but I don't recommend it. The size is much larger. What you can do though is to use the full builder, but then swap out the run image.

pack build myapp --builder paketobuildpacks/builder:full --buildpack paketo-community/[email protected] --run-image paketobuildpacks/run-jammy-base:latest

That will give you all the packages in the full builder at build time, but it'll use the smaller base image for the image that gets generated with your compiled application.

from rust.

ekwoka avatar ekwoka commented on August 29, 2024

Thanks!

from rust.

ekwoka avatar ekwoka commented on August 29, 2024

That code seems to fail with

ERROR: failed to build: invalid run-image 'paketobuildpacks/run-jammy-base:latest': run-image stack id 'io.buildpacks.stacks.jammy' does not match builder stack 'io.buildpacks.stacks.bionic'

So maybe I just need to use the full until the base is updated.

from rust.

dmikusa avatar dmikusa commented on August 29, 2024

Oh, sorry. I missed that you are still using the Bionic builder, which goes out of support at the end of this month. Not you're fault, we're in the process of switching documentation & things to point to the Jammy builders.

Use paketobuildpacks/builder-jammy-full:latest as your builder.

pack build myapp --builder paketobuildpacks/builder-jammy-full:latest --buildpack paketo-community/[email protected] --run-image paketobuildpacks/run-jammy-base:latest

from rust.

robdimsdale avatar robdimsdale commented on August 29, 2024

The latest release of the jammy-base-stack has the libssl-dev library. The builder won't be far behind.

from rust.

ekwoka avatar ekwoka commented on August 29, 2024

I'm seeing that the images are updated, and using builder-jammy-base still has the same error.

from rust.

robdimsdale avatar robdimsdale commented on August 29, 2024

Hmm, that's odd. The stack build image has the library:

→ docker run --rm -it index.docker.io/paketobuildpacks/build-jammy-base:latest /bin/bash -c "dpkg -l | grep -i ssl-dev"
ii  libssl-dev:amd64          3.0.2-0ubuntu1.9                        amd64        Secure Sockets Layer toolkit - development files

Maybe we need to add other libraries? I haven't had chance to dig into this. cc @dmikusa

from rust.

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.