-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Importer: Drops uv_mutex in favor of std::mutex #615
Conversation
It is not safe to use uv_cond_wait outside of v8 thread (uv loop).
* If anyone could ever explain this!
@am11 hot damn, checked out the std-mutex branch on your fork and it seems to work. Followed the same process on the #586 . Did around 30-40 copy and pastes of
and they all seemed to work, no errors. Nice! |
Yay! And thanks for testing. 🎉 This will confirm that it's working on all accounts (render, renderSync and CLI usage). :) |
@am11 |
Awesomeness! So its Showtime for v2! :) Now we need to make the binaries. I have done the windows binaries (need to update the PR). Could you please send a PR for Mac binary on node-sass-binaries repo? Here is a good example. I can walk you through the steps: # after this is merged, clone node-sass ... start fresh
git clone https://github.com/sass/node-sass --recursive; cd node-sass
git submodule update --init --recursive; npm install
node-gyp rebuild # without -d,
# so it should create a folder build/Release (with binding.node)
# on github, fork https://github.com/sass/node-sass-binaries
# then clone your fork, perferablly outside node-sass directory:
cd ..; git clone htttps://github.com/browniefed/node-sass-binaries; cd node-sass-binaries
ls -lhS
rm darwin-x64/* # just so you can
cp ../node-sass/bin/Release/binding.node darwin-x64/
ls -lhS # see the difference in file sizes, so you know you are using latest one,
# its lame I know just for fun sakes :)
git add .;git commit -am "Binary: Adds Mac binaries for v2.0.0."; git push And finally the PR. :) Thanks in anticipation. ⚡ 💯 |
Importer: Drops uv_mutex in favor of std::mutex
Merged! ;) |
Thanks for the instructions only one small modification |
Curious, does anyone know why the console.log hack works? And does it actually need to print out the whole data object, or could it just print out an empty line? |
@callumlocke, it was explained by @matryo here: #644 (comment). It will be removed when custom functions will arrive to node-sass. |
The console.log hack is rendering this project unusable |
uv_mutex
in favor ofstd::mutex
. (0720fa8)uv_cond_wait
outside of v8 thread (
uv loop
).updating to v0.10.35 (current stable), it worked without this hack on Windows
but when tested with v0.10.35 on Ubuntu via nvm, it still fails without this hack.
The only downside of this hack is extra nuisance on console
(I tried to dodge it by overriding
console.log
function, but that didn't work either, so we would have to live with this little annoyance**, until someone can figure out why it is happening).@browniefed, @xzyfer, can you guys please confirm if this patch makes custom importer useable on Mac (and addresses #586)?
** without the hack running the following in cli hangs indefinitely:
with the hack, it executes properly, but prints whatever custom importer returns. Tested on Ubuntu and Windows.
Note 1: If the importer option is not set (in CLI or
render()
usage, leavingrenderSync()
alone), no unwanted / extra stuff will not be printed.Note 2: This means we would have to apply same hack to
custom functions
feature (#332), whenever we will implement it. :)Note 3: We use
render
(as opposed torenderSync
) in case of CLI usage, because we route the errors to emitter. In case ofrenderSync
, the errors are thrown to stderr. [1] [2]