Skip to content

Build fails with OpenSSL header issues on Ubuntu 24.04 + Nix environment causes runtime library path conflicts #72

Open

Description

@uptownhr

Environment

  • OS: Ubuntu 24.04.2 LTS
  • Rust: 1.88.0
  • Cargo: 1.88.0
  • Node: v20.18.0
  • Bun: 1.2.17
  • Nix: Present in environment

Issue Description

Encountered two separate but related build/runtime issues when building Claudia:

1. OpenSSL Development Headers Not Found

Error:

warning: openssl-sys@0.9.109: /usr/include/openssl/macros.h:14:10: fatal error: openssl/opensslconf.h: No such file or directory
error: failed to run custom build command for `openssl-sys v0.9.109`

Root Cause:
On Ubuntu 24.04, OpenSSL headers are located in /usr/include/x86_64-linux-gnu/openssl/ but the build system looks in /usr/include/openssl/.

Solution:
Even with libssl-dev and pkg-config installed, needed to create symbolic links:

sudo ln -sf /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h
sudo ln -sf /usr/include/x86_64-linux-gnu/openssl/configuration.h /usr/include/openssl/configuration.h

2. Nix Environment Contamination

Error:

claudia: error while loading shared libraries: liblzma.so.5: cannot open shared object file: No such file or directory

Root Cause:
When built inside a Nix shell, the binary gets hardcoded RUNPATH pointing to non-existent Nix store paths:

$ readelf -d claudia | grep RUNPATH
Library runpath: [/home/user/outputs/out/lib:/nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib:/nix/store/...]

Solution:
Build outside of Nix environment:

exit  # exit nix shell
cargo clean
bun run tauri build

Suggested Improvements

  1. Documentation: Add Ubuntu 24.04 specific build instructions mentioning the OpenSSL symlink requirement
  2. Build Script: Consider adding a pre-build check for OpenSSL headers in platform-specific locations
  3. Nix Compatibility: Add warning in docs about Nix environment contamination or provide nix-specific build instructions
  4. CI/CD: Test builds on Ubuntu 24.04 to catch these issues early

Reproduction Steps

  1. Start with clean Ubuntu 24.04 system
  2. Install standard Rust/Node/Bun toolchain
  3. Enter Nix shell (if using Nix)
  4. Run bun run tauri build
  5. Observe OpenSSL build failures
  6. After fixing OpenSSL issues, observe runtime library path issues

Workaround Summary

For Ubuntu 24.04 users:

  1. Create OpenSSL header symlinks as shown above
  2. Ensure you're NOT in a Nix shell when building
  3. Build should complete successfully

