Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kn func 1.9.0 fails to build a Rust Service #227

Open
No9 opened this issue Feb 27, 2023 · 3 comments
Open

kn func 1.9.0 fails to build a Rust Service #227

No9 opened this issue Feb 27, 2023 · 3 comments
Labels
type:bug A general bug

Comments

@No9
Copy link

No9 commented Feb 27, 2023

Using the following commands:

kn func create -l rust func-demo
cd func-demo
kn func build --registry=quay.io/CONTAINER_ORG --push

The build errors with the following output:

...
Rust Cargo Build Pack 0.9.0
  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
  Tini 0.19.0: Contributing to layer
    Downloading from https://github.com/krallin/tini/releases/download/v0.19.0/tini-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=.
        Installing function v0.1.0 (/workspace)
      error: failed to get `actix-http` as a dependency of package `function v0.1.0 (/workspace)`
      
      Caused by:
        failed to load source for dependency `actix-http`
      
      Caused by:
        Unable to update registry `crates-io`
      
      Caused by:
        usage of sparse registries requires `-Z sparse-registry`

This line looks suspicious but I have not investigated further

Unable to update registry `crates-io`
@No9 No9 changed the title kn func 1.9.0 fails to build kn func 1.9.0 fails to build a Rust Service Feb 27, 2023
@dmikusa dmikusa added the type:bug A general bug label Feb 28, 2023
@dmikusa
Copy link
Contributor

dmikusa commented Feb 28, 2023

What version of Rust is being installed? Is it being installed with paketo-community/rustup or with the paketo-community/rust-dist buildpack?

@edude03
Copy link

edude03 commented Dec 21, 2023

Looks like the rust version they're using is too old? usage of sparse registries requires -Z sounds like it

@dmikusa
Copy link
Contributor

dmikusa commented Dec 23, 2023

Yes, that could be. We set CARGO_REGISTRIES_CRATES_IO_PROTOCOL to sparse because it is way, way faster for builds.

At the moment, it's not something you can change but if there's a need to be flexible we could accept a PR that allows the user to override it. Presently, we just set that env variable but if you check to see if it's set first, and skip setting if it is set, that would allow the user to override it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants