DioxusLabs / DioxusLabs/dioxus
Boilerplate project from `dx new` does not build
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
I am trying to get up and running with the tutorial, but the resulting project does not compile with `dx build` (though it does build with `cargo build`).
**Steps To Reproduce**
Steps to reproduce the behavior:
For maximum reproducibility, this is the *shell.nix* file I am using:
```nix
let
# a recent commit to the unstable channel
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/fa35a3c8e17a3de613240fea68f876e5b4896aec.tar.gz";
pkgs = import nixpkgs {
config = { };
overlays = [];
};
in
pkgs.mkShell {
buildInputs = with pkgs;[
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
gtk3
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
openssl
];
nativeBuildInputs = with pkgs; [
pkg-config
gobject-introspection
cargo
cargo-tauri
nodejs
];
packages = with pkgs; [
dioxus-cli
emacs
git
wasm-pack
];
RUST_BACKTRACE = 1;
RUSTFLAGS = "-Awarnings";
}
```
Then:
```bash
dx --version
[el@nixos:~]$ dx --version
dioxus 0.6.0 (was built without git repository)
[el@nixos:~]$ dx new hot_dog
โ ๐คท Which sub-template should be expanded? ยท Bare-Bones
โ ๐คท Do you want to use Dioxus Fullstack? ยท false
โ ๐คท Do you want to use Dioxus Router? ยท false
โ ๐คท Do you want to use Tailwind CSS? ยท false
โ ๐คท Which platform do you want DX to serve by default? ยท Web
[ 1/15] โ
[ 2/15] โ
[ 3/15] โ
[ 4/15] โ
[ 5/15] โ
[ 6/15] โ
[ 7/15] โ
[ 8/15] โ
[ 9/15] โ
[10/15] โ
[11/15] โ
[12/15] โ
[13/15] โ
[14/15] โ
[15/15] โ
30.37s ERROR cargo fmt failed
30.37s ERROR stdout:
30.38s ERROR stderr: error: no such command: `fmt`
Did you mean `fix`?
View all installed commands with `cargo --list`
Find a package to install `fmt` with `cargo search cargo-fmt`
30.38s INFO Generated project at /home/el/hot_dog
30.38s INFO `cd` to your project and run `dx serve` to start developing. Build cool things! โ๏ธ
[el@nixos:~]$ cd hot_dog/
[el@nixos:~/hot_dog]$ ls
assets Cargo.toml Dioxus.toml README.md src
[el@nixos:~/hot_dog]$ dx serve
18:36:01 [dev] Failed to verify tooling: I/O Error: No such file or directory (os error 2)
dx will proceed, but you might run into errors later.
18:36:01 [dev] -----------------------------------------------------------------
Serving your Dioxus app: hot_dog ๐
โข Press `ctrl+c` to exit the server
โข Press `r` to rebuild the app
โข Press `o` to open the app
โข Press `v` to toggle verbose logging
โข Press `/` for more commands and shortcuts
Learn more at https://dioxuslabs.com/learn/0.6/getting_started
----------------------------------------------------------------
18:36:02 [dev] Cargo build failed - no output location
18:36:02 [dev] Build failed: Other(Build did not return an executable
Stack backtrace:
0: dx::build::request::BuildRequest::build_app::{{closure}}
1: as core::future::future::Future>::pol
2: as core::future::future::Future>::poll
3: dx::build::request::BuildRequest::build_all::{{closure}}
4: dx::build::builder::Builder::start::{{closure}}
5: tokio::runtime::task::core::Core::poll
6: tokio::runtime::task::harness::Harness::poll
7: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
8: tokio::runtime::scheduler::multi_thread::worker::Context::run
9: tokio::runtime::context::scoped::Scoped::set
10: tokio::runtime::context::runtime::enter_runtime
11: tokio::runtime::scheduler::multi_thread::worker::run
12: as core::future::future::Future>::poll
13: tokio::runtime::task::core::Core::poll
14: tokio::runtime::task::harness::Harness::poll
15: tokio::runtime::blocking::pool::Inner::run
16: std::sys::backtrace::__rust_begin_short_backtrace
17: core::ops::function::FnOnce::call_once{{vtable.shim}}
18: std::sys::pal::unix::thread::Thread::new::thread_start
19: start_thread
20: __GI___clone3)
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ /:more โฎ
โ App: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ Platform: Web โ
โ Bundle: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ App features: ["web"] โ
โ Status: Failed Serving at: http://127.0.0.1:8080 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[el@nixos:~/hot_dog]$ dx serve --trace --verbose
18:36:45 [dev] Loading crate
18:36:45 [dev] Found package NodeIndex(52)
18:36:45 [dev] failed to read `dioxus/settings.toml` config file
18:36:45 [dev] Autodetecting platform from feature asset
18:36:45 [dev] Autodetecting platform from feature cli-config
18:36:45 [dev] Autodetecting platform from feature default
18:36:45 [dev] Autodetecting platform from feature devtools
18:36:45 [dev] Autodetecting platform from feature document
18:36:45 [dev] Autodetecting platform from feature file_engine
18:36:45 [dev] Autodetecting platform from feature hooks
18:36:45 [dev] Autodetecting platform from feature html
18:36:45 [dev] Autodetecting platform from feature launch
18:36:45 [dev] Autodetecting platform from feature logger
18:36:45 [dev] Autodetecting platform from feature macro
18:36:45 [dev] Autodetecting platform from feature mounted
18:36:45 [dev] Autodetecting platform from feature signals
18:36:45 [dev] Autodetecting platform from feature warnings
18:36:45 [dev] Autodetecting platform from feature web
18:36:45 [dev] Could not find explicit feature for platform server, passing `fallback` instead
18:36:45 [dev] Verifying tooling...
18:36:45 [dev] Watching path "/home/el/hot_dog/Cargo.toml"
18:36:45 [dev] Watching path "/home/el/hot_dog/README.md"
18:36:45 [dev] Watching path "/home/el/hot_dog/src"
18:36:45 [dev] Watching path "/home/el/hot_dog/Dioxus.toml"
18:36:45 [dev] Watching path "/home/el/hot_dog/assets"
18:36:45 [dev] Watching path "/home/el/hot_dog"
18:36:45 [dev] -----------------------------------------------------------------
Serving your Dioxus app: hot_dog ๐
โข Press `ctrl+c` to exit the server
โข Press `r` to rebuild the app
โข Press `o` to open the app
โข Press `v` to toggle verbose logging
โข Press `/` for more commands and shortcuts
Learn more at https://dioxuslabs.com/learn/0.6/getting_started
----------------------------------------------------------------
18:36:45 [dev] Failed to verify tooling: I/O Error: No such file or directory (os error 2)
dx will proceed, but you might run into errors later.
18:36:45 [dev] Running build command...
18:36:45 [dev] Building app...
18:36:45 [dev] Initialized Root dir: "/home/el/hot_dog/target/dx/hot_dog/debug/web/public"
18:36:45 [dev] Initialized Exe dir: "/home/el/hot_dog/target/dx/hot_dog/debug/web/public/wasm"
18:36:45 [dev] Initialized Asset dir: "/home/el/hot_dog/target/dx/hot_dog/debug/web/public/assets"
18:36:45 [dev] Executing cargo...
18:36:45 [dev] cargo args: ["--profile", "wasm-dev", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "hot_dog"]
18:36:45 [dev] Building server...
18:36:45 [dev] cargo args: ["--profile", "wasm-dev", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "hot_dog"]
18:36:45 [dev] Rust cargo args: Command {
std: Command {
program: "cargo",
args: [
"cargo",
"rustc",
"--message-format",
"json-diagnostic-rendered-ansi",
"--profile",
"wasm-dev",
"--target",
"wasm32-unknown-unknown",
"--verbose",
"--features",
"web",
"--bin",
"hot_dog",
],
cwd: Some(
"/home/el/hot_dog",
),
create_pidfd: false,
},
kill_on_drop: false,
}
18:36:45 [cargo] error: output of --print=file-names missing when learning about target-specific information from rustc
18:36:45 [cargo] command was: `rustc - --crate-name ___ --print=file-names -Awarnings --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg`
18:36:45 [cargo]
18:36:45 [cargo] --- stdout
18:36:45 [cargo] ___.wasm
18:36:45 [cargo] lib___.rlib
18:36:45 [cargo] ___.wasm
18:36:45 [cargo] lib___.a
18:36:45 [cargo] /nix/store/4i3a50ysjh079pxbpbnx9cg766sw1fr6-rustc-1.84.0
18:36:45 [cargo] off
18:36:45 [cargo] ___
18:36:45 [cargo] debug_assertions
18:36:45 [cargo] panic="abort"
18:36:45 [cargo] proc_macro
18:36:45 [cargo] target_abi=""
18:36:45 [cargo] target_arch="wasm32"
18:36:45 [cargo] target_endian="little"
18:36:45 [cargo] target_env=""
18:36:45 [cargo] target_family="wasm"
18:36:45 [cargo] target_feature="multivalue"
18:36:45 [cargo] target_feature="mutable-globals"
18:36:45 [cargo] target_feature="reference-types"
18:36:45 [cargo] target_feature="sign-ext"
18:36:45 [cargo] target_has_atomic="16"
18:36:45 [cargo] target_has_atomic="32"
18:36:45 [cargo] target_has_atomic="64"
18:36:45 [cargo] target_has_atomic="8"
18:36:45 [cargo] target_has_atomic="ptr"
18:36:45 [cargo] target_os="unknown"
18:36:45 [cargo] target_pointer_width="32"
18:36:45 [cargo] target_vendor="unknown"
18:36:45 [cargo]
18:36:45 [dev] Cargo build failed - no output location
18:36:45 [dev] Setting builder to failed state
18:36:45 [dev] Build failed: Other(Build did not return an executable
Stack backtrace:
0: dx::build::request::BuildRequest::build_app::{{closure}}
1: as core::future::future::Future>::pol
2: as core::future::future::Future>::poll
3: dx::build::request::BuildRequest::build_all::{{closure}}
4: dx::build::builder::Builder::start::{{closure}}
5: tokio::runtime::task::core::Core::poll
6: tokio::runtime::task::harness::Harness::poll
7: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
8: tokio::runtime::scheduler::multi_thread::worker::Context::run
9: tokio::runtime::context::scoped::Scoped::set
10: tokio::runtime::context::runtime::enter_runtime
11: tokio::runtime::scheduler::multi_thread::worker::run
12: as core::future::future::Future>::poll
13: tokio::runtime::task::core::Core::poll
14: tokio::runtime::task::harness::Harness::poll
15: tokio::runtime::blocking::pool::Inner::run
16: std::sys::backtrace::__rust_begin_short_backtrace
17: core::ops::function::FnOnce::call_once{{vtable.shim}}
18: std::sys::pal::unix::thread::Thread::new::thread_start
19: start_thread
20: __GI___clone3)
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ /:more โฎ
โ App: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ Platform: Web โ
โ Bundle: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ App features: ["web"] โ
โ Status: Failed Serving at: http://127.0.0.1:8080 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
```
I can produce the same behavior as well by removing `dioxus-cli` from the *shell.nix*, removing *~/.cargo/*, and starting from `cargo install dx`.
**Expected behavior**
I would expect the freshly-generated project to build successfully.
**Screenshots**
**Environment:**
- Dioxus version: 0.6.0 from nixpkgs and 0.6.3 from cargo
- Rust version: (using the version packaged with `dioxus-cli` and `cargo` in the unstable nix channel
- OS info: NixOS
- App platform: web
**Questionnaire**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.