Skip to content
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

grunt submodule tasks never stop #2

Closed
pidupuis opened this issue Jan 15, 2015 · 6 comments
Closed

grunt submodule tasks never stop #2

pidupuis opened this issue Jan 15, 2015 · 6 comments

Comments

@pidupuis
Copy link

When I execute for instance 'grunt build' from a submodule folder, everything is fine. The subtasks are executed and the terminal is then available.

Now when I execute 'grunt submodule' (which is defined to run the build task of my submodule), the builb task is exectued as expected, except the task seems to be still running but there is no output (even in verbose mode). The terminal is not available. Every next subtasks are never launched.

Any idea of what happens ?
Thanks.

@jpommerening
Copy link
Owner

Sounds pretty strange … that's exactly the kind of task that is supposed to work.

I need some details to fix this though…
Do you have a repository which I could use to reproduce the problem? Or maybe just the bare project structure with just the gruntfiles and package.json (without any source code)? Which version of node and grunt are you using (node --version ; grunt --version)?

@pidupuis
Copy link
Author

Thanks for your response.

You can access the project repository here which uses this repo as a submodule in the lib folder.

I created the branch temp_grunt-submodule with a commit adding grunt-submodule.
You can easily clone the project, go to this branch, do the install stuff (git submodule init/update, npm install) and then test the grunt-submodule by using grunt submodule direclty and also grunt build which call the previous one. The grunt config is splitted in the grunt folder.

@jpommerening
Copy link
Owner

Awesome, thank you!

You're right, I can reproduce the problem just like you described.
There's something fishy going on here. The subprocess that runs inside the submodule does not exit. I'll try to find a fix this weekend :)

@jpommerening
Copy link
Owner

I guess I figured it out:

It is the part where grunt-submodule starts Grunt and waits for it to finish.
When Grunt fires its "done" callback, the grunt-submodule code just closes the process connection to the parent process and assumes that the node event loop is properly drained of all events (and thus should stop by itself). That is a little naïve, of course.
Easy fix: call process.exit(0) when we know there's nothing left to be done.

The behaviour is triggered by time-grunt: It sits in the event loop and waits for Grunt to finish by (repeatedly) patching the process.exit method. Since process.exit is never called, time-grunt waits indefinitely.

@pidupuis: Can you try version grunt-submodule@0.1.0-rc3 and tell me if that fixes your problem?

@pidupuis
Copy link
Author

Thanks a lot!

It works now with grunt-submodule@0.1.0-rc3 👍

@jpommerening
Copy link
Owner

Happy to hear that.
Thanks for reporting this issue!

On 20 Jan 2015, at 18:00, Pierre Dupuis notifications@github.com wrote:

Closed #2.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants