Skip to content

Build fails on Windows: openssl-sys unable to compile OpenSSL from source #96

@by-german

Description

@by-german

Description:

When attempting to build the application for production using cargo tauri build on Windows, the process fails while compiling the openssl-sys dependency. The error occurs during the OpenSSL configuration step, where perl reports a failure due to missing modules, resulting in exit code 2.

Steps to Reproduce:

  • Run cargo tauri build on a Windows environment.
  • Observe the build failing during the openssl-sys compilation phase.

Error Logs:

warning: openssl-sys@0.9.111: configuring OpenSSL build: 'perl' reported failure with exit code: 2
warning: openssl-sys@0.9.111: openssl-src: failed to build OpenSSL from source
error: failed to run custom build command for `openssl-sys v0.9.111`

Caused by:
  process didn't exit successfully: `...\target\release\build\openssl-sys-...\build-script-main` (exit code: 1)
  --- stdout
  ...
  running "perl" "./Configure" "--prefix=..." "VC-WIN64A"
  cargo:warning=configuring OpenSSL build: 'perl' reported failure with exit code: 2
  cargo:warning=openssl-src: failed to build OpenSSL from source

  --- stderr
  Can't locate Locale/Maketext/Simple.pm in @INC (you may need to install the Locale::Maketext::Simple module)
  ...
  BEGIN failed--compilation aborted at ./Configure line 23.

  Error configuring OpenSSL build:
      'perl' reported failure with exit code: 2

Environment:

  • OS: Windows 11
  • Command: cargo tauri build

Workaround / Solution:

I was able to resolve this issue by manually installing a complete Perl distribution (Strawberry Perl) and ensuring it was added to the system's PATH. After restarting the terminal and cleaning the cache (cargo clean), the build completed successfully.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions