Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle error on Linux: dx bundle copy the dist/bundle into itself endlessly #2239

Closed
1 of 3 tasks
SadCl0wn opened this issue Apr 4, 2024 · 4 comments · Fixed by #2419
Closed
1 of 3 tasks

Bundle error on Linux: dx bundle copy the dist/bundle into itself endlessly #2239

SadCl0wn opened this issue Apr 4, 2024 · 4 comments · Fixed by #2419

Comments

@SadCl0wn
Copy link

SadCl0wn commented Apr 4, 2024

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

  • 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
@Beiri22
Copy link

Beiri22 commented Apr 4, 2024

the same happens here on Arch

@tkr-sh
Copy link
Contributor

tkr-sh commented Apr 5, 2024

Yeah, it don't really make sens for it to be specific to fedora if the pkg manager is not involved.

@SadCl0wn
Copy link
Author

SadCl0wn commented Apr 5, 2024

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

@SadCl0wn SadCl0wn changed the title Bundle error on Fedora Linux: dx bundle copy the dist/bundle into itself endlessly Bundle error on Linux: dx bundle copy the dist/bundle into itself endlessly Apr 5, 2024
@spookyvision
Copy link
Contributor

spookyvision commented Apr 30, 2024

(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 = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants