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: Build failure on Windows #37189

Merged
merged 1 commit into from
Dec 13, 2021
Merged

Fix: Build failure on Windows #37189

merged 1 commit into from
Dec 13, 2021

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Dec 7, 2021

Description

See: #37123

The following error occurs when building the project on Windows OS.

Build Progress: [                              ] 0%blocks:
  assets by status 338 KiB [cached] 148 assets

  ERROR in unable to locate 'D:/Desktop/wp_dev/WordPress/gutenberg/packages/block-library/build-style/*/style.css' glob

  ERROR in unable to locate 'D:/Desktop/wp_dev/WordPress/gutenberg/packages/block-library/build-style/*/style-rtl.css' glob

  ...

  blocks (webpack 5.47.1) compiled with 6 errors in 1817 ms

packages:
  assets by status 15.2 KiB [cached] 110 assets
  ./packages/block-serialization-spec-parser/parser.js 46.9 KiB [built] [code generated]

  ERROR in a11y
  Module not found: Error: Can't resolve './packages/a11y' in 'D:\Desktop\wp_dev\WordPress\gutenberg'

  ERROR in admin-manifest
  Module not found: Error: Can't resolve './packages/admin-manifest' in 'D:\Desktop\wp_dev\WordPress\gutenberg'

  ...

This error seems to be caused by the fact that scripts using fast-glob do not generate paths correctly on Windows OS.

According to the fast-glob documentation, We need to replace the backslash as the separator in Windows with a forward slash.

In this pull request, I followed the good case of fast-glob and added the process of replacing backslashes with forward slashes where the path resolution fails.

Please try to put it on this branch and see if the build succeeds if you are a Windows user

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@Mamaduka Mamaduka requested a review from carolinan December 7, 2021 18:31
@Mamaduka Mamaduka added the [Type] Build Tooling Issues or PRs related to build tooling label Dec 7, 2021
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

Copy link
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

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

I am able to build this pull request on Windows. But I can't test for any potential problems on other operating systems.

@talldan
Copy link
Contributor

talldan commented Dec 13, 2021

I did additionally test on Mac OS X and it still worked well. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants