# Failed to build llvm50 from ports inside the jail



## fnoyanisi (Nov 20, 2017)

Hi there,

I created a new jail via ezjail-admin(8), and attempted to build devel/llvm50 with the command below

```
make -DBATCH WITH_DEBUG=yes install clean
```
I left my laptop running all night and in the morning I saw the build failed at some stage.

My base system (host that the jail is running on) is 11.1-RELEASE, the basejail was created by using the instructions given in the handbook.

The first thing I did just after creating the /etc/resonlv.conf inside the jail was building llvm50. 

Am I missing something here, is the port not supposed to compile on a fresh jail?

Thanks


----------



## SirDice (Nov 21, 2017)

Post the error. It will be hard to diagnose what's wrong if we don't know what happens.


----------



## fnoyanisi (Nov 21, 2017)

Hi,

I attempted to build devel/llvm40 after failing to get devel/llvm50 built & installed (I am just trying to get a debuf build of llvm)

I also had some error messages while building devel/llvm40, but the installer advised me to use `MAKE_JOBS_UNSAFE=yes` option and try again before lodging a bug report.

The command line below worked for me

```
make -DBATCH WITH_DEBUG=yes MAKE_JOBS_UNSAFE=yes install clean
```
For reference, the `MAKE_JOBS_UNSAFE=yes` option is explained in the porter's handbook section 6.5.1.

SirDice , unfortunately, I did not note down the error message. But my question was more around the unusual case of not being able to build a port in a fresh jail environment.


----------



## poorandunlucky (Nov 22, 2017)

fnoyanisi said:


> Hi,
> 
> I attempted to build devel/llvm40 after failing to get devel/llvm50 built & installed (I am just trying to get a debuf build of llvm)
> 
> ...



Why don't you just use Poudriere?


----------



## fnoyanisi (Nov 24, 2017)

poorandunlucky said:


> Why don't you just use Poudriere?


Good point... but Poudriere is not something that I am very familiar with, so I thought the shortest and easiest path is the one you know and used ezjail-admin.


----------



## tobik@ (Nov 24, 2017)

fnoyanisi said:


> But my question was more around the unusual case of not being able to build a port in a fresh jail environment.


Building ports in a new jail is *not* equivalent to building ports in Poudriere.

`make -DBATCH` leaves build dependencies of all ports you build with it lying around in the jail that are not declared in the port i.e. the build environment is polluted by them.

Poudriere tries to avoid that and tries to build packages in isolation. Build dependencies that are not explicitly declared in the port are not installed in the build jail.


----------



## poorandunlucky (Nov 24, 2017)

fnoyanisi said:


> Good point... but Poudriere is not something that I am very familiar with, so I thought the shortest and easiest path is the one you know and used ezjail-admin.



I didn't see the point of Poudriere just a week ago, but I just can't stop praising it...  It's a very clean piece of software...  It's beautiful, and once you have it set-up, and you know your maybe three commands, it's a breeze to use...  It's efficient, safe, clean (how it does things), clean (how it's written), it's not even on a par with building ports directly from the ports tree...  And maintaining ports from the ports tree properly would be a nightmare after seeing how Poudriere illustrates it...  It's unfeasible to properly maintain a FreeBSD system where you build your software yourself without it... unthinkable, even.  If you don't want to use it, you might as well just use binary releases because you're just going to mess things up, anyway...


----------



## SirDice (Nov 24, 2017)

tobik@ said:


> Building ports in a new jail is *not* equivalent to building ports in Poudriere.


True. But before Poudriere or Synth existed I used to build all my own repositories using a jail. So it should work regardless. You do need to make sure it's clean, and all the dependencies are built in one go but it should work just fine. I've used the same technique to build my packages for many years (even long before pkg(8) existed).

As for diagnosing the error, use script(1):

```
# script /tmp/build_report.txt
# <do whatever needs to be done>
# exit
```
You'll now have a file /tmp/build_report.txt that will contain all the output from the build process and commands you typed. This file is probably going to be quite large depending on what you're building, please post it to Pastebin or a similar service. A tool like misc/pastebinit will make it easy to do that from the FreeBSD command line.


----------

