DioxusLabs / DioxusLabs/dioxus

`subsecond` patching only works with `mold`

Open
#4,713 1 comment 0 reactions 0 assignees View on GitHub
bug subsecond
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

For me, hot-reloading code with subsecond only works using the `mold` linker, not using `clang` as the driver or the default configuration.

**Steps To Reproduce**

This is the repro:

```toml
subsecond = { version = "0.7.0-rc.0" }
dioxus-devtools = { version = "0.7.0-rc.0" }
```

```rs
use std::{thread::sleep, time::Duration};

fn main() {
dioxus_devtools::connect_subsecond();
loop {
subsecond::call(function);
sleep(Duration::from_secs(1));
}
}

fn function() {
println!("Hello, test!");
}
```

```
dx serve --hotpatch
```

**With no .cargo/config.toml**:

```
16:24:45 [dev] Build completed successfully in 76111us: "/home/jakob/dev/rust/subsecond-testing/target/x86_64-unknown-linux-gnu/desktop-dev/deps/subsecond_testing-43a175249eb0e694"
16:24:45 [dev] Original builds for patch: /tmp/.tmpZKZP99.txt
16:24:45 [dev] Failed to generate patch: collect2: fatal error: cannot find ‘ld’
```

**With linker = clang**:

```
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
```

```
[dev] Failed to generate patch: clang: error: invalid linker name in argument '-fuse-ld=lld'
```

I didn't have `lld` installed, but it works with a regular `cargo run`, so I'm reporting this anyways.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.