Activity

  1. commandodev commented on Jun 30, 2025

    @commandodev

    @uptownhr - I've just created pr #82 which adds a nix flake to this project

  2. mbana commented on Jun 16, 2026

    @mbana

    Environment

    • OS: Ubuntu 24.04.2 LTS
    • Rust: 1.88.0
    • Cargo: 1.88.0
    • Node: v20.18.0
    • Bun: 1.2.17
    • Nix: Present in environment

    Issue Description

    Encountered two separate but related build/runtime issues when building Claudia:

    1. OpenSSL Development Headers Not Found

    Error:

    warning: openssl-sys@0.9.109: /usr/include/openssl/macros.h:14:10: fatal error: openssl/opensslconf.h: No such file or directory
    error: failed to run custom build command for `openssl-sys v0.9.109`
    

    Root Cause: On Ubuntu 24.04, OpenSSL headers are located in /usr/include/x86_64-linux-gnu/openssl/ but the build system looks in /usr/include/openssl/.

    Solution: Even with libssl-dev and pkg-config installed, needed to create symbolic links:

    sudo ln -sf /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h
    sudo ln -sf /usr/include/x86_64-linux-gnu/openssl/configuration.h /usr/include/openssl/configuration.h

    2. Nix Environment Contamination

    Error:

    claudia: error while loading shared libraries: liblzma.so.5: cannot open shared object file: No such file or directory
    

    Root Cause: When built inside a Nix shell, the binary gets hardcoded RUNPATH pointing to non-existent Nix store paths:

    $ readelf -d claudia | grep RUNPATH
    Library runpath: [/home/user/outputs/out/lib:/nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib:/nix/store/...]
    

    Solution: Build outside of Nix environment:

    exit # exit nix shell
    cargo clean
    bun run tauri build

    Suggested Improvements

    1. Documentation: Add Ubuntu 24.04 specific build instructions mentioning the OpenSSL symlink requirement
    2. Build Script: Consider adding a pre-build check for OpenSSL headers in platform-specific locations
    3. Nix Compatibility: Add warning in docs about Nix environment contamination or provide nix-specific build instructions
    4. CI/CD: Test builds on Ubuntu 24.04 to catch these issues early

    Reproduction Steps

    1. Start with clean Ubuntu 24.04 system
    2. Install standard Rust/Node/Bun toolchain
    3. Enter Nix shell (if using Nix)
    4. Run bun run tauri build
    5. Observe OpenSSL build failures
    6. After fixing OpenSSL issues, observe runtime library path issues

    Workaround Summary

    For Ubuntu 24.04 users:

    1. Create OpenSSL header symlinks as shown above
    2. Ensure you're NOT in a Nix shell when building
    3. Build should complete successfully

    At the moment, I can't tell you why but I can tell you that I experienced the same issue with a similar environment - I am using Nix package manager.

    My work-around was to simply to remove /home/mbana/.nix-profile/bin and /nix/var/nix/profiles/default/bin like below (note: I am running in WSL) from PATH.

    If anyone knows why this made a difference, please do share.

    # PATH before:
    $ echo $PATH
    # /home/mbana/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/mbana/bin:/home/mbana/.local/bin:/home/mbana/.cargo/env:/home/mbana/go/bin:/home/mbana/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/coreutils/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Tailscale:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Microsoft VS Code Insiders/bin:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/mnt/c/Program Files/PowerShell/7:/mnt/c/Program Files/dotnet:/mnt/c/Program Files (x86)/Qualcomm/QIKToolV3/3.0.54.2:/mnt/c/Program Files (x86)/Qualcomm/Qualcomm_Software_Center/1.26.3.0:/mnt/c/Program Files (x86)/Qualcomm/QUTSStatusApp:/mnt/c/Program Files (x86)/Qualcomm/PCAT/bin:/mnt/c/Program Files (Arm)/Qualcomm/QualcommProfiler/CLI/target-wos/bins:/mnt/c/Program Files/usbipd-win/:/mnt/c/Users/moham/AppData/Local/Programs/Python/Python39/Scripts:/mnt/c/Users/moham/AppData/Local/Programs/Python/Python39:/mnt/c/Users/moham/.local/bin:/mnt/c/Users/moham/.cargo/bin:/mnt/c/Users/moham/.bin:/mnt/c/Users/moham/bin:/mnt/c/Program Files (x86)/GnuWin32/bin:/mnt/c/Program Files (x86)/Dr. Memory/bin:/mnt/c/Users/moham/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/moham/AppData/Local/PowerToys/DSCModules:/mnt/c/Users/moham/AppData/Local/Microsoft/WinGet/Links:/mnt/c/Users/moham/AppData/Local/Microsoft/WinGet/Packages/Google.PlatformTools_Microsoft.Winget.Source_8wekyb3d8bbwe/platform-tools
    
    PATH='/home/mbana/bin:/home/mbana/.local/bin:/home/mbana/.cargo/env:/home/mbana/go/bin:/home/mbana/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/coreutils/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Tailscale:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Microsoft VS Code Insiders/bin:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/mnt/c/Program Files/PowerShell/7:/mnt/c/Program Files/dotnet:/mnt/c/Program Files (x86)/Qualcomm/QIKToolV3/3.0.54.2:/mnt/c/Program Files (x86)/Qualcomm/Qualcomm_Software_Center/1.26.3.0:/mnt/c/Program Files (x86)/Qualcomm/QUTSStatusApp:/mnt/c/Program Files (x86)/Qualcomm/PCAT/bin:/mnt/c/Program Files (Arm)/Qualcomm/QualcommProfiler/CLI/target-wos/bins:/mnt/c/Program Files/usbipd-win/:/mnt/c/Users/moham/AppData/Local/Programs/Python/Python39/Scripts:/mnt/c/Users/moham/AppData/Local/Programs/Python/Python39:/mnt/c/Users/moham/.local/bin:/mnt/c/Users/moham/.cargo/bin:/mnt/c/Users/moham/.bin:/mnt/c/Users/moham/bin:/mnt/c/Program Files (x86)/GnuWin32/bin:/mnt/c/Program Files (x86)/Dr. Memory/bin:/mnt/c/Users/moham/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/moham/AppData/Local/PowerToys/DSCModules:/mnt/c/Users/moham/AppData/Local/Microsoft/WinGet/Links:/mnt/c/Users/moham/AppData/Local/Microsoft/WinGet/Packages/Google.PlatformTools_Microsoft.Winget.Source_8wekyb3d8bbwe/platform-tools'
    # Now it should work.
    cargo build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions