10 Do's and Don't for FreeBSD

kpedersen

Daemon

Reaction score: 1,063
Messages: 2,062

I usually mix ports and binaries anyways because I don't want to wait weeks for a package to build but I also need the latest version of some things and/or something is not available in the ports tree as a binary
Me too and I find that if you only use ports for applications that are not dependencies, you can never break anything.

So if I need SDL2, I will grab a package (because I don't really care about being the latest version), but if I want the latest version of Gimp or Blender, that the packages are lagging behind, I will simply build it as a port (only a port, I will use packages for the dependencies).

Since I know that nothing has a dependence on Gimp of Blender, I am 100% guaranteed that my system will not break.

This is because ports are flexible and will target any version of a libary you have installed; whereas packages often have hardcoded version numbers.
 

zader

Active Member

Reaction score: 23
Messages: 166

by mixing ports/packages..

would this also apply if you installed portmaster on the host and installed ports ... but had a jail or two that used packages? I have one jail with plex in it that was installed via pkg .. I just crontabed a package update command .. its brand new so if its best to just nuke it and use portmaster is that a better option?

is there an option to globally build/upgrade all packages on hosts and in jails with port master?

thanks
 

Lamia

Aspiring Daemon

Reaction score: 153
Messages: 621

would this also apply if you installed portmaster on the host and installed ports ... but had a jail or two that used packages? I have one jail with plex in it that was installed via pkg .. I just crontabed a package update command .. its brand new so if its best to just nuke it and use portmaster is that a better option?
They are different systems - host and jail(s). You can choose to use pkgs in a host and ports in jails and vice versa.
I just crontabed a package update command .. its brand new so if its best to just nuke it and use portmaster is that a better option?
If it works well, you don't have to. It is not everytime that ports successfully builds a pkg. Take for instance Firefox; many people report success building it via ports. But a large number of people also report otherwise. The latter will have to fall on pkgs.

is there an option to globally build/upgrade all packages on hosts and in jails with port master?
I can't think of one. That's why we have poudriere and others. Another unrelated option is flavor in (ez)jails.
 

Alain De Vos

Aspiring Daemon

Reaction score: 163
Messages: 610

As root shell I use mksh, installed in /bin. It is only dependent on /lib/libc.so.7
/etc/make.conf
.if ${.CURDIR:M*/shells/mksh}
PREFIX=/
.endif
 

CraigHB

Well-Known Member

Reaction score: 127
Messages: 357

Right now I only use packages, but I do build my own machine specific kernels (because it's just cool and makes things more efficient). At some point I may need to use a port of something and would like to know how to address the issue. So is using synth to build your own packages a good way to avoid the dependency problem of mixing ports and packages? That seems like a pretty easy way to deal with it.
 

Sevendogsbsd

Aspiring Daemon

Reaction score: 524
Messages: 974

Easier than ports-mgmt/poudriere but I am used to the latter so am working on re-setting up my build box again. Not having luck with 2 ports though so fortunately I have not switched my main machine's repository yet. Not sure I am going to use this as a final solution because it's a bit of a pain. Not a big deal but I have to updated ports, then run poudriere to build, which normally takes a few hours, then update everything on my workstation from the new repository. It's not like I am run a hurry though - just my personal workstation at home.

"Latest" packages works very well for me so far.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,287
Messages: 33,827

Not a big deal but I have to updated ports, then run poudriere to build, which normally takes a few hours, then update everything on my workstation from the new repository.
Once you have everything set up just create a small script that runs the update and starts a build. Turn it into a cronjob and let it do it's thing while you sleep.

Here's what I've been using for some time now:
Code:
#!/bin/sh

POUDRIERE=/usr/local/bin/poudriere

BASEDIR=/usr/local/etc/poudriere.d

${POUDRIERE} ports -u -p desktop
${POUDRIERE} ports -u -p server

for j in 12-stable 121-release; do
  ${POUDRIERE} bulk -j ${j} -p server -f ${BASEDIR}/${j}-server-package.lst
done

for j in 12-stable; do
  ${POUDRIERE} bulk -j ${j} -p desktop -f ${BASEDIR}/${j}-desktop-package.lst
done
Code:
# ll *-package.lst
-rw-r--r--  1 root  wheel  1426 Dec 26 21:16 12-stable-desktop-package.lst
-rw-r--r--  1 root  wheel  1392 Dec 26 16:12 12-stable-server-package.lst
-rw-r--r--  1 root  wheel  1459 Dec 29 23:10 121-release-server-package.lst
I just let this run during the night. I used to have a 113-release jail too but I recently upgraded everything and only have 12-STABLE and 12.1-RELEASE now.
 

Duffyx

Active Member

Reaction score: 39
Messages: 107

Once you have everything set up just create a small script that runs the update and starts a build. Turn it into a cronjob and let it do it's thing while you sleep.
I have used both and I think Poudriere is the better tool but what I don't like about it is the jails.
Synth uses the host system with null_fs mounts and chroot to mimic a jail, there is an open PR to add this to Poudriere.
I always wonder, do you have to update the poudriere jail each time you do a source upgrade of the host system?
When runing STABLE-12 that can be quite frequent, and each time a poudriere jail is updated it rebuilds all packages.

SirDice, do you have any experience with this, or ever observed a breakage? Or should you only update the poudriere jail when the host system has gotten a major version upgrade?

TBH, using the base system as a jail is the only real feature I miss in Poudriere that is a bit of a blocker for me to switch.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,287
Messages: 33,827

I always wonder, do you have to update the poudriere jail each time you do a source upgrade of the host system?
When runing STABLE-12 that can be quite frequent, and each time a poudriere jail is updated it rebuilds all packages.
I update my 12-STABLE rather irregularly. Usually only when I feel like it or if there's some security issue. I have one machine I use for reference, I just follow the usual buildworld/installworld etc. there. Then I run a make release which gives me the images and an FTP tree. I use that FTP tree to update the poudriere jail:
Code:
JAILNAME    VERSION         ARCH  METHOD                                    TIMESTAMP           PATH
121-release 12.1-RELEASE-p1 amd64 ftp                                       2019-11-16 16:28:09 /usr/local/poudriere/jails/121-release
12-stable   12.1-STABLE     amd64 url=file:///storage/release/12-stable/ftp 2019-12-17 00:10:11 /usr/local/poudriere/jails/12-stable
Now the 12-stable can be updated fairly quickly with poudriere jail -u -j 12-stable.

@SirDice, do you have any experience with this, or ever observed a breakage?
Do things ever break? Sure. Some ports sometimes fail to build for whatever reason. The poudriere web interface is very useful and I check it regularly to see if anything broke. You can easily check the failed build logs there too.
 

Sevendogsbsd

Aspiring Daemon

Reaction score: 524
Messages: 974

Now I feel stupid: there is a poudriere web interface? 🤔 That would be handy because I have 2 ports that won't build and I can't figure out why.
 

zader

Active Member

Reaction score: 23
Messages: 166

thanks SirDice, that's good info .. I have been struggling a bit installing poudriere in a jail.. (vnet+loopback is a pita and for some reason when I setup a zfs filesystem in the jail, iocage can no longer unmount it for restarts/shutdowns)

q: ... is it worth going through the extra effort to create a zfs file-system within the poudriere jail? or just use the iocage defaults.. my thought was it could be good for snapshots.. but at the same time if I'm going to roll back .. just rolling back from the iocage dataset is just as easy..

after digging into this. I really would LOVE to see a default install option to create a local repository by default ..
 

Sevendogsbsd

Aspiring Daemon

Reaction score: 524
Messages: 974

So there is a sticky in this forum on how to install and set up poudriere. Very straight forward. You don't have to do anything special about the jails, they get created dynamically. I use zfs on my build box so didn't worry about what was "in"
the jail. Here is a link to the tutorial: Thread 38859
 

forgiven_noob

Member

Reaction score: 5
Messages: 33

i mix ports and pkg, it is kind of a mess
but i do not want to wait days for things like llvm or xorg to build
i only need a few programs to be as recent as possible and to be built with specific things (VLC with ASS, nvidia-driver with acpi power management and a few other things)
and from what i can see most of the more refined package management solutions involve building things from source one way or the other
my pc is not very good it can take a very long time to build something, i have just 2 cores
 
Top