Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3664
Closed
Open
Issue created Aug 16, 2019 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] Rust server doesn't compile due to openssl crate version

Created by: TeFiLeDo

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

I generated rust code from the pet store example. Once I try to compile it, I get an error, stating that my OpenSSL version can't be found.

openapi-generator version

4.1.0

OpenAPI declaration file content or url

Pet Store Example

Command line used for generation
$  wget https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
$ openapi-generator generate -g rust-server -i petstore.yaml -o .
$ cargo build
Steps to reproduce
  1. install openapi generator
  2. run the commands listed above
  3. output (only the error message):
    error: failed to run custom build command for `openssl v0.9.24`
    process didn't exit successfully: `/tmp/petstore/target/release/build/openssl-b5ed42bc514b85ed/build-script-build` (exit code: 101)
    --- stderr
    thread 'main' panicked at 'Unable to detect OpenSSL version', /home/adrian/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
    note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
    
    warning: build failed, waiting for other jobs to finish...
    error: build failed
  4. rust backtrace:
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
                 at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
       1: std::sys_common::backtrace::_print
                 at src/libstd/sys_common/backtrace.rs:71
       2: std::panicking::default_hook::{{closure}}
                 at src/libstd/sys_common/backtrace.rs:59
                 at src/libstd/panicking.rs:197
       3: std::panicking::default_hook
                 at src/libstd/panicking.rs:211
       4: std::panicking::rust_panic_with_hook
                 at src/libstd/panicking.rs:474
       5: std::panicking::begin_panic
                 at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/panicking.rs:408
       6: build_script_build::main
                 at ./build.rs:16
       7: std::rt::lang_start::{{closure}}
                 at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/rt.rs:64
       8: std::panicking::try::do_call
                 at src/libstd/rt.rs:49
                 at src/libstd/panicking.rs:293
       9: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:87
      10: std::rt::lang_start_internal
                 at src/libstd/panicking.rs:272
                 at src/libstd/panic.rs:388
                 at src/libstd/rt.rs:48
      11: std::rt::lang_start
                 at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/rt.rs:64
      12: main
      13: __libc_start_main
      14: _start
Related issues/PRs

I didn't find a similar issue.

Suggest a fix

It seems that error is due to openapi generator using an old version of rusts OpenSSL bindings. I found this issue in the repository of these bindings.

Assignee
Assign to
Time tracking