trunk-rs / trunk

Build, bundle & ship your Rust WASM application to the web.
https://trunkrs.dev/
Apache License 2.0
3.56k stars 254 forks source link

errors: copy-dir symlink to directory and copy-file symlink to directory #921

Open nalply opened 5 days ago

nalply commented 5 days ago

I have a <link data-trunk rel=copy-dir href=symlink> in my index.html. However this doesn't build, error message:

2024-11-29T15:38:21.215479Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: the source path is neither a regular file nor a symlink to a regular file

When removing that asset, it builds fine, however I need that directory. When I copy the whole directory in a pre-build step or copy the symlink manually, it works, but it will be deleted the next time trunk builds.

rel=copy-file also fails, but differently:

2024-11-29T15:39:54.667304Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: error reading file for copying "/home/nalp/Projects/some-project/symlink-target"
    3: Is a directory (os error 21)

I think both should work, the first one copies the directory the symlink points to, the other one copies the symlink itself.

ctron commented 5 days ago

Which version of trunk are you using?

nalply commented 5 days ago

0.21.4