Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

io.js 1.1 support #627

Closed
appsforartists opened this issue Jan 15, 2015 · 43 comments
Closed

io.js 1.1 support #627

appsforartists opened this issue Jan 15, 2015 · 43 comments

Comments

@appsforartists
Copy link

Presently, trying to run sass-loader against the latest [email protected] (the latest in npm) on [email protected] appears to succeed, but upon execution yields a Module did not self-register error. If you follow the advice of #563 and remove the binding altogether, you'll get this instead:

Module build failed: TypeError: Cannot read property 'render' of undefined
    at Object.module.exports.render (node_modules/node-sass/lib/index.js:230:26)
    at Object.module.exports (node_modules/sass-loader/index.js:53:10)
@am11
Copy link
Contributor

am11 commented Jan 15, 2015

Please read the comment on the original issue: nodejs/node#373 (comment), we are currently supporting latest stable version of node.js only.

io.js runtime support is not on our immediate TODO list.

@snostorm
Copy link

On #563 (comment) I've hinted at the code changes needed to help make io.js work incase anybody has a chance to put together a PR. (I won't have time today for sure, although if pinged I can pass along more details on my local diff -- which wouldn't yet work for 0.10 users.)

@mnutt
Copy link
Contributor

mnutt commented Jan 16, 2015

nodejs/node#456

@mnutt mnutt mentioned this issue Jan 16, 2015
@am11
Copy link
Contributor

am11 commented Jan 17, 2015

This is addressed by 452c698 and 0887f83 via #630.

Credit: @mnutt, @snostorm.

@am11
Copy link
Contributor

am11 commented Jan 18, 2015

Just to be clear: with #630, it is possible to build the binary against io.js runtime. The one that npm install node-sass downloads, only works with node v0.10.x.

I am not sure if the binary built by one version of a runtime should work seamlessly on any other runtime-version. Or are we expected to make a separate set of binaries for io.js? For latter, it will not be available with v2. Meanwhile, you would need to rebuild the binary manually for io.js.

Similarly, even the binary that is built with node v0.10.35 (stable), does not work with v0.11.14 (nightly). Again, you would need to rebuild it manually.

Note that this is a separate issue than making the Linux binaries cross-distro compatible: #602 and #517. Compatibility is a biggest challenge for us, as our upstream libsass is using C99 and C++11 STL features, our users and downstreams require it to work on old CentOS 5.5+ with newer libc & older libstdc++ (compared to debian counterparts) and the minimum gcc & g++ compiler version required to compile our binding is v4.6.

Now you know how io.js would make the binary building and distribution process more complicated, especially for node-sass.

@kkoopa
Copy link
Contributor

kkoopa commented Jan 18, 2015

A module must be rebuilt whenever NODE_MODULE_VERSION changes. It changed from joyent/node 0.10 -> joyent/node 0.11, from joyent/node 0.11 -> iojs/io.js 1.0, and atom/atom-shell has its own fork going with yet another NODE_MODULE_VERSION.

@appsforartists
Copy link
Author

iojs support has been merged for days, but the version hasn't been bumped yet. Can we please release to npm so we can test this out?

@am11
Copy link
Contributor

am11 commented Jan 20, 2015

@appsforartists see #627 (comment)

@appsforartists
Copy link
Author

I must have misunderstood. I thought adding iojs binaries to the npm module what @browniefed was doing.

So to use this in iojs, would you just need to follow these steps?

@am11
Copy link
Contributor

am11 commented Jan 20, 2015

Pretty much the same. Note that the official node-gyp package is yet to receive iojs love: nodejs/node-gyp#564. Meanwhile, we can use the one that is bundled with iojs as @mnutt mentioned here.

