Skip to content

Windows builds broken: Rollup creates files with colons in the name #16

@NfNitLoop

Description

@NfNitLoop

Summary

When Snowpack generates files via snowpack build, it ends up generating files that have colons in the name.

Initially, these seem to work when I'm running the rust server in dev. mode, which passes through file requests to the underlying file system. However, when I attempt to do a release build, which bundles files up into the executable, the required files do not exist.

This also breaks the ability for rollup to do a release build. It itself can't find the files it generated. 😣

Steps to reproduce

Take a look in build/web_modules/common

  • On Linux/MacOS, you'll likely see a file named __node-resolve:empty-1777c4cc.js
  • ⚠️ But on Windows the file will be called __node-resolve. It will be 0 bytes.

This is because file names can't have a colon in them on Windows. However, file paths can have a colon in them, which causes the bit after the colon to be interpreted as a stream when using NTFS file systems. You can see this in this output:

C:\Users\Cody\code\feoblog\web-client\build\web_modules\common>dir /r __node-resolve
 Volume in drive C has no label.
 Volume Serial Number is 3894-D9B7

 Directory of C:\Users\Cody\code\feoblog\web-client\build\web_modules\common

02/20/2021  09:41 PM                 0 __node-resolve
                                   358 __node-resolve:empty-1777c4cc.js:$DATA
               1 File(s)              0 bytes
               0 Dir(s)  357,425,332,224 bytes free

This issue still exists even if I upgrade to Snowpack v3.

I'm not sure if this is a Snowpack bug or a Rollup bug, so I've just reported it here against my own code until I find the culprit. :)

A bit more detail

This seems to work in dev mode because the expected file name is directly requested via the browser. RustEmbed then asks the filesystem for that file path, which also ends up opening the NTFS data stream.

However, bundling the files likely just lists files on disk and tries to include them in the binary. Likewise, copying or zipping the files would probably break this functionality. Right now this is a blocker to having a working feoblog web client on Windows. 😢

See:

Current Status

To do:

  • Work with the Rollup team to merge and release Don't allow : in file names. rollup/rollup#3972
  • Ping the Snowpack team to create a release w/ that version.
  • Update Feoblog to use that version of Snowpack
  • Abandon Snowpack, switch to esbuild.
  • Confirm it works on Windows.
  • Enable Windows build automation.
  • Release a Windows build

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnext-releaseThis feature will be part of the next releaseupstreamWaiting on a bug fix in an upstream dependency

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions