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

Properly support UNC paths on the command line #1258

Open
dnaka91 opened this issue Mar 13, 2021 · 5 comments
Open

Properly support UNC paths on the command line #1258

dnaka91 opened this issue Mar 13, 2021 · 5 comments
Labels
blocked Waiting on another issue to be fixed

Comments

@dnaka91
Copy link

dnaka91 commented Mar 13, 2021

As a new feature of the project trunk we auto-download dart-sass to the local device and then execute it as one of our pipelines. Before we used a directly compiled library that integrates with libsass but as that's deprecated we want to move to dart-sass.

In Rust, paths are quickly turned into UNC paths like \\?\C:\Users\Me\... through stdlib logic. We try to turn them back into the legacy-style C:\Users\Me\... paths but that may not always work due to path length limits and so on.

Therefore, it would be great if dart-sass could support UNC paths for input/output files.

@jathak
Copy link
Member

jathak commented Mar 15, 2021

Sass operates on URLs, not on paths, so we don't plan to add support for any OS-specific paths. If you're converting paths into another format anyway, should you instead convert to a file URL.

@jathak jathak closed this as completed Mar 15, 2021
@dnaka91
Copy link
Author

dnaka91 commented Mar 18, 2021

I tried out using dart-sass with file URLs now and they don't work neither. Just to clarify, I'm talking about paths to files in the terminal that are passed to dart-sass and not import statements or anything alike.

So I added a conversion step before calling dart-sass, now passing file:///.... instead and that works neither on UNIX nor Windows systems. It fails with Duplicate source "file". similar to the problem with UNC paths.

@dnaka91
Copy link
Author

dnaka91 commented Mar 18, 2021

I think the actual problem is the <input>:<output> syntax so it misunderstands anything with a colon as this mapping.

@jathak
Copy link
Member

jathak commented Mar 18, 2021

Ah, I see. I misread this as an issue with using the API, not the command line. OS paths passed on the command line should indeed be converted to URLs, so I'll reopen this, targeted to fixing that for UNC paths

@jathak jathak reopened this Mar 18, 2021
@jathak jathak changed the title Doesn't support Windows verbatim UNC paths Properly support UNC paths on the command line Mar 18, 2021
@Awjin
Copy link
Contributor

Awjin commented Mar 19, 2021

Dart's path package currently does not support the \\?\ prefix for UNC paths. I've filed a bug with the path repo here: dart-lang/path#106.

@Awjin Awjin added the blocked Waiting on another issue to be fixed label Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on another issue to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants