# poudriere "----packages-build" alternative



## toprank (Jan 25, 2018)

Does poudriere have an option to use binary packages for build dependencies like 
	
	



```
portmaster --packages-build
```
?


----------



## tobik@ (Jan 25, 2018)

If you mean using packages from pkg.FreeBSD.org for build dependencies then the answer is no.


----------



## toprank (Jan 25, 2018)

Thank you. Seems like it would be a handy option to have; would surely save a lot of time.


----------



## swegen (Jan 25, 2018)

With ports-mgmt/synth it is possible to set it to use pre-built packages for dependencies.


----------



## PacketMan (Jan 25, 2018)

swegen said:


> With ports-mgmt/synth it is possible to set it to use pre-built packages for dependencies.



I use the "fetch pre-built packages" option in Synth all the time, it sames a fair amount of time, and I am not aware of any consequences from using it.


----------



## toprank (Jan 26, 2018)

swegen said:


> With ports-mgmt/synth it is possible to set it to use pre-built packages for dependencies.



I've just discovered ports-mgmt/synth and it looks like the answer to this glaring oversight in poudriere.



PacketMan said:


> I use the "fetch pre-built packages" option in Synth all the time, it sames a fair amount of time, and I am not aware of any consequences from using it.



I was wondering how well this functioned. Have you configured pkg(8) and ports to use the _Latest_ packages?


----------



## PacketMan (Jan 26, 2018)

toprank said:


> .... to this glaring oversight in poudriere.



I've never used poudriere myself, but I do know a bunch of the fellows here pretty much insist on building all packages.  There are synth users here I do believe that leave that option turned off. Not sure why, it may be what they are used to, personal preference.

Or maybe there is a good valid technical reason that I missed.


----------



## toprank (Jan 26, 2018)

PacketMan said:


> I've never used poudriere myself, but I do know a bunch of the fellows here pretty much *insist on building all packages*.  There are synth users here I do believe that leave that option turned off. Not sure why, it may be what they are used to, personal preference.
> 
> Or maybe there is a good valid technical reason that I missed.



If there's one thing I've found to be almost always true, it's that any absolutist position is invariably wrong. The absolutism of this truism isn't lost on me.

I, too, keep hearing that you shouldn't use both packages and ports--so if you're using synth you're using ports and thus shouldn't use packages--but have yet to hear a valid argument against using packages for build dependencies.


----------



## PacketMan (Jan 26, 2018)

Yes you should not mix two 'systems' of managing the programs you install. Use "ports" or "packages", that is true.  However Synth is the best of both worlds.  John Marino can correct me, but Synth is fundamentally a packages tool. It builds packages and then can install those packages.  It does not install via ports. I'm not wording this right.  The 'front user end' uses the ports tree, but also uses the package system if so desired. It then does all the dependency sanity checking, etc, etc, and then builds (compiles) packages. So even if you have configured Synth to fetch pre-built packages, you/it will be using ports and packages, but there is only one output from Synth, and that is packages.

Can someone say it better than me please? Please. I insist.


----------



## toprank (Jan 26, 2018)

Regardless of your preference--ports via `poudriere` or `synth` or `portmaster` or `make config-recursive install clean`or `pkg`--FreeBSD always only installs binary packages. The difference lies in where those packages come from: a repository of compiled binary packages from FreeBSD (as a collective) or a repository of your own locally compiled binary packages (whether that's a repository of 1 [locally compiled] package at a time via `portmaster category/port` or `make install` or a repository of many compiled packages from a bulk `poudriere` or `synth` build). That's the only difference in the two systems of installing programs on FreeBSD. They're all binary packages that get installed.


----------



## PacketMan (Jan 26, 2018)

toprank said:


> They're all binary packages that get installed.



I was sure there was a discussion about this a couple years ago, that portmaster does not create a package that gets extracted and installed. Yeah it creates a binary and does other stuff, but a 'package' is not created. Someone feel free to correct me. Anyone remember that discussion thread ?


----------



## swegen (Jan 26, 2018)

I tested this in a VM where i first removed all packages from the system with `pkg delete -af`.

Then I went to build /usr/ports/print/indexinfo that has no dependencies.
But as turns out with `make install` the pkg() itself is a dependency as it builds and installs first.

make() creates work/stage subdirectory, from which a package is seemingly built and installed with pkg().

Here is some additional information from https://wiki.freebsd.org/Ports/StageDir:


> The stage directory support means that a port does not install directly into the destination directories, but instead into a separate directory (automake packages call this DESTDIR) from which the package is then built - in many cases, this does not require root privileges. If enabled for a port, the package is first built, installed into the STAGEDIR, packaged, and then installed from the package. If disabled, the traditional approach is used, which means to install directly into the destination and build the package from there.


----------



## toprank (Jan 27, 2018)

PacketMan said:


> I was sure there was a discussion about this a couple years ago, that portmaster does not create a package that gets extracted and installed. Yeah it creates a binary and does other stuff, but a 'package' is not created. Someone feel free to correct me. Anyone remember that discussion thread ?



I'm not aware of that discussion, but I don't think that's the case; I have packages installed on my system that were installed via portmaster. Pretty sure `postmaster category/port` creates a binary package before installation of the program.


----------



## tobik@ (Jan 27, 2018)

toprank said:


> I'm not aware of that discussion, but I don't think that's the case; I have packages installed on my system that were installed via portmaster. Pretty sure `postmaster category/port` creates a binary package before installation of the program.


No, portmaster uses the install target of the port in that case and it doesn't create an intermediary package.  It just creates a package manifest and registers the port installation with the package database (see pkg-register(8)). There is no compression step and no *.txz is being created.


----------



## linux->bsd (Jul 23, 2021)

This is the only relevant result that shows up from an Internet search of the topic, so I'll add a note that ports-mgmt/poudriere-devel now has the relevant feature. 


```
-b name     Specify the name of the binary package branch to use to prefetch
              packages.  Should be "latest", "quarterly", "release_*", or url.
              With this option poudriere will first try to fetch from the
              binary package repository specified the binary package prior to
              do the sanity check if the package does not already exist.  When
              -t is used along with -C, or -c, then listed packages will not
              be fetched.

              See PACKAGE_FETCH_BRANCH, and PACKAGE_FETCH_URL, in
              poudriere.conf.sample.
```


----------

