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

[bug]: Stacked compile producing malformed file on Windows #1147

Open
Pebkac03 opened this issue Dec 11, 2024 · 2 comments · May be fixed by Stacked-Org/cli#52
Open

[bug]: Stacked compile producing malformed file on Windows #1147

Pebkac03 opened this issue Dec 11, 2024 · 2 comments · May be fixed by Stacked-Org/cli#52
Labels

Comments

@Pebkac03
Copy link

Pebkac03 commented Dec 11, 2024

Describe the bug

Running stacked compile when developing stacked-org/cli on Windows causes the path strings in lib/src/templates/compiled_templates.dart to be malformed due to \ not being escaped.

But now for the fun part: this generated file contains errors on around 200 lines of code, but what can we do to fix this?
Literally add a single character to two lines of code in another file. The only thing that would be easier is it being on one line... unless it would cause other problems (hasn't for me), hence no PR yet.

Proposed fix: add an "r" before '{{path}}' here and here to generate raw strings instead of strings in the compiled_templates.dart.

Oh, almost forgot to steal your joke: "Just use Linux" is not an easier solution than adding two "r":s 😊

What operating system do you use?

Windows

Information about the installed tooling

No response

Steps to reproduce the issue

  1. Clone stacked to windows machinge
  2. run "dart run bin/stacked.dart compile" in the repo
  3. Watch errors galore in your linter or with flutter analyze

Expected behavior

No response

Screenshots

No response

Additional Context

There is explicit instruction in compiled_templates.dart that it should be included in version control, don't know the reason for this so can't speak to the results of the file having \ path separator instead of / when pushed to upstream.

@FilledStacks
Copy link
Contributor

Haha. Yeah, windows will be a bit of a problem since neither me or @ferrarafer has a windows machine that we work with.

I'll label as p3 for now for us to fix, or you to make a PR if it becomes too bothersome.

@Pebkac03 Pebkac03 linked a pull request Dec 12, 2024 that will close this issue
@Pebkac03
Copy link
Author

Did a fairly simple fix, just a replaceAll on the paths before writing to the file to change all windows separators to Unix style.

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

Successfully merging a pull request may close this issue.

2 participants