drip icon indicating copy to clipboard operation
drip copied to clipboard

drip doesn't exit when run under make...

Open jszakmeister opened this issue 11 years ago • 1 comments

I haven't located the source of this problem (and have run out of time to try and track it down), but I do have a simple reproduction recipe.

Here's my Makefile:

helloworld.jar: *.java
    javac -cp . $^
    jar cf $@ $(addsuffix .class,$(basename $^))

helloworld: helloworld.jar
    drip -cp $< HelloWorld

all: helloworld.jar

.PHONY: helloworld

Here's HelloWorld.java:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

When running make helloworld with this setup, "Hello World!" will get printed, but the process doesn't exit until I hit ctrl-c. I'm running under Mac OS X (Snow Leopard) with this version of java:

:: java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-10M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

jszakmeister avatar Aug 16 '13 13:08 jszakmeister

The issue here might be that the spawned VMs are retaining a handle to make's stdout, stdin, and stderr. I recall running into a similar situation elsewhere (not with drip) where the parent process would fail to exit until the children gave up the handles.

jszakmeister avatar Aug 16 '13 15:08 jszakmeister