Sometime ago, we were thinking about expanding the platforms support in terms of binaries (FreeBSD, Solaris). But support for ioj.s and kind is certainly another important dimension. The show stopper at the moment is compatibility for Linux binaries. If we release without caring about older versions of linux platform, it will make masses unhappy (that is why I don't want to rush but rather work out the permanent solution this time for this recurring problem). Therefore, it is quite hard to say when v2.0.0 will be released and this expansion plan will move forward.

@am11 am11 added this to the v2.1 milestone Jan 24, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Jan 27, 2015

@AntouanK
Copy link

A bit confused...
Should we be able to build node-sass on io.js or not?

That's my output trying to build node-sass ( after cloning the repo, etc )

➜  node-sass git:(master) node --version && npm --version && node-gyp --version
v1.0.4
2.3.0
v1.0.2
➜  node-sass git:(master) sudo node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
child_process: customFds option is deprecated, use stdio instead.
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/antouank/_REPOS_/test/client/node_modules/grunt-sass/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/antouank/.node-gyp/1.0.4/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/antouank/.node-gyp/1.0.4',
gyp info spawn args   '-Dmodule_root_dir=/Users/antouank/_REPOS_/test/client/node_modules/grunt-sass/node_modules/node-sass',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/binding/src/binding.o
In file included from ../src/binding.cpp:1:
../node_modules/nan/nan.h:1848:10: error: no matching function for call to 'Encode'
  return node::Encode(
         ^~~~~~~~~~~~
/Users/antouank/.node-gyp/1.0.4/src/node.h:251:34: note: candidate function not viable: cannot convert argument of incomplete type 'const void *' to 'const char *'
NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
                                 ^
/Users/antouank/.node-gyp/1.0.4/src/node.h:257:34: note: candidate function not viable: requires 3 arguments, but 4 were provided
NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
                                 ^
/Users/antouank/.node-gyp/1.0.4/src/node.h:262:45: note: candidate function not viable: requires at most 3 arguments, but 4 were provided
                inline v8::Local<v8::Value> Encode(
                                            ^
/Users/antouank/.node-gyp/1.0.4/src/node.h:43:53: note: expanded from macro 'NODE_DEPRECATED'
#define NODE_DEPRECATED(msg, fn) V8_DEPRECATED(msg, fn)
                                                    ^
/Users/antouank/.node-gyp/1.0.4/deps/v8/include/v8config.h:332:45: note: expanded from macro 'V8_DEPRECATED'
# define V8_DEPRECATED(message, declarator) declarator
                                            ^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:101:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1038:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/antouank/_REPOS_/test/client/node_modules/grunt-sass/node_modules/node-sass
gyp ERR! node -v v1.0.4
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
➜  node-sass git:(master)

@am11
Copy link
Contributor

am11 commented Jan 29, 2015

@xzyfer, great thanks! Also http://www.appveyor.com/docs/lang/nodejs-iojs. We will definitely incorporate io.js in our CI matrices. :)

@AntouanK
I have updated the dependencies and yet still able to reproduce this issue.

@kkoopa, here is the first error:

C:\Users\adeel\Source\Repos\node-sass\node_modules\nan\nan.h(1851):
error C2665: 'node::Encode' : none of the 3 overloads could convert all the
 argument types (..\src\binding.cpp) [C:\Users\adeel\Source\Repos\node-sass
\build\binding.vcxproj]

Full log: https://gist.github.com/am11/68a2022bbe49b193dcd0.

I am using pangyp. Following are the steps to reproduce the bug:

git clone https://github.com/sass/node-sass --recursive; cd node-sass
git submodule update --recursive --init
npm install; npm install pangyp
iojs node_modules/pangyp/bin/node-gyp rebuild

# here the following command succeeds:
# node node_modules/pangyp/bin/node-gyp rebuild

Is it a known bug or am I doing it wrong? :)

@AntouanK
Copy link

@am11 Sorry, my english might not be that good. After updating the dependencies, are you able to reproduce the errors I have or not?

@am11
Copy link
Contributor

am11 commented Jan 29, 2015

@AntouanK, yes I am able to reproduce the issue you have reported. The error is coming from nan code.

@AntouanK
Copy link

@am11 Ok. Let us know if you want to use any other log from the error.

@kkoopa
Copy link
Contributor

kkoopa commented Feb 6, 2015

It's a bug in pangyp

@ai
Copy link

ai commented Feb 7, 2015

nod-sass has same problem on node.js 0.12

@am11
Copy link
Contributor

am11 commented Feb 7, 2015

pangyp v2.0.2 is published with the fix. I have updated the package.json: 01ca5e2 via #652.

For io.js, you can now use:

iojs node_modules/pangyp/bin/node-gyp rebuild

and for node:

node node_modules/pangyp/bin/node-gyp rebuild

after npm install.

@Globegitter
Copy link

@am11 Awesome did get that to work now. But how can I install it as npm package in a project? Is there still much stopping that?

@am11
Copy link
Contributor

am11 commented Feb 7, 2015

@Globegitter, the upcoming node-sass v2.0.0 (stable) will support the present production-ready node.js version 0.12. Note that here support means the binaries available through dist. Otherwise you can manually build it with other versions of node.js et al.

Related: #653.

@Globegitter
Copy link

@am11 Thanks. It is strange, so I have gotten the latest master to work in a fresh project, but if I reproduce the steps in an existing project I do not seem to be able to get it to work. So all builds fine, but then when I start my server I get the following error:

dlopen(client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node, 1): Symbol not found: __ZTVN4Sass6CssizeE
  Referenced from: client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node
  Expected in: flat namespace
 in client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node
Error: dlopen(client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node, 1): Symbol not found: __ZTVN4Sass6CssizeE
  Referenced from: client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node
  Expected in: flat namespace
 in client/node_modules/broccoli-sass/node_modules/node-sass/vendor/darwin-x64/binding.node
    at Error (native)
    at Module.load (module.js:341:32)
    at Function.Module._load (module.js:296:12)
    at Module.require (module.js:351:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/client/node_modules/broccoli-sass/node_modules/node-sass/lib/index.js:192:15)
    at Module._compile (module.js:446:26)
    at Object.Module._extensions..js (module.js:464:10)
    at Module.load (module.js:341:32)
    at Function.Module._load (module.js:296:12)

Any idea what this might be about?

Edit: Weird, I just seemed to have rebuilt and it works fine. That is awesome! Can confirm now that I got node-sass to work in one of my projects using iojs. Just keeping the above error for reference, since I still do not know why it appeared and what actually fixed that.

@am11
Copy link
Contributor

am11 commented Feb 9, 2015

@Globegitter, thanks for confirming that the darwin binaries are functional.

This feature request is completed. node-sass is compatible with io.js. You can build the binaries with the aforementioned steps. However the binaries distribution for io.js is a separate case, which we are tackling here: #655.

@am11
Copy link
Contributor

am11 commented Feb 12, 2015

Hey guys. node-sass v2.0.0 (superseded by patch release v2.0.1) is released with io.js v1.2 support. See the release notes and the binary coverage matrix in node-sass-binaries release notes.

@mgenev
Copy link

mgenev commented Feb 22, 2015

now it broke on iojs 1.3... :-/

@xzyfer
Copy link
Contributor

xzyfer commented Feb 22, 2015

Libraries with native extension like libsass need to be compiled against
new versions of runtimes eg. node or io.js.

Technically it's not broken in 1.3 because 1.3 was never supported. If you
need support for 1.3 (or any future version) please open an issue
requesting it and we'll get to it as soon as we can.

For now downgrading to 1.2 or using nvm to run 1.2 in parallel will work.
On 22 Feb 2015 18:19, "Martin Genev" [email protected] wrote:

now it broke on iojs 1.3... :-/


Reply to this email directly or view it on GitHub
#627 (comment).

@xzyfer xzyfer changed the title io.js support io.js 1.1 support Feb 22, 2015
@mgenev
Copy link

mgenev commented Feb 22, 2015

Hmm this will be a major chore in io's case as it seems to be releasing a new version every week.... I did downgrade for now and it works.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 22, 2015

I agree. I've opened a new issue to address the rapid release cycle of
io.js. can't link on phone
On 22 Feb 2015 18:39, "Martin Genev" [email protected] wrote:

Hmm this will be a major chore in io's case as it seems to be releasing a
new version every week....


Reply to this email directly or view it on GitHub
#627 (comment).

@Globegitter
Copy link

Just to have the cross-link: #694

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Fix the hanging } in some at-rules nested output
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests