Solved Force poudriere to use clang90, or how to add packages in a jail

The reason I want to force a compiler version is solely because it informs me about ports which might have problems or are WIP
Forcing a compiler without poudriere works just fine for most packages, except rust & kernel modules.
make.conf:
Code:
CC=      /usr/local/bin/clang90
CXX=     /usr/local/bin/clang++90
CPP=     /usr/local/bin/clang-cpp90
LD=      /usr/local/bin/ld.lld90
NM=      /usr/local/bin/llvm-nm90
OBJDUMP= /usr/local/bin/llvm-objdump90
STRINGS= /usr/local/bin/llvm-strings90

However , when I try to do the same with poudriere and put this in the make.conf it fails to configure with the error,
/usr/local/bin/clang90: not found
Failed build & failed configure.
Altough I compiled clang90 in poudriere.
So it seems clang90 to be compiled but not "installed IN the jail" or "available from the jail" in order to be "used by the jail"
Any ideas ?
PS: I see /bin and /usr/bin in the jail but not a /usr/local/bin ...
So the question is what is the way to add packages to the jail ?
start the jail and chroot into it ?
Maybe better way trying "pkg -j"
After chroot & "pkg install pkg" seemed to be a bootstrapping trick.
But when i restarted poudriere everything I installed manually in the jail was lost.
[This is good from a security point of view but not the behaviour I want]
 
I am trying to figure this out for myself atm. However, I have found this reference that you may find useful:
https://www.freebsd.org/doc/handbook/ports-poudriere.html. From what I have gathered so far one adds the specific packages to an arbitrarily named file in /usr/local/etc/poudriere.d/:

Given a poudriere jail named poud_jail_name_1; and a poudriere ports tree named poud_ports_name_1; and a poudriere set named poud_set_name_1; then the file name for the package build list suggested is: poud_jail_name_1-poud_ports_name_1-poud_set_name_1-pkglist. The file name and location is arbitrary since it is explicitly passed to poudriere.
Code:
#/usr/local/etc/poudriere.d/poud_jail_name_1-poud_ports_name_1-poud_set_name_1-pkglist
editors/emacs
devel/git
ports-mgmt/pkg
...

One likewise may create a custom makefile in /usr/local/etc/poudriere.d. The documentation suggests to name that file based upon the jail's name, the ports tree name, and an arbitrarily assigned set name; for example: poud_jail_name_1-poud_ports_name_1-poud_set_name_1-make.conf. The man page shows that the various component parts are to be separated by the - character and that the terminal -make.conf is required. man 8 poudriere provides much detail on this.

Port options are handled exactly the same way as the make.conf file, saving only that the terminal is -options.

The man page suggests that the pkg list file can be named anything and placed anywhere the user has read access since it is explicitly passed to the poudriere command.

It appears to me from the documentation that the custom make.conf file in /usr/local/etc/poudriere.d is picked up and merged with the default make.conf file for the build. The pkg list file is explicitly named in the -f option argument. But, the custom make.conf file name seems to be identified to poudriere by passing the set name as an argument to the -z option:
Code:
poudriere options  -j poud_jail_1  -p poud_ports_1  -f poud_jail_name_1-poud_ports_name_1-poud_set_name_1-pkglist  -z poud_set_name_1
poudriere bulk  -j poud_jail_1  -p poud_ports_1  -f poud_jail_name_1-poud_ports_name_1-poud_set_name_1-pkglist  -z poud_set_name_1

I am inferring all this from the documentation so experimentation is called for. I may have misapprehended what the word set means in this context. And other errors in comprehension are no doubt present. But this should give you a reasonable start.
 
In simple situations different sets are not needed. I don't use them or the option "-z"
Then just ignore them and remove their component from the file names. The rest of it still applies. However, I misunderstood how options are handled. The -options is a subdirectory under /usr/local/etc/poudriere/ and not a file.
 
I delete my poudriere jail , recreate my proudriere jail and starting it it contains build packages from the previous jail in the directory :
/packages/.real_?????/
What is this magic ?
It seamed they where stored in :
/usr/local/poudriere/data/packages/
 
After installling clang90 in a jail importing in poudriere with "method null" I ended up with the error :
# poudriere bulk -j $jail -p $port -f $pkglist
00:00:25] Starting jail poudb-local
make: no system rules (sys.mk).
make: no system rules (sys.mk).
eval: make:: not found
export: make:: bad variable name

As good as something is missing.
 
I am learning this as I go. And I am creating a permanent jail to be used for various builds. However, it seems to me that you do not need to delete a poudriere jail once it is set up. To begin with, it takes a very long time to create the build environment on the first run of a new jail.

One first edits /usr/local/etc/poudriere.conf.

It is probably a good idea to install ccache-static and enable that in /usr/local/etc/poudriere.conf ( CCACHE_DIR=/var/cache/ccache).

One then creates the jail: poudriere jail -c -j freebsd_12-1x64 -v 12.1-RELEASE where freebsd_12-1x64 is the name and 12.1-RELEASE is the base OS. In this case the architecture is taken to be that of the host.

Next one installs the port tree: poudriere ports -c -p PORTS-12-1. In this case the ports tree is named PORTS-12-1 and portsnap is used to populate it.

Next one creates their package list using any convenient location and file name. I am building samba so mine is: /root/poudr_12-1_samba.txt and contains the line: net/samba410.

If you wish to check, and optionally set, the options for the packages in the pkg_list then you do: poudriere options -c -j freebsd_12-1x64 -p PORTS-12-1 -f /root/poudr_12-1_samba.txt. This will bring up the configuration user interface and you select your options there. Note that all the port's dependencies will show up as well, one after the other.

I am not yet past this point so I cannot give any information on how to configure the compilers used. My advice is to get a simple single package having no dependencies built with the defaults on the first go and populate your tool chain in the jail. Then start changing things on subsequent runs of poudriere. My experience with getting llvm built may not be typical but the first run took about 11 hours with 4 cores, a Tb of disc, and 16Gb of RAM. No doubt a more powerful host will reduce that considerably. I also did not have ccache installed.
 
To answer my own question.
You can use clang90 in make.conf of poudriere,
1.if you create a jail directory manually yourself , i.e. tar xf base.txz
2.install the clang90 package by chrooting into the jail and pkg bootstrap.
3.import in the jail directory in poudriere with "poudriere jail -m null"
 
To answer my own question.
You can use clang90 in make.conf of poudriere,
1.if you create a jail directory manually yourself , i.e. tar xf base.txz
2.install the clang90 package by chrooting into the jail and pkg bootstrap.
3.import in the jail directory in poudriere with "poudriere jail -m null"
Many will tell you that you should not do that. Let the jail be. There are ports that may require older clang ver. You can easily specific what you want i.e. clang90 in the make.conf.
 
That did not work. Because in the "default jail" as created by poudriere even /usr/local/bin does not exist so certainly not clang90.
The compiler is not found
Yes I know some ports require older clang ,but forcing clang90 was just in order to find out which ones in the first place.
 
Back
Top