Skip to content

Rust doesn't compile openssl library on MacOSX #2167

@ineiti

Description

@ineiti

What happened?

I have a rust project which uses openssl. Now I would like to have a reproducible build using devbox. But when I use rustup from devbox, the compilation fails at linking time.

I tried the same repo with flox and a locally installed rust, which compiles and runs fine!

Steps to reproduce

Clone the repo, start the shell, and compile parts of it:

git clone https://github.com/ineiti/fledger
cd fledger
devbox shell
cd cli/fledger
cargo build

The final output of the linker is this:

  = note: ld: framework not found Security
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

Command

shell

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.7/.schema/devbox.schema.json",
  "packages": [
    "which@latest",
    "rustup@latest",
    "libiconv@latest",
    "openssl@latest",
    "vscode",
  ],
  "shell": {
    "init_hook": [
      "if [ ! -d $RUSTUP_HOME/toolchains -o ! -d $RUSTUP_HOME/toolchains/stable ]; then rustup default stable; fi",
    ],
    "scripts": {
      "test": [
        "make cargo_test",
      ],
    },
  },
}

Devbox version

0.11.1

Nix version

nix (Nix) 2.23.0

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions