Opened 2 years ago

Closed 2 years ago

#5915 closed defect (fixed)

adblockpluschrome won't build under Windows

Reported by: kzar Assignee: oleksandr
Priority: P3 Milestone:
Module: Automation Keywords:
Cc: oleksandr, sebastian, tlucas, trev Blocked By: #5913
Blocking: #5916 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29589555/

Description (last modified by kzar)

Environment

Windows 10, with creators update.
ActivePython 2.7.13
Node.js 6.11.4
Git 2.14.3

How to reproduce

  1. Click Node.js command prompt from the start menu.
  2. Type these commands:
git clone https://github.com/adblockplus/adblockpluschrome.git
cd adblockpluschrome
python build.py -t edge devenv

Note: Until #5913 is fixed you'll have to manually call npm install from the adblockpluschrome/buildtools directory.`

Observed behaviour

ERROR: Failed to install Node.js dependencies for C:\Users\kzar\adblockpluschrome\adblockplusui\buildtools, please ensure Node.js is installed.
ERROR: Failed to install Node.js dependencies for C:\Users\kzar\adblockpluschrome\buildtools, please ensure Node.js is installed.

C:\Users\kzar\adblockpluschrome\buildtools\node_modules\memory-fs\lib\MemoryFileSystem.js:44
                        throw new MemoryFileSystemError(errors.code.EINVAL, path);
                        ^
Error: invalid argument
    at pathToArray (C:\Users\kzar\adblockpluschrome\buildtools\node_modules\memory-fs\lib\MemoryFileSystem.js:44:10)
    at MemoryFileSystem.readFileSync (C:\Users\kzar\adblockpluschrome\buildtools\node_modules\memory-fs\lib\MemoryFileSystem.js:103:13)
    at webpackCompiler.run (C:\Users\kzar\adblockpluschrome\buildtools\webpack_runner.js:142:44)
    at runWithDependencies (C:\Users\kzar\adblockpluschrome\buildtools\node_modules\webpack\lib\MultiCompiler.js:154:4)
    at C:\Users\kzar\adblockpluschrome\buildtools\node_modules\async\dist\async.js:1074:9
    at C:\Users\kzar\adblockpluschrome\buildtools\node_modules\async\dist\async.js:421:16
    at iteratorCallback (C:\Users\kzar\adblockpluschrome\buildtools\node_modules\async\dist\async.js:998:13)
    at C:\Users\kzar\adblockpluschrome\buildtools\node_modules\async\dist\async.js:906:16
    at C:\Users\kzar\adblockpluschrome\buildtools\node_modules\async\dist\async.js:1071:13
    at runCompilers (C:\Users\kzar\adblockpluschrome\buildtools\node_modules\webpack\lib\MultiCompiler.js:96:47)
Traceback (most recent call last):
  File "build.py", line 18, in <module>
    buildtools.build.processArgs(BASE_DIR, sys.argv)
  File "C:\Users\kzar\adblockpluschrome\buildtools\build.py", line 509, in processArgs
    commands[command](baseDir, scriptName, opts, args, type)
  File "C:\Users\kzar\adblockpluschrome\buildtools\build.py", line 54, in __call__
    return self._handler(baseDir, scriptName, opts, args, type)
  File "C:\Users\kzar\adblockpluschrome\buildtools\build.py", line 206, in createDevEnv
    packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseBuild=True)
  File "C:\Users\kzar\adblockpluschrome\buildtools\packagerEdge.py", line 181, in createBuild
    packagerChrome.create_bundles(params, files)
  File "C:\Users\kzar\adblockpluschrome\buildtools\packagerChrome.py", line 197, in create_bundles
    raise subprocess.CalledProcessError(process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['node', 'C:\\Users\\kzar\\adblockpluschrome\\buildtools\\webpack_runner.js']' returned non-zero exit status 1

Expected behaviour

Build is created successfully.

Notes

A patch like this seems to get the extension to build again:

diff --git a/webpack_runner.js b/webpack_runner.js
index 25ba5e5..e75b018 100644
--- a/webpack_runner.js
+++ b/webpack_runner.js
@@ -56,7 +56,7 @@ process.stdin.on("end", () =>
       },
       entry: entry_points,
       output: {
-        path: "/",
+        path: "c:\\",
         filename: bundle_name
       },
       resolve: {
@@ -138,7 +138,7 @@ process.stdin.on("end", () =>
       for (let config of options)
       {
         let filepath = path.join(config.output.path, config.output.filename);
-        let relativeFilepath = path.relative("/", filepath);
+        let relativeFilepath = path.relative("c:\\", filepath);
         files[relativeFilepath] = memoryFS.readFileSync(filepath, "utf-8");
         files[relativeFilepath + ".map"] = memoryFS.readFileSync(
           filepath + ".map", "utf-8"

Change History (7)

comment:1 Changed 2 years ago by kzar

  • Description modified (diff)

comment:2 Changed 2 years ago by kzar

  • Description modified (diff)

comment:3 Changed 2 years ago by kzar

  • Blocking 5916 added

comment:4 Changed 2 years ago by oleksandr

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:5 Changed 2 years ago by kzar

  • Owner set to oleksandr
  • Priority changed from Unknown to P3
  • Ready set

comment:6 Changed 2 years ago by abpbot

A commit referencing this issue has landed:
Issue 5915 - adblockpluschrome won't build under Windows

comment:7 Changed 2 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.