dioxus
dioxus copied to clipboard
Bundle error on Linux: dx bundle copy the dist/bundle into itself endlessly
Problem
If i try to bundle a project, I get the following error:
Adding assets from dist to bundle
thread 'main' panicked at packages/cli/src/cli/bundle.rs:193:13:
Failed to bundle project: BundlerError(
Error {
context: "Failed to build data folders and files",
source: BundlerError(
Error {
context: "Failed to copy resource files",
source: IoError(
Os {
code: 36,
kind: InvalidFilename,
message: "File name too long",
},
),
},
),
},
)
in Dioxius the out_dir is "dist" and looking into the content of dist/bundle
there is a recursive patern:
packages/cli/dist/bundle/deb/dx_0.5.4_amd64/data/usr/lib/dx/dist/bundle/deb/dx_0.5.4_amd64/data/usr/lib/dx/dist/bundle/deb/dx_0.5.4_amd64/data/usr/lib/dx/dist/bundle/deb/dx_0.5.4_amd64/data/usr/lib/dx/dist/bundle
it seems that during the bundle process, bundle try to copy the out_dir
content into out_dir/bundle
but doesn't ignore the content of out_dir/bundle
itself
Steps To Reproduce
Steps to reproduce the behavior:
- cd into
packages/cli
- run
cargo run -- bundle
for the context, I first tried to bundle a project of my own
Expected behavior
AppImage and other bundle files being generated
Environment:
- Dioxus version: origin/main and 5.4.0
- Rust version: stable-x86_64-unknown-linux-gnu - rustc 1.79.0-nightly and 1.77.1
- OS info: Fedora 40 (linux)
- App platform:
desktop
Questionnaire
- [x] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
the same happens here on Arch
Yeah, it don't really make sens for it to be specific to fedora if the pkg manager is not involved.
For the fedora part, I suspected that it wasn't linked to SELinux being activated or other tweaks, but I did not try on other distros.
I tried to change the current way bundle_settings.resources is set to filter the bundle folder, and it now fails later on build_appimage.sh
script, so I guess I still need to look into it
(EDIT: resolved by not using .
as asset dir, needs to be a proper subdirectory. Still maybe worth checking out?)
this might be related: every time I run dx serve
(on MacOS), a new dist
directory gets created inside the innermost existing one, i.e. after five invocations I have:
❯ ls -l dist/dist/dist/dist/dist
total 16
-rw------- 1 ace staff 365 Apr 8 02:20 Cargo.toml
drwxr-xr-x 3 ace staff 96 Apr 30 19:39 assets
-rw-r--r-- 1 ace staff 328 Apr 8 02:22 tailwind.config.js
and in the parent directory:
❯ ls -l dist/dist/dist/dist
total 344
-rw-r--r-- 1 ace staff 137232 Apr 8 02:20 Cargo.lock
-rw------- 1 ace staff 365 Apr 8 02:20 Cargo.toml
-rw-r--r-- 1 ace staff 674 Apr 30 19:25 Dioxus.toml
drwxr-xr-x 3 ace staff 96 Apr 30 19:38 assets
drwxr-xr-x 5 ace staff 160 Apr 30 19:39 dist
-rw-r--r-- 1 ace staff 1449 Apr 30 19:38 index.html
-rw-r--r-- 1 ace staff 140 Apr 8 02:34 input.css
drwxr-xr-x 3 ace staff 96 Apr 30 19:39 public
drwxr-xr-x 4 ace staff 128 Apr 30 19:39 src
-rw-r--r-- 1 ace staff 328 Apr 8 02:22 tailwind.config.js
-rw-r--r-- 1 ace staff 11518 Apr 8 02:44 tailwind.css
-rw-r--r-- 1 ace staff 0 Apr 30 19:36 tailwindcss6f3038fd9a568531.css
my config:
# ❯ grep -v '^#' Dioxus.toml | grep .
[application]
name = "timeline-editor"
default_platform = "web"
asset_dir = "."
[web.app]
title = "ouuuhhh"
[web.watcher]
reload_html = true
watch_path = ["src", "."]
[web.resource]
style = ["tailwind.css"]
script = []
[web.resource.dev]
script = []