Comments (11)
Thanks for the bug report. Will try to fix this in the comming week.
----- Original Message -----
From: "John Engelman" [email protected]
To: "srs/gradle-node-plugin" [email protected]
Sent: Friday, February 21, 2014 10:26:41 PM
Subject: [gradle-node-plugin] nodeSetup conflicts in multi-project build (#7)
In a multi-project Gradle build where 2 conditions are met:
- Multiple projects apply the 'node' plugins &
- Gradle parallel build mode is activated
The nodeSetup task can error because multiple instances of it could run at the same time. The tasks collide because they both try to extract to the same destination directory.
I've fixed this in my build by applying the plugin to the root project and then configuring all my tasks to depend on nodeSetup in the rootProject and then disabling the nodeSetup in each child project.
This ensures that in any given build there is only 1 nodeSetup that tries to run.
—
Reply to this email directly or view it on GitHub .
from gradle-node-plugin.
There's also an issue where concurrent builds could both be executing the nodeSetup
task and they collide.
I would suggest maybe looking into using Gradle's dependency resolution engine to resolve the Node tar file - you'd benefit from their cache control and locking then.
Also, maybe exploding the tar into the local build
directory instead of in the file cache.
Finally, configuring some @Input
properties on the SetupTask
will allow it to only execute when necessary instead of all the time (the output directory is configured, but without at least one task input, the task will always run).
from gradle-node-plugin.
Hi. Can you try with the latest code (snapshot) and see if it works better? I have not been able to replicate this behaviour with both the old and the new code.
What version of gradle are you using? Tested both with 1.10 and 1.11.
Also, it is maybe better to unpack node into local build directory instead of the user .gradle directory. Will probably change this, but you could override it with the following code:
node {
workDir = file("${project.buildDir}/nodejs")
}
from gradle-node-plugin.
I was running it with Gradle 1.9. It was happening on every run of our build. In it we have 4 projects that were applying the plugin and we are running with --parallel
.
I'll see if I can get to testing the snapshot this weekend.
from gradle-node-plugin.
Hi.
I did a release of this plugin today since I will need some fixes for the gradle-grunt-plugin so you can test 0.4 release instead. Will cut a 0.5 relase with --parallel support if I can figure out the best way to solve it.
from gradle-node-plugin.
Ok.
I think your best bet for fixing it would just be to add the npmSetup
task to the rootProject
instead of the the current project
that is applying the plugin (make sure to only add it if it doesn't exist). Then the dependency would just be to the single task instance on the rootProject and everything should work.
That's what I'm doing in my build.
from gradle-node-plugin.
Oh, right. That's a good fix. Will try it out.
from gradle-node-plugin.
If you want different configuration of the node plugin in different modules you cannot do that with your solution. Think the better one for now is to use local build directory for unpacking nodejs instead of the global one.
from gradle-node-plugin.
ah yeah...I forgot about that scenario.
from gradle-node-plugin.
Have not managed to replicate the error, but think it will be safe to use project.buildDir for unpacking of node instead of using the /.gradle directory.
from gradle-node-plugin.
I have not seen this problem in any of my production builds. Closing this since it's reather old.
from gradle-node-plugin.
Related Issues (20)
- Version issue during build HOT 1
- How to pass command line argument to npm task in node application HOT 2
- Cannot download node version HOT 2
- How to use npm ci instead of npm install? HOT 3
- No value has been specified for property 'packageJsonFile'. HOT 2
- Error messages that someone can actually do something about. HOT 2
- Upgrading node to version 12.15.0 build failure HOT 9
- npm WARN deprecated request HOT 2
- can't find nodeJS 10.15.3 ? HOT 14
- Set tag when publishing HOT 1
- Plugin with id 'com.moowork.node' not found. HOT 3
- Could not get unknown property 'npm_run_build' for project HOT 1
- How to install and build additional dependency? HOT 1
- download = false HOT 2
- com.moowork.node plugin throwing error when i try ./gradlew build HOT 3
- Build fails with Gradle 7 HOT 5
- Cannot use the newest version with SonarQube Plugin HOT 3
- Node download on s390x Linux on Z platform is not supported HOT 2
- Compatible with gradle 7.1 not working HOT 2
- Support for limit on parallel task runs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-node-plugin.