Git Product home page Git Product logo

Comments (8)

teddyzeenny avatar teddyzeenny commented on May 12, 2024

@rpl ping

from ember-inspector.

rpl avatar rpl commented on May 12, 2024

@teddyzeenny @zoghal I'm on it, it's definitely an issue in the grunt-mozilla-addon-sdk plugin and I've already verified that it's not windows specific.

I'm fixing it in the grunt-mozilla-addon-sdk github repo, and I've pushed a fix which works on Linux (and than it should work correctly on OSX too), but it needs to be tested on windows.

@zoghal could you try to use this git branch as a temporary npm dependency, so we can check if the fix is working correctly on Windows?

in the ember-extension package.json just change this single line:

diff --git a/package.json b/package.json
index 976fde8..3648702 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
     "glob": "~3.2.1",
     "grunt-contrib-compress": "~0.5.2",
     "grunt-ember-s3": "~1.0.4",
-    "grunt-mozilla-addon-sdk": "~0.3.1",
+    "grunt-mozilla-addon-sdk": "https://github.com/rpl/grunt-mozilla-addon-sdk/tarball/fix/dirnames_with_spaces",
     "grunt-wrap": "~0.3.0"
   }
 }

and then run npm install and grunt build build_xpi

from ember-inspector.

zoghal avatar zoghal commented on May 12, 2024

@rpl i tested again,but has error exist
i debug and trace this problam,this is a bug in require('child_process').spawn()

https://github.com/joyent/node/issues/2318

" // On Windows, child_process.spawn will only file .exe files in the PATH,
// not other executable types (grunt issue #155).
"
is comment to :

https://github.com/gruntjs/grunt/blob/master/lib/grunt/util.js#L155

this is solution in bower

https://github.com/bower/bower/commit/c06b9d696e6778675f2fde86445184124802652f

from ember-inspector.

rpl avatar rpl commented on May 12, 2024

@zoghal I don't think it's the same problem, because we use "child.spawn" on the full path to the helper batch file from the grunt-mozilla-addon-sdk npm module: https://github.com/rpl/grunt-mozilla-addon-sdk/blob/master/tasks/mozilla_addon_sdk.js#L68

Probably windows doesn't like the same quoting trick that I've used to solve the same issue on the *nix platforms.

I need to get my hands on a windows box to be able to try a different trick to quote the dirname in the batch helper script: https://github.com/rpl/grunt-mozilla-addon-sdk/blob/master/scripts/cfx.bat

from ember-inspector.

rpl avatar rpl commented on May 12, 2024

@zoghal I've worked on this issues and I managed to get this to work correctly on a WindowsXP box:

  • WindowsXP Professional SP2
  • node 0.10.22
  • npm 1.3.14
  • grunt 0.1.11
  • grunt-mozilla-addon-sdk 0.3.2dev2

The issue is related to the presence of white spaces in the absolute path of the helper script (xpi_script from here: https://github.com/rpl/grunt-mozilla-addon-sdk/blob/fix/dirnames_with_spaces/tasks/mozilla_addon_sdk.js#L68),
and nodejs child_process.spawn, that it's used by grunt.util.spawn to launch external commands and doesn't handle this use case correctly.

The new workaround I've pushed on the grunt-mozilla-addon-sdk "fix/dirnames_with_spaces" branch is to use the relative path which does not contains any space chars ("./node_modules/grunt-mozilla-addon-sdk/scripts/cfx.bat")

On the contrary, space characters in the rest of the command arguments are correctly quoted in the helper script and they don't create any issues.

If you can try to update the grunt-mozilla-addon-sdk package to the new experimental version (0.3.2dev2) and retry, I will wait your confirmation before publishing the fix as grunt-mozilla-addon-sdk 0.3.2 on npm and create a pull request on ember-extension to update the dependency.

from ember-inspector.

zoghal avatar zoghal commented on May 12, 2024

@rpl I'm not very familiar with grunt. Please advise what to do and what you want to apply the changes.
Or
Create a New Branch in your repository so I'm testing it.

from ember-inspector.

zoghal avatar zoghal commented on May 12, 2024

@rpl i now retry and repalce this line

var xpi_script = path.resolve(__dirname, '..', 'scripts', scriptFilename);

with :

 var xpi_script = path.relative(process.cwd(),
                                 path.resolve(__dirname, '..', 'scripts', scriptFilename));

it is ok, build xpi without errors. thanks

from ember-inspector.

rpl avatar rpl commented on May 12, 2024

@zoghal awesome! thanks for the confirmation, I'm going to prepare a pullrequest asap

from ember-inspector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.