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

Windows Build #26

Closed
onurozkan opened this Issue Oct 12, 2017 · 13 comments

Comments

Projects
None yet
3 participants
@onurozkan
Copy link
Contributor

onurozkan commented Oct 12, 2017

Hello,

Currently build scripts does not work on Windows.

Is there any plan for Windows support soon? or any hacks/tricks for now?

Thanks.

@Reinmar

This comment has been minimized.

Copy link
Member

Reinmar commented Oct 12, 2017

Hey!

How does it break now? It may be something simple, but we didn't test it on Windows yet so I really don't know.

As for Windows support in general, I guess it's a high time that we provide it for at least the builds. Support for the entire development environment is something bigger and far less developers will need it so it may wait (I hope).

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

About half of the year ago I tested our test tools on Windows and one issue which I found was invalid regexp for Windows.

I guess the same problem can occur here. When we made a config file, we assumed that Webpack will be executed on Unix. So regexps have been written for Unix paths.

If we fix the regexp for Windows, most probably the problem won't occur anymore. It's worth checking.

@onurozkan

This comment has been minimized.

Copy link
Contributor Author

onurozkan commented Oct 12, 2017

Tried few things.

This is the result of default build as "npm run build"

C:\Users\onur\Desktop\ckeditor5-build-classic-master>npm run build

> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 build C:\Users\onur\Desktop\ckeditor5-build-classic-master
> npm run create-entry-file && npm run build-ckeditor


> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 create-entry-file C:\Users\onur\Desktop\ckeditor5-build-classic-master
> ./bin/create-entry-file.js

'.' is not recognized as an internal or external command,
operable program or batch file.

npm ERR!     C:\Users\onur\AppData\Roaming\npm-cache\_logs\2017-10-12T10_13_33_333Z-debug.log

Later i changed create entry file script to this; "node bin/create-entry-file.js".

C:\Users\onur\Desktop\ckeditor5-build-classic-master>npm run build

> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 build C:\Users\onur\Desktop\ckeditor5-build-classic-master
> npm run create-entry-file && npm run build-ckeditor


> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 create-entry-file C:\Users\onur\Desktop\ckeditor5-build-classic-master
> node bin/create-entry-file.js

Creating the entry file...
Done.

> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 build-ckeditor C:\Users\onur\Desktop\ckeditor5-build-classic-master
> ./bin/build-ckeditor.sh

'.' is not recognized as an internal or external command,
operable program or batch file.

And eventually i checked shell script, saw webpack, and changed "build-ckeditor" command to "webpack".

This is the the error i got.

C:\Users\onur\Desktop\ckeditor5-build-classic-master>npm run build

> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 build C:\Users\onur\Desktop\ckeditor5-build-classic-master
> npm run create-entry-file && npm run build-ckeditor


> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 create-entry-file C:\Users\onur\Desktop\ckeditor5-build-classic-master
> node bin/create-entry-file.js

Creating the entry file...
Done.

> @ckeditor/ckeditor5-build-classic@1.0.0-alpha.1 build-ckeditor C:\Users\onur\Desktop\ckeditor5-build-classic-master
> webpack

C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\@ckeditor\ckeditor5-dev-webpack-plugin\lib\replacetcalls.js:29
                                const pathToCoreTranslationPackage = result.match( /.+\/ckeditor5-core/ )[ 0 ];
                                                                                                         ^

TypeError: Cannot read property '0' of null
    at compiler.resolvers.normal.resolve (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\@ckeditor\ckeditor5-dev-webpack-plugin\lib\replacetcalls.js:29:78)
    at onResolve (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:70:11)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:39:22
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at resolver.doResolve.createInnerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:41:24)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at afterInnerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:165:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\ModuleKindPlugin.js:20:36
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at next (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\tapable\lib\Tapable.js:249:35)
    at C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\forEachBail.js:29:14
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)
    at innerCallback (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\Resolver.js:143:22)
    at callbackWrapper (C:\Users\onur\Desktop\ckeditor5-build-classic-master\node_modules\enhanced-resolve\lib\createInnerCallback.js:10:21)

I think we are now in same page with @pomek

@onurozkan

This comment has been minimized.

Copy link
Contributor Author

onurozkan commented Oct 12, 2017

We can easily skip first 2 problems just by changing these lines. But cgywin required for shell script. Tried on Mac and Windows, worked well.

"create-entry-file": "node bin/create-entry-file.js",
"build-ckeditor": "sh bin/build-ckeditor.sh",

So only problem probably regexp.

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

const pathToCoreTranslationPackage = result.match( /.+\/ckeditor5-core/ )[ 0 ];
TypeError: Cannot read property '0' of null

Looks like the problem with regexps. It should be an easy-to-solve thing. Instead of \/ you could use \\\\.

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

And we could detect whether use Unix / Windows separator path in regexp.

@Reinmar, WDYT?

@onurozkan

This comment has been minimized.

Copy link
Contributor Author

onurozkan commented Oct 12, 2017

changed line to this, solved the problem.

const pathToCoreTranslationPackage = result.match( /.+\\ckeditor5-core/ )[ 0 ];
@Reinmar

This comment has been minimized.

Copy link
Member

Reinmar commented Oct 12, 2017

@onurozkan, great! Thanks for the details. Could you make a PR to this package with your changes?

We'll handle the regexp in https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-webpack-plugin and see if something's left. @pomek, could you look into it?

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

Yea. \\\\ is ok in case if you create a regexp using the constructor (new RegExp( string )).

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

Part of the ticket related to Webpack plugin has been reported here – ckeditor/ckeditor5-dev#297.

@pomek pomek closed this in #27 Oct 12, 2017

pomek added a commit that referenced this issue Oct 12, 2017

Merge pull request #27 from onurozkan/t/26
Fix: Build scripts will work on Windows. Closes #26.

pomek added a commit to ckeditor/ckeditor5-build-inline that referenced this issue Oct 12, 2017

pomek added a commit to ckeditor/ckeditor5-build-balloon that referenced this issue Oct 12, 2017

@pomek

This comment has been minimized.

Copy link
Member

pomek commented Oct 12, 2017

I applied changes from #27 to other builds repositories:

@Reinmar

This comment has been minimized.

Copy link
Member

Reinmar commented Oct 12, 2017

Thanks for the PR! And thanks @pomek for merging it.

The other issue that we need to solve: ckeditor/ckeditor5-dev#297.

EDIT: Oops, I haven't noticed you linked to it already, @pomek.

@Reinmar

This comment has been minimized.

Copy link
Member

Reinmar commented Oct 20, 2017

I've just released @ckeditor/ckeditor5-dev-webpack-plugin@2.0.20 – this version should fix the issue.

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