# Where is a log of a failed build?



## captobvious (Nov 10, 2010)

I have been attempting to build the openjdk6 port for the past 3 days and it fails gloriously each time; but besides that, I cannot see all the errors that occur at the point where it fails. How do you make a log of the build process or where is the log for the build process? I'm using the default /bin/sh on a clean 8.1-STABLE-2010-10, amd64. thanks!


----------



## jb_fvwm2 (Nov 10, 2010)

When the build fails, parts of it is done. Presume you are in the directory of the port. 
	
	



```
make build | tee -a build_fail.txt
```
 might work, it will resume the undone parts and the errors and non-errors may all write into that .txt file. (Note... I've never tried this on a /java/ port. So a very slight chance something is nonstandard in some of those builds). Another caution, that file can be very large if you start the build from the very beginning. One can even cntl-c the build each few hours and restart it to a new file AFAIK.


----------



## captobvious (Nov 10, 2010)

hrm didnt work as expected; while the log contained multiple


```
*** Error code 1
```

The actually errors on the screen were not in the log; I see 2 files missing,npapi.h and npupp.h but I assume it was during the javac part of the build process and not the make. ;(


----------



## kpa (Nov 10, 2010)

The problem is that some error messages are sent to stderr and that pipeline catches only stdout, try this:

`# make build 2>&1 | tee -a build_fail.txt`


----------



## wblock@ (Nov 10, 2010)

kpa said:
			
		

> The problem is that some error messages are sent to stderr and that pipeline catches only stdout, try this:
> 
> `# make build 2>&1 | tee -a build_fail.txt`



That works with sh or bash but not csh.  script(1) should work with all of them, and captures both stdout and stderr: http://forums.freebsd.org/showthread.php?t=17309.


----------



## captobvious (Nov 10, 2010)

Thanks everyone, the [CMD="script(1)"]script(1)[/CMD] worked in capturing all the screen output and know I can see the pages and pages of wonderful missing files and directories 

I'll continue my tale of woe in this thread, concerning the icedtea java plugin 

http://forums.freebsd.org/showthread.php?t=18995


----------

