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

fix: windows compatibility #1996

Merged

Conversation

timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Aug 9, 2024

Description

i installed Windows ARM on my Mac, and fixed all compatibility issues which were marked as "skipOnWindows" in tests.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented Aug 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 8:36am

Copy link

github-actions bot commented Aug 9, 2024

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 2.88 KB (0%)
./packages/detect-locale/dist/index.mjs 723 B (0%)
./packages/react/dist/index.mjs 1.65 KB (0%)
./packages/remote-loader/dist/index.mjs 7.26 KB (0%)

@timofei-iatsenko timofei-iatsenko changed the title Fix/windows compatibility fix: windows compatibility Aug 9, 2024
@timofei-iatsenko timofei-iatsenko mentioned this pull request Aug 9, 2024
8 tasks
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.16%. Comparing base (dd43fb0) to head (dd3bc1f).
Report is 74 commits behind head on next.

Files Patch % Lines
packages/cli/src/lingui-compile.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1996      +/-   ##
==========================================
- Coverage   76.66%   76.16%   -0.51%     
==========================================
  Files          81       81              
  Lines        2083     2249     +166     
  Branches      532      588      +56     
==========================================
+ Hits         1597     1713     +116     
- Misses        375      420      +45     
- Partials      111      116       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yunsii
Copy link
Contributor

yunsii commented Aug 13, 2024

Does it will fix this issue #1793?

@timofei-iatsenko
Copy link
Collaborator Author

I hope so. I found that path issues on windows become even more weird when inter-disc execution is involved. For example, code working perfectly when it stored on disk C, but then suddenly become broken when you just move it to the disk D.

There is also no way to express a relative path between these two disks, and not every tool understand an absolute windows paths.

@yunsii
Copy link
Contributor

yunsii commented Aug 13, 2024

but then suddenly become broken when you just move it to the disk D.

I always think the comment is relative path in git repo, why related the inter-disc execution? 😦

@timofei-iatsenko
Copy link
Collaborator Author

Exactly, it should be relative to the rootDir specified in the lingui config. And that the goal i wanted to achieve, so no matter where files are stored result should be the same. But on windows, it turned out that it might be broken due to where files are stored, which is weird.

The inter disc execution happened in experimental extractor. Previously, it used os.tmpDir() to store esbuild generated bundles. On windows it's always would be on the system disk (C:) and if you code stored on disk D: esbuild not able to generate a correct relative path to sources, and then lingui extractor could not make this path relative to rootDir.

@yunsii
Copy link
Contributor

yunsii commented Aug 13, 2024

Is it possible to make lingui extractor always use same disk (maybe C:) to parse relative path?

@timofei-iatsenko
Copy link
Collaborator Author

That exactly what i did in this PR, among other things

Copy link
Contributor

@andrii-bodnar andrii-bodnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thekip thank you!

@andrii-bodnar andrii-bodnar merged commit 894759c into lingui:next Aug 14, 2024
17 checks passed
@timofei-iatsenko timofei-iatsenko deleted the fix/windows-compatibility branch August 14, 2024 11:57
@bravo-kernel
Copy link
Contributor

This is great, much appreciated 👏

@andrii-bodnar andrii-bodnar added this to the v5 milestone Oct 23, 2024
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 this pull request may close these issues.

4 participants