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

Build fails on Windows #28

Open
toedter opened this issue Apr 22, 2021 · 1 comment
Open

Build fails on Windows #28

toedter opened this issue Apr 22, 2021 · 1 comment
Milestone

Comments

@toedter
Copy link

toedter commented Apr 22, 2021

Since I wanted to find the Windows-related issues, I tried to build the project on Windows, but it failed:

Here is the log:

gradlew build
Downloading https://services.gradle.org/distributions/gradle-6.8.2-bin.zip
..........10%..........20%..........30%...........40%..........50%..........60%..........70%...........80%..........90%..........100%

Welcome to Gradle 6.8.2!

Here are the highlights of this release:

  • Faster Kotlin DSL script compilation
  • Vendor selection for Java toolchains
  • Convenient execution of tasks in composite builds
  • Consistent dependency resolution

For more details see https://docs.gradle.org/6.8.2/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

Task :npm_install
npm notice
npm notice New minor version of npm available! 7.6.0 -> 7.10.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.10.0
npm notice Run npm install -g [email protected] to update!
npm notice
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 1474 packages, and audited 1475 packages in 1m

106 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
npm notice
npm notice New minor version of npm available! 7.6.0 -> 7.10.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.10.0
npm notice Run npm install -g [email protected] to update!
npm notice

Task :gulp

[email protected] build
gulp build --output $npm_config_output

[14:55:44] Using gulpfile D:\dev\git\spring-asciidoctor-backends\gulpfile.js
[14:55:44] Starting 'build'...[2m 7s]
[14:55:44] Starting 'info'...
[14:55:44] Writing to $npm_config_output
[14:55:44] Finished 'info' after 798 ╬╝s
[14:55:44] Starting 'css'...
[14:55:47] Finished 'css' after 3.13 s
[14:55:47] Starting 'img'...
[14:55:47] Finished 'img' after 24 ms
[14:55:47] Starting 'jsSetup'...
[14:55:48] Finished 'jsSetup' after 977 ms
[14:55:48] Starting 'jsSite'...
[14:55:50] Finished 'jsSite' after 1.7 s
[14:55:50] Finished 'build' after 5.84 s

Task :prettierCheckFormat FAILED

[email protected] checkFormat
prettier --check .

Checking formatting...
[warn] src\main\css\asciidoctor.css
[warn] src\main\css\codetools.css
[warn] src\main\css\components.css
[warn] src\main\css\elements.css
[warn] src\main\css\generic.css
[warn] src\main\css\highlight.css
[warn] src\main\css\layout.css
[warn] src\main\css\settings-dark.css
[warn] src\main\css\settings.css
[warn] src\main\css\site.css
[warn] src\main\css\tabs.css
[warn] src\main\css\toc.css
[warn] src\main\js\setup\layout.js
[warn] src\main\js\setup\switchtheme.js
[warn] src\main\js\site\codetools.js
[warn] src\main\js\site\tabs.js
[warn] src\main\js\site\toc.js
[warn] src\main\ruby\lib\spring-asciidoctor-backends\body_template.html
[warn] Code style issues found in the above file(s). Forgot to run Prettier?

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':prettierCheckFormat'.

Process 'command 'D:\dev\git\spring-asciidoctor-backends.gradle\nodejs\node-v15.11.0-win-x64\npm.cmd'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 34s
10 actionable tasks: 10 executed

@philwebb philwebb added this to the 0.0.x milestone Apr 23, 2021
@mikomatic
Copy link

mikomatic commented Jun 14, 2021

I'm having the same issue here.

This seems to come from the default windows git configuration when core.autocrlf=true. Line feeds are converted to CRLF when cloning the repo, and then the command prettier --check . fails because of this.

I could continue the build by launching manually the npm run format = prettier --write . which "fixes" the files with the intended line endings.

One suggestion i could make to make it work without changing user configuration would be, based on prettier documentation (emphasis by me)

If you want to make sure that your entire git repository only contains Linux-style line endings in files covered by Prettier:
- [...]
- Add * text=auto eol=lf to the repo’s .gitattributes file. You may need to ask Windows users to re-clone your repo after this change to ensure git has not converted LF to CRLF on checkout.

https://prettier.io/docs/en/options.html#end-of-line

NOTE: even the build continues, the tests also fails (some for the same line-ending mismatch reason)

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

No branches or pull requests

3 participants