Giter Site home page Giter Site logo

rust's Introduction

docker.io/paketocommunity/rust

The Rust Cloud Native Buildpack provides a set of collaborating buildpacks that enable the building of a Rust-based application.

Included Buildpacks

tl;dr

You can build your app with two steps:

  1. Run pack build <image-name> -b docker.io/paketocommunity/rust. An image will be generated that you can run.
  2. Run the image with docker run -it <image-name>.

By default, the Rust buildpack will add process types for all of the binary projects in your workspace. You may optionally add a Procfile though if you need to customize the start command for your container.

What's Included

A Meta Buildpack

Included in this repo is a buildpack.toml that defines the Rust meta buildpack. It allows you to reference all of the Rust related CNBs in one convenient way & know that the order is set correctly.

This is available through a pre-built docker image on Docker Hub.

To use: pack build <image-name> -b docker.io/paketocommunity/rust

A Builder

In this repo is a sample example-builder.toml that you can use to create your own builder. We do not publish a builder, so if you'd like to use this route you must first create the builder.

To create the builder, just run pack builder create <published-to>/rust-builder --config example-builder.toml. For example, pack builder create paketocommunity/rust-builder --config example-builder.toml.

You can then build an app with it using pack build <image-name> --builder <published-to>/rust-builder.

The builder is configure to use the base build and run images, which is a reasonable mix of size and functionality. You may change the build and run images to use the full stack, which has a lot more libraries and tools installed but is quite a bit larger, or you can use the tiny build and run images which presents a very small container but doesn't even contain a shell, which can make debugging difficult.

To switch, swap the stack that you'd like to use in the builder file.

Example full stack:

[stack]
  id = "io.buildpacks.stacks.jammy"
  build-image = "docker.io/paketobuildpacks/build-jammy-base:latest"
  run-image = "docker.io/paketobuildpacks/run-jammy-base:latest"

Example tiny stack:

[stack]
  id = "io.buildpacks.stacks.jammy.tiny"
  build-image = "docker.io/paketobuildpacks/build-jammy-tiny"
  run-image = "docker.io/paketobuildpacks/run-jammy-tiny"

Tips

  • When building for the Paketo Tiny stack, you must build with the target set to x86_64-unknown-linux-musl. This is because if you build with the glibc target, you will end up with a dependency for the libgcc_s.so.1 library that does not exist on the Paketo Tiny run image. If we target musl instead, you'll get a binary that is statically compiled against musl and does not have this requirement, thus it will run on the Tiny stack.

    When you run with the Tiny stack, the buildpacks will detect this and automatically adjust. This includes installing the additional target to cross-compile and modifying cargo commands cross-compile using the musl target.

  • By default, the Rust buildpack will install tini, which is a very small process manager that handles the PID1 responsibilities (it's also the same running docker run --init), into your application image. Because your application will run as PID1, this ensures that your application will properly handle signals. If you are running your image with Docker, this is what makes CTRL+C function correctly. If you're running on Kubernetes, this is what makes graceful termination work correctly.

    It is generally recommended that you keep tini installed. It's extremely low-overhead. That said, if you really, really know what you're doing and your application is properly handling signals and reaping child processes then you may set $BP_CARGO_TINI_DISABLED=true and the buildpacks will skip installing tini..

  • What's the difference between using a builder and using the composite buildpack (i.e. docker.io/paketocommunity/rust)? There's not a lot of difference, so feel free to use which one is more convenient for your use cases. The composite buildpack is published to Docker Hub so it's often easier to get started using it. We are not publishing a builder image at the moment, so you need to build that on your own. The builder does offer some additional customization options though. Plus, you can set a default builder with pack, so if you're building many different applications it can reduce the amount of flags you need to send to pack build. You do not need to use both the builder and composite buildpack.

  • Can I specify multiple processes in my Procfile? Yes! To make this work, just add more lines to Procfile. One of the lines needs to be named web, which is the expected name for the default process. Alternatively, you may use different names but pass the --default-process argument to pack build to indicate the default process name in your Procfile. It is highly recommended that you have a default process. See here for more details on multiple process containers.

  • Can I pass arguments to my application? Yes, you just append them to the end of your docker run command. See here for an example.

  • How do I run a non-default process from my Procfile? Pass --entrypoint <process name> to docker run. See here for an example.

  • How do I launch a shell in my container to debug? There are two ways to do this. First, docker run --rm --entrypoint launcher -it <image-name> bash. The first will set up the shell with the standard environment, the same as what your application will get when it launches. Second, docker run --rm --entrypoint bash -it <image-name>. The second will give you a blank environment without any buildpack specific environment variables set.

License

This buildpack is released under version 2.0 of the Apache License.

rust's People

Contributors

anthonydahanne avatar dependabot[bot] avatar dmikusa avatar foresteckhardt avatar jasonschroeder-sfdc avatar paketo-bot avatar ryanmoran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rust's Issues

Add support for `upx`

upx is a tool for compressing binary executables. It has some excellent compression ratios and very low runtime overhead. It would be helpful with Rust binaries. We should add support.

This also needs to be supported in Cargo: paketo-community/cargo#238

Mark step in tldr as optional

This step is not needed to get the application to run:
Add a [Procfile](https://paketo.io/docs/howto/configuration/#procfiles) with the command that should be executed to run your app.

Would mark it as optional or put it somewhere below for detailed setup but not in tldr section.

Dockerized rust applications not receiving signals from command line

I packaged a rocket server with this rust buildpack but then encountered a problem of not being able to kill it via command line.
This problem is also true for a rocket server with a standard Dockerfile.
But adding the tini command inbetween solves the signal handling problem here.
The tini buildpack could be added to improve the signal handling (eg. CTRL+C) for dockerized servers in rust.

Buildpacks produce quite big image

Hi,

I'm comparing image I'm building directly with Docker file like such with Rust static executable inside it:

FROM scratch
COPY target/x86_64-unknown-linux-gnu/release/function /function
CMD [ "/function" ]

where I'm getting as output - image of about 14MB in size:

$ podman image ls | grep sample
localhost/sample                                                   latest         9f76d50aaa01  8 minutes ago  13.9 MB

and layers:

$ podman history sample
ID            CREATED        CREATED BY                                     SIZE        COMMENT
8144b031a549  8 minutes ago  /bin/sh -c #(nop) CMD [ "/function" ]          0 B         FROM 8144b031a549
<missing>     8 minutes ago  /bin/sh -c #(nop) COPY file:3b28c741a95a71...  13.9 MB   

And then I have image for same Rust function produced via buildpacks - about 107MB:

$ podman image ls | grep buildpack-sample
localhost/buildpack-sample                                         latest         181d2f0215c3  43 years ago    107 MB

and layers in it:

$ podman history buildpack-sample
ID            CREATED       CREATED BY  SIZE        COMMENT
181d2f0215c3  43 years ago              3.07 kB     
<missing>     43 years ago              4.1 kB      
<missing>     43 years ago              2.31 MB     
<missing>     43 years ago              2.56 kB     
<missing>     43 years ago              362 kB      
<missing>     43 years ago              27.6 kB     
<missing>     43 years ago              12.8 MB     
401511bdd9f6  43 years ago              2.56 kB     
<missing>     43 years ago              4.61 kB     
<missing>     43 years ago              4.1 kB      
<missing>     43 years ago              25.9 MB     
<missing>     43 years ago              3.07 kB     
<missing>     43 years ago              3.07 kB     
<missing>     43 years ago              65.5 MB     

What is the cause of such big difference? Any specific setting/config to tweak somewhere to make it smaller via buildpacks as well?

Wrong url for cargo-install in builder.toml

The builder process was filing because rust-cargo couldn't be found on the repository.
builder.toml defines

uri = "docker://paketocommunity/rust-cargo:0.0.6"

it should be

uri = "docker://paketocommunity/cargo-install:0.0.6"

Use Test Binary | Help Wanted

I would like to run integration tests for a library independently from my application bin. To do so I need it deployed to my cluster. Hence, I was interested in using rust-cnb to create test image from my library's rust test binary. Is this possible?

Add integration tests

We should add integration tests that test the overall functionality of the rust buildpack.

Exception: ERROR: failed to launch: determine start command: when there is no default process a command is required

Hi admin,

I have managed to run pack build northwind-rs -e SQLX_OFFLINE=true -b docker.io/paketocommunity/rust command to build up the docker image using buildpacks. My pack version is 0.18.0+git-e00ee4a.build-2328, and I run it on Windows 10 OS.

It could run successfully and I could have the Docker image with the name northwind-rs, but when I tried to run it by docker then it throws the exception ERROR: failed to launch: determine start command: when there is no default process a command is required.

Could you guys let me know how can we overcome this exception?

My sample code is at https://github.com/thangchung/northwind-rs

Getting hang around buildpacksio/lifecycle:cache.sbom layer

Hi,

I'm trying to build Rust function via buildpacks. Initially build is progressing just fine, but then hangs (stays in below state like 10+ mins already). Several lines before hang are such:

*** Image ID: 4d6b522c238b39d18e984da0aafba4df3fc48622cfa4b62cc9e10da75d201d79
Reading buildpack directory: /layers/paketo-community_rustup
Reading buildpack directory item: Cargo
Reading buildpack directory item: Cargo.toml
Reading buildpack directory item: Rust
Reading buildpack directory item: Rust.sbom.syft.json
Reading buildpack directory item: Rust.toml
Reading buildpack directory item: Rustup
Reading buildpack directory item: Rustup.sbom.syft.json
Reading buildpack directory item: Rustup.toml
Reading buildpack directory item: rustup-init-gnu
Reading buildpack directory item: rustup-init-gnu.sbom.syft.json
Reading buildpack directory item: rustup-init-gnu.toml
Reusing cache layer 'paketo-community/rustup:Cargo'
Layer 'paketo-community/rustup:Cargo' SHA: sha256:75845cfb3dc8cd470125e2a4be23cf17f0865acf60ee72d8ae24896c120f7746
Reusing cache layer 'paketo-community/rustup:Rust'
Layer 'paketo-community/rustup:Rust' SHA: sha256:92d0598dad895b2696ae78db72a3e4743908e13477af45d4b1e3d3493223fa26
Reusing cache layer 'paketo-community/rustup:Rustup'
Layer 'paketo-community/rustup:Rustup' SHA: sha256:3f38e19669a7f11318d6d7118327e932b8ab286160c697af702e96dbcefcc9a6
Reusing cache layer 'paketo-community/rustup:rustup-init-gnu'
Layer 'paketo-community/rustup:rustup-init-gnu' SHA: sha256:52cda5af3103702684a552c5f5e19bdb78cc779614d52c348635af13f1c414cb
Reading buildpack directory: /layers/paketo-community_rust-dist
Reading buildpack directory: /layers/paketo-buildpacks_syft
Reading buildpack directory item: build.toml
Reading buildpack directory item: syft
Reading buildpack directory item: syft.sbom.syft.json
Reading buildpack directory item: syft.toml
Reusing cache layer 'paketo-buildpacks/syft:syft'
Layer 'paketo-buildpacks/syft:syft' SHA: sha256:860f77eeedbc92ee0de2e4d162037491655368d56962f32812abcd9bb0d5cbeb
Reading buildpack directory: /layers/paketo-community_cargo
Reading buildpack directory item: Cargo
Reading buildpack directory item: Cargo Cache
Reading buildpack directory item: Cargo Cache.toml
Reading buildpack directory item: Cargo.sbom.cdx.json
Reading buildpack directory item: Cargo.sbom.syft.json
Reading buildpack directory item: Cargo.toml
Reading buildpack directory item: launch.toml
Reading buildpack directory item: tini.sbom.syft.json
Reading buildpack directory item: tini.toml
Reusing tarball for layer "paketo-community/cargo:Cargo" with SHA: sha256:506fa024a9b1b6f696187a6cbd016816e09ac5a73be23640afc6b75da0857f86
Reusing cache layer 'paketo-community/cargo:Cargo'
Layer 'paketo-community/cargo:Cargo' SHA: sha256:506fa024a9b1b6f696187a6cbd016816e09ac5a73be23640afc6b75da0857f86
Reusing cache layer 'paketo-community/cargo:Cargo Cache'
Layer 'paketo-community/cargo:Cargo Cache' SHA: sha256:eedee032b2053b5c0ea2eef28e202a763e427c44a92aea0945566d2d19b95a27
Reading buildpack directory: /layers/paketo-buildpacks_procfile
Reading buildpack directory item: launch.toml
Found SBOM of type cache for at /layers/sbom/cache
Reusing tarball for layer "buildpacksio/lifecycle:cache.sbom" with SHA: sha256:f6a889460a8acf60c8cfd111defeeaf49529f5e9277f4b95f821fde25f562649
Reusing cache layer 'buildpacksio/lifecycle:cache.sbom'
Layer 'buildpacksio/lifecycle:cache.sbom' SHA: sha256:f6a889460a8acf60c8cfd111defeeaf49529f5e9277f4b95f821fde25f562649

My OS is such:

Ubuntu 22.04.2 LTS

I'm on x86_64 architecture. Running podman on my box. Disk has enough space.

Anything to check or enable some extra debug somewhere to understand the cause?

Suggested builder does not work

When using builder created from the example-builder.toml config I am not able to build an application.

Note that build by: pack build apps/rust -b paketo-community/rust -B paketobuildpacks/builder-jammy-base:latest does work fine.

Error log:

Builder test-rs-builder-3 is trusted
Selected run image docker.io/paketobuildpacks/run-jammy-tiny
Creating builder with the following buildpacks:
-> paketo-community/[email protected]
-> paketo-community/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-community/[email protected]
-> paketo-buildpacks/[email protected]
Using build cache volume pack-cache-library_test-plain-rs-abcsadfasdfsasdf_latest-8d6920df667c.build
Build cache pack-cache-library_test-plain-rs-abcsadfasdfsasdf_latest-8d6920df667c.build cleared
Running the creator on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image docker.io/paketobuildpacks/run-jammy-tiny -skip-restore test-plain-rs-abcsadfasdfsasdf
  System Envs: CNB_PLATFORM_API=0.12
  Image: pack.local/builder/69627a686a7762647778:latest
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: pack-cache-library_test-plain-rs-abcsadfasdfsasdf_latest-8d6920df667c.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-library_test-plain-rs-abcsadfasdfsasdf_latest-8d6920df667c.launch:/launch-cache pack-layers-tvmzhgtvrz:/layers pack-app-ttipvlqdvd:/workspace
  Network Mode: 
Starting creator...
Parsing inputs...
Ensuring privileges...
Executing command...
===> ANALYZING
Image with name "test-plain-rs-abcsadfasdfsasdf" not found
Found image with identifier "24856b5a098bb65477ddbbac743e0ad69898936a0dd5dce19d7a8d111f3d2d3b"
===> DETECTING
======== Output: paketo-buildpacks/[email protected] ========
SKIPPED: No procfile found from either source path or binding.
======== Results ========
pass: paketo-community/[email protected]
pass: paketo-community/[email protected]
pass: paketo-buildpacks/[email protected]
pass: paketo-community/[email protected]
skip: paketo-buildpacks/[email protected]
Resolving plan... (try #1)
4 of 5 buildpacks participating
paketo-community/rustup    1.9.1
paketo-community/rust-dist 1.19.0
paketo-buildpacks/syft     1.32.1
paketo-community/cargo     0.10.1
===> RESTORING
Skipping buildpack layer analysis
Reading buildpack directory: /layers/paketo-community_rustup
Reading buildpack directory: /layers/paketo-community_rust-dist
Reading buildpack directory: /layers/paketo-buildpacks_syft
Reading buildpack directory: /layers/paketo-community_cargo
===> BUILDING
Starting build
Running build for buildpack paketo-community/[email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command

Paketo Buildpack for Rustup 1.9.1
  https://github.com/paketo-community/rustup
  Build Configuration:
    $BP_RUSTUP_ENABLED       true     use rustup to install Rust
    $BP_RUSTUP_INIT_LIBC     gnu      libc implementation: gnu or musl
    $BP_RUSTUP_INIT_VERSION  1        the rustup version
    $BP_RUST_PROFILE         minimal  the Rust profile to install
    $BP_RUST_TARGET                   an additional Rust target to install
    $BP_RUST_TOOLCHAIN       stable   the Rust toolchain or version number to install
  Rustup (GNU libc) 1.26.0: Contributing to layer
    Downloading from https://static.rust-lang.org/rustup/archive/1.26.0/x86_64-unknown-linux-gnu/rustup-init
    Verifying checksum
    Copying to /layers/paketo-community_rustup/rustup-init-gnu/bin
  Cargo: Contributing to layer
  Rustup: Contributing to layer
    Installing Rustup
  Rust: Contributing to layer
    Installing Rust
      info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
      info: latest update on 2023-08-03, rust version 1.71.1 (eb26296b5 2023-08-03)
      info: downloading component 'cargo'
      info: downloading component 'rust-std'
      info: downloading component 'rustc'
      info: installing component 'cargo'
      info: installing component 'rust-std'
      info: installing component 'rustc'
      
        stable-x86_64-unknown-linux-gnu installed - rustc 1.71.1 (eb26296b5 2023-08-03)
      
      info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'
      info: checking for self-update
      info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
      info: installing component 'rust-std' for 'x86_64-unknown-linux-musl'
Processing layers
Updating environment
Reading output files
Updating buildpack processes
Updating process list
Finished running build for buildpack paketo-community/[email protected]
Running build for buildpack paketo-community/[email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command

Rust Distribution Buildpack 1.19.0
  https://github.com/paketo-community/rust-dist
Processing layers
Updating environment
Reading output files
Updating buildpack processes
Updating process list
Finished running build for buildpack paketo-community/[email protected]
Running build for buildpack paketo-buildpacks/[email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command

Paketo Buildpack for Syft 1.32.1
  https://github.com/paketo-buildpacks/syft
    Downloading from https://github.com/anchore/syft/releases/download/v0.84.0/syft_0.84.0_linux_amd64.tar.gz
    Verifying checksum
    Writing env.build/SYFT_CHECK_FOR_APP_UPDATE.default
Processing layers
Updating environment
Reading output files
Updating buildpack processes
Updating process list
Finished running build for buildpack paketo-buildpacks/[email protected]
Running build for buildpack paketo-community/[email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command

Rust Cargo Build Pack 0.10.1
  https://github.com/paketo-community/cargo
  Build Configuration:
    $BP_CARGO_INSTALL_ARGS        --locked                              additional arguments to pass to Cargo install
    $BP_CARGO_INSTALL_TOOLS                                             additional tools to be add with Cargo install
    $BP_CARGO_INSTALL_TOOLS_ARGS                                        additional arguments to pass to Cargo install for tools
    $BP_CARGO_TINI_DISABLED       false                                 Skip installing tini
    $BP_CARGO_WORKSPACE_MEMBERS                                         the subset of workspace members for Cargo to install
    $BP_DISABLE_SBOM              false                                 Skip running SBOM scan
    $BP_EXCLUDE_FILES                                                   colon separated list of glob patterns, matched source files are removed
    $BP_INCLUDE_FILES             static/*:templates/*:public/*:html/*  colon separated list of glob patterns, matched source files are included
    $BP_STATIC_BINARY_TYPE        muslc                                 type of static binary to build
  Tini 0.19.0: Contributing to layer
    Downloading from https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-muslc-amd64
    Verifying checksum
    Copying to /layers/paketo-community_cargo/tini
    Creating cached target directory /workspace/target
  Rust Application: Contributing to layer
    File modification times not restored
    File modification times not restored
    File modification times not restored
    cargo install --locked --color=never --root=/layers/paketo-community_cargo/Cargo --path=. --target=x86_64-unknown-linux-musl
        Installing function v0.1.0 (/workspace)
          Updating crates.io index
      warning: package `hermit-abi v0.3.1` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
       Downloading crates ...
        Downloaded actix-rt v2.8.0
        Downloaded crc32fast v1.3.2
        Downloaded bytes v1.4.0
        Downloaded alloc-no-stdlib v2.0.4
        Downloaded indexmap v1.9.3
        Downloaded percent-encoding v2.3.0
        Downloaded tinyvec_macros v0.1.1
        Downloaded num_cpus v1.15.0
        Downloaded futures-core v0.3.28
        Downloaded paste v1.0.12
        Downloaded tracing-core v0.1.31
        Downloaded futures-sink v0.3.28
        Downloaded adler v1.0.2
        Downloaded actix-macros v0.2.3
        Downloaded cfg-if v1.0.0
        Downloaded scopeguard v1.1.0
        Downloaded actix-service v2.0.2
        Downloaded pkg-config v0.3.27
        Downloaded is-terminal v0.4.7
        Downloaded local-channel v0.1.3
        Downloaded actix-utils v3.0.1
        Downloaded autocfg v1.1.0
        Downloaded ahash v0.7.6
        Downloaded rand_chacha v0.3.1
        Downloaded alloc-stdlib v0.2.2
        Downloaded actix-router v0.5.1
        Downloaded httpdate v1.0.2
        Downloaded form_urlencoded v1.2.0
        Downloaded convert_case v0.4.0
        Downloaded actix-web-codegen v4.2.0
        Downloaded bytestring v1.3.0
        Downloaded itoa v1.0.6
        Downloaded generic-array v0.14.7
        Downloaded humantime v2.1.0
        Downloaded digest v0.10.7
        Downloaded crypto-common v0.1.6
        Downloaded time-core v0.1.1
        Downloaded local-waker v0.1.3
        Downloaded futures-task v0.3.28
        Downloaded block-buffer v0.10.4
        Downloaded fnv v1.0.7
        Downloaded cpufeatures v0.2.7
        Downloaded actix-server v2.2.0
        Downloaded cc v1.0.79
        Downloaded ahash v0.8.3
        Downloaded signal-hook-registry v1.4.1
        Downloaded lock_api v0.4.10
        Downloaded actix-http v3.3.1
        Downloaded version_check v0.9.4
        Downloaded sha1 v0.10.5
        Downloaded termcolor v1.2.0
        Downloaded slab v0.4.8
        Downloaded pin-utils v0.1.0
        Downloaded rand_core v0.6.4
        Downloaded ppv-lite86 v0.2.17
        Downloaded actix-web v4.3.1
        Downloaded smallvec v1.10.0
        Downloaded typenum v1.16.0
        Downloaded quote v1.0.28
        Downloaded serde_urlencoded v0.7.1
        Downloaded rustc_version v0.4.0
        Downloaded mime v0.3.17
        Downloaded jobserver v0.1.26
        Downloaded serde v1.0.164
        Downloaded h2 v0.3.19
        Downloaded zstd v0.12.3+zstd.1.5.2
        Downloaded io-lifetimes v1.0.11
        Downloaded zstd-sys v2.0.8+zstd.1.5.5
        Downloaded zstd-safe v6.0.5+zstd.1.5.4
        Downloaded unicode-ident v1.0.9
        Downloaded time-macros v0.2.9
        Downloaded pin-project-lite v0.2.9
        Downloaded tinyvec v1.6.0
        Downloaded socket2 v0.4.9
        Downloaded miniz_oxide v0.7.1
        Downloaded parking_lot v0.12.1
        Downloaded language-tags v0.3.2
        Downloaded ryu v1.0.13
        Downloaded rand v0.8.5
        Downloaded parking_lot_core v0.9.8
        Downloaded derive_more v0.99.17
        Downloaded url v2.4.0
        Downloaded tokio-util v0.7.8
        Downloaded memchr v2.5.0
        Downloaded tracing v0.1.37
        Downloaded semver v1.0.17
        Downloaded proc-macro2 v1.0.60
        Downloaded once_cell v1.18.0
        Downloaded flate2 v1.0.26
        Downloaded http v0.2.9
        Downloaded encoding_rs v0.8.32
        Downloaded unicode-normalization v0.1.22
        Downloaded mio v0.8.8
        Downloaded futures-util v0.3.28
        Downloaded time v0.3.22
        Downloaded serde_json v1.0.96
        Downloaded brotli-decompressor v2.3.4
        Downloaded aho-corasick v1.0.2
        Downloaded rustix v0.37.19
        Downloaded regex v1.8.4
        Downloaded syn v1.0.109
        Downloaded idna v0.4.0
        Downloaded hashbrown v0.12.3
        Downloaded base64 v0.21.2
        Downloaded unicode-bidi v0.3.13
        Downloaded log v0.4.18
        Downloaded regex-syntax v0.7.2
        Downloaded cookie v0.16.2
        Downloaded httparse v1.8.0
        Downloaded getrandom v0.2.10
        Downloaded env_logger v0.10.0
        Downloaded bitflags v1.3.2
        Downloaded actix-codec v0.5.1
        Downloaded tokio v1.28.2
        Downloaded libc v0.2.146
        Downloaded linux-raw-sys v0.3.8
        Downloaded brotli v3.3.4
         Compiling libc v0.2.146
         Compiling cfg-if v1.0.0
         Compiling autocfg v1.1.0
         Compiling version_check v0.9.4
         Compiling memchr v2.5.0
         Compiling pin-project-lite v0.2.9
         Compiling log v0.4.18
         Compiling futures-core v0.3.28
         Compiling bytes v1.4.0
         Compiling proc-macro2 v1.0.60
         Compiling parking_lot_core v0.9.8
         Compiling once_cell v1.18.0
         Compiling smallvec v1.10.0
         Compiling serde v1.0.164
         Compiling unicode-ident v1.0.9
         Compiling scopeguard v1.1.0
         Compiling quote v1.0.28
         Compiling itoa v1.0.6
         Compiling typenum v1.16.0
         Compiling syn v1.0.109
         Compiling tracing-core v0.1.31
         Compiling futures-task v0.3.28
         Compiling pkg-config v0.3.27
         Compiling futures-util v0.3.28
         Compiling percent-encoding v2.3.0
         Compiling generic-array v0.14.7
         Compiling paste v1.0.12
         Compiling lock_api v0.4.10
         Compiling tokio v1.28.2
         Compiling futures-sink v0.3.28
         Compiling pin-utils v0.1.0
         Compiling bitflags v1.3.2
         Compiling tracing v0.1.37
         Compiling indexmap v1.9.3
         Compiling slab v0.4.8
         Compiling zstd-safe v6.0.5+zstd.1.5.4
         Compiling crc32fast v1.3.2
         Compiling alloc-no-stdlib v2.0.4
         Compiling io-lifetimes v1.0.11
         Compiling fnv v1.0.7
         Compiling tinyvec_macros v0.1.1
         Compiling local-waker v0.1.3
         Compiling http v0.2.9
         Compiling tinyvec v1.6.0
         Compiling alloc-stdlib v0.2.2
         Compiling jobserver v0.1.26
         Compiling aho-corasick v1.0.2
         Compiling ahash v0.8.3
         Compiling cc v1.0.79
         Compiling adler v1.0.2
         Compiling time-core v0.1.1
         Compiling rustix v0.37.19
         Compiling httparse v1.8.0
         Compiling ppv-lite86 v0.2.17
         Compiling signal-hook-registry v1.4.1
         Compiling socket2 v0.4.9
         Compiling mio v0.8.8
         Compiling getrandom v0.2.10
         Compiling parking_lot v0.12.1
         Compiling rand_core v0.6.4
         Compiling hashbrown v0.12.3
         Compiling regex-syntax v0.7.2
         Compiling block-buffer v0.10.4
         Compiling crypto-common v0.1.6
         Compiling rand_chacha v0.3.1
         Compiling digest v0.10.7
         Compiling unicode-normalization v0.1.22
         Compiling actix-service v2.0.2
         Compiling zstd-sys v2.0.8+zstd.1.5.5
         Compiling time-macros v0.2.9
         Compiling miniz_oxide v0.7.1
         Compiling bytestring v1.3.0
         Compiling brotli-decompressor v2.3.4
         Compiling actix-utils v3.0.1
         Compiling form_urlencoded v1.2.0
         Compiling cookie v0.16.2
         Compiling ahash v0.7.6
         Compiling linux-raw-sys v0.3.8
         Compiling ryu v1.0.13
         Compiling unicode-bidi v0.3.13
         Compiling serde_json v1.0.96
         Compiling convert_case v0.4.0
         Compiling cpufeatures v0.2.7
         Compiling sha1 v0.10.5
         Compiling idna v0.4.0
         Compiling flate2 v1.0.26
         Compiling local-channel v0.1.3
         Compiling rand v0.8.5
         Compiling regex v1.8.4
         Compiling brotli v3.3.4
         Compiling num_cpus v1.15.0
         Compiling encoding_rs v0.8.32
         Compiling time v0.3.22
         Compiling mime v0.3.17
         Compiling base64 v0.21.2
         Compiling httpdate v1.0.2
         Compiling language-tags v0.3.2
         Compiling serde_urlencoded v0.7.1
         Compiling url v2.4.0
         Compiling is-terminal v0.4.7
         Compiling actix-router v0.5.1
         Compiling humantime v2.1.0
         Compiling termcolor v1.2.0
         Compiling env_logger v0.10.0
      error: failed to run custom build command for `zstd-sys v2.0.8+zstd.1.5.5`
      
      Caused by:
        process didn't exit successfully: `/workspace/target/release/build/zstd-sys-caf99e9118fcc660/build-script-build` (exit status: 1)
        --- stdout
        cargo:rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG
        TARGET = Some("x86_64-unknown-linux-musl")
        OPT_LEVEL = Some("z")
        HOST = Some("x86_64-unknown-linux-gnu")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        DEBUG = Some("false")
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        running: "musl-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/workspace/target/x86_64-unknown-linux-musl/release/build/zstd-sys-28f86fc799f53a62/out/zstd/lib/common/debug.o" "-c" "zstd/lib/common/debug.c"
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-musl
        CC_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_musl
        CC_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        RUSTC_LINKER = None
        cargo:rerun-if-env-changed=CROSS_COMPILE
        CROSS_COMPILE = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-musl
        CFLAGS_x86_64-unknown-linux-musl = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_musl
        CFLAGS_x86_64_unknown_linux_musl = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
        running: "musl-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/workspace/target/x86_64-unknown-linux-musl/release/build/zstd-sys-28f86fc799f53a62/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c"
      
        --- stderr
      
      
        error occurred: Failed to find tool. Is `musl-gcc` installed?
      
      
      warning: build failed, waiting for other jobs to finish...
      error: failed to compile `function v0.1.0 (/workspace)`, intermediate artifacts can be found at `/workspace/target`
unable to invoke layer creator
unable to contribute application layer
unable to install single
unable to build
exit status 101
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

Unable to launch after build

Hi,

I'm able to build the rust image using the paketobuildpacks/builder:full and --buildpack paketo-community/[email protected] but the container never starts. I tried to write my Procfile like that (among other tries) :

web: ROCKET_PORT=$PORT ROCKET_KEEP_ALIVE=0 ./layers/paketo-community_cargo/Cargo/bin/rust-buildpack-example-rocket

I've also tried ./workspace and all possible combinations. The code I'm trying to build is available here : https://github.com/emk/rust-buildpack-example-rocket

Do you know what I need to do to start the container after the build?

Thanks!

Alex

failed to build: Missing label

failed to build: invalid builder paketocommunity/rust: builder index.docker.io/paketocommunity/rust:latest missing label io.buildpacks.builder.metadata -- try recreating builder

New to this stuff, so not sure if this is the right place to start.

I get this error trying to use this builder with controlplane cli.

Any tips would be greatly appreciated

Unable to find process

Hey, I am trying out this rust buildpack, I followed the documentation and created a Builder image using example-builder.toml, and then I am running this command:

pack build docker.io/abc/rust-webserver-app -b docker.io/paketocommunity/rust -B docker.io/abc/rust-builder --network=host --trust-builder --publish

which is successfully creating an image but I see this in the command outpu:

===> EXPORTING
Adding 1/1 app layer(s)
Adding layer 'launcher'
Adding layer 'config'
Adding label 'io.buildpacks.lifecycle.metadata'
Adding label 'io.buildpacks.build.metadata'
Adding label 'io.buildpacks.project.metadata'
no default process type

and when I am trying to docker run the built image, its erroring out with this:

ERROR: failed to launch: determine start command: when there is no default process a command is required

Any ideas how I can solve this? I inspected the built image using pack inspect-image but I don't see any processes listed in the output. Also considering this is a composite buildpack, I had a brief look around and hoped that there would a process mentioned here: https://github.com/paketo-community/cargo/blob/main/scripts/build.sh but it isnt so.

Apologies if this is something silly, just starting out with buildpacks and a huge fan of the idea!

jam summarize no long works

Since rust-dist was moved off of packit and the buildpack.toml format changed in release v1.0.0, jam summarize no long plays nicely with the language family buildpack. Specifically, jam summarize fails in the create release workflow.. This is because there is some disconnect in the format of the buildpack.toml and what versions of packit expect since jam v0.14.1 and on.

The recourse here is either to roll back to an older version of packit/jam (the v0.14.0 or before). Eventually, a fix for this issue in packit should come out (there is an issue open for this already), but in order to get releases created with the current automation, rolling back might be necessary.

Update builder workflows

The workflow that is updating the builder is a one-off workflow. This was done because at the time the standard pipeline-builder workflow for updating a builder was not capable of running in a repo that was both a composite buildpack and a builder. This has since been fixed and the standard workflow should be OK for both in the same repo.

In addition, we should remove the update-lifecycle workflow. This isn't needed because our builder is not specifying a lifecycle, it's using the default one provided by pack.

This issue is a reminder to move back to the standard workflows.

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.