• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Proper operation of Synth

toprank

Member

Thanks: 1
Messages: 32

#1
I'm not sure that I've got the grasp of Synth.

I'm trialing it on a server for the first time, having decided to make the switch from Poudriere, and wish to create a local repository to install packages built with Synth by using pkg.

For example, I've built a number of packages with synth just-build ports2build.txt that now reside in /var/synth/live_packages/All/, have then issued synth prepare-system, and now want pkg to install these local Synth built packages--not binaries from the FreeBSD repository.

But when I issue pkg install multitail, for example, it goes to install from the FreeBSD repository--not the local Synth repo.

Code:
# pkg install multitail
Updating Synth repository catalogue...
Synth repository is up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    multitail: 6.4.2 [FreeBSD]

Number of packages to be installed: 1

119 KiB to be downloaded.

Proceed with this action? [y/N]:
See Synth configuration:

Code:
Synth configuration profile: LiveSystem
===============================================================================
   [A] Ports directory            /usr/ports
   ['B] Packages directory         /var/synth/live_packages
   [C] Distfiles directory        /usr/ports/distfiles
   [D] Port options directory     /var/db/ports
   [E] Build logs directory       /var/log/synth
   [F] Build base directory       /usr/obj/synth-live
   [G] System root directory      /
   [H] Compiler cache directory   /var/cache/ccache
   ['I] Num. concurrent builders   3
   [J] Max. jobs per builder      3
   [K] Use tmpfs for work area    true
   [L] Use tmpfs for localbase    true
   [M] Display using ncurses      true
   [N] Fetch prebuilt packages    true

   [>]   Switch/create profiles
   [RET] Exit

Press key of selection:
Contents of /usr/local/etc/pkg/repos/ directory:

Code:
/usr/local/etc/pkg/repos # ls
00_synth.conf    FreeBSD.conf
Contents of these *.conf files:

Code:
cat /usr/local/etc/pkg/repos/00_synth.conf 
# Automatically generated.

Synth: {
  url      : file:///var/synth/live_packages,
  priority : 0,
  enabled  : yes,
}
Code:
cat /usr/local/etc/pkg/repos/FreeBSD.conf 

FreeBSD: {

    url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"

}
I have configured this FreeBSD.conf file to use the latest FreeBSD package repository because I use portsnap to update the ports tree and want to adhere to the instructions on the Synth GitHub page of "ensur[ing] pkg(8) is configured for the Latest packages and the ports tree is as well" when setting Fetch prebuilt packages to true (cf. option [N] in synth configure):

Synth is configured to prefetch suitable officially-built packages, but very few are actually retrieved. What's wrong?
This only happens to FreeBSD users. On FreeBSD, there are basically two official repositories: Quarterly and Latest. The 10.2 Release and later have pkg(8) configured to use the Quarterly packages by default. Earlier releases are configured to use the Latest packages.

Either repository is fine, but the provided ports tree has to match! If you decided to continue with the Quarterly branch (a fine choice if you don't like constant rebuilding) then you need to provide Synth with a SVN version of the ports tree set to the same Quarterly branch. As could be deduced from the name, a new SVN branch is created every three months, so Synth users that choose the Quarterly ports and packages need to remember to switch branches in January, April, July, and October.

If you want the newest versions of software always and still leverage prebuilt packages, then ensure pkg(8) is configured for the Latest packages and the ports tree is as well. Unlikely Quarterly users, Latest users never have to change the ports tree configuration.
What have I misconfigured that pkg(8) resorts to installing packages from the remote FreeBSD repository and not the local Synth repo? Is it simply a matter of assigning a higher priority variable in /usr/local/etc/pkg/repos/00_synth.conf than in the /usr/local/etc/pkg/repos/FreeBSD.conf file?
 

PacketMan

Aspiring Daemon

Thanks: 131
Messages: 854

#2
Did Synth actually build the sysutils/multitail package? Look in /var/synth/live_packages/All and see if the package is there? It may not be because you have
Code:
[N] Fetch prebuilt packages    true
configured. Which is the way it is supposed to work. When you have fetching prebuilt packages turned on, Synth will only build the packages it needs to. The rest it will download at time of repository bulding. I use synth upgrade-system after synth prepare-system to do the package installation for me. I haven't used Synth in a while now; just haven't been doing any updates lately; but my memory tells me Synth would fetch any prebuilt packages during synth prepare-system, but I don't think it will do that during synth just-build command. I can try and test this weekend if I can get some time.

EDIT: Only reason I do prepare-system before I do an upgrade-system is to allow and verify that everything and built successfully before I try to do the upgrade part. Slow and steady, block by block, wins the race right?
 

toprank

Member

Thanks: 1
Messages: 32

#3
Yes, Synth did build this port and the .txz package is in /var/synth/live_packages/All

Code:
/var/synth/live_packages/All # ls multi*
multitail-6.4.2.txz
Is this strange behaviour or do I have something misconfigured?

Code:
root@novo:/var/synth/live_packages/All # ls multi*
multitail-6.4.2.txz
root@novo:/var/synth/live_packages/All # pkg install multitail
Updating Synth repository catalogue...
Synth repository is up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    multitail: 6.4.2 [FreeBSD]

Number of packages to be installed: 1

119 KiB to be downloaded.

Proceed with this action? [y/N]: n
root@novo:/var/synth/live_packages/All #
 

PacketMan

Aspiring Daemon

Thanks: 131
Messages: 854

#4
Hmmm I never use pkg(8) to install from Synth, I use Synth exclusively. But I think you are supposed to do something like this pkg install -R Synth multitail.
 

toprank

Member

Thanks: 1
Messages: 32

#5
Thank you, but it produces the same result:

Code:
# pkg install -R Synth multitail
Updating Synth repository catalogue...
Synth repository is up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    multitail: 6.4.2 [FreeBSD]

Number of packages to be installed: 1

119 KiB to be downloaded.

Proceed with this action? [y/N]: n
 

toprank

Member

Thanks: 1
Messages: 32

#6
Ah lowercase r works!

Code:
# pkg install -r Synth multitail
Updating Synth repository catalogue...
Synth repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    multitail: 6.4.2 [Synth]

Number of packages to be installed: 1

Proceed with this action? [y/N]: y
[1/1] Installing multitail-6.4.2...
[1/1] Extracting multitail-6.4.2: 100%
 

toprank

Member

Thanks: 1
Messages: 32

#7
Can it be configured so that the local Synth repository is used by default without having to pass the -r Synth option?
 

toprank

Member

Thanks: 1
Messages: 32

#9
The "default" way to use ports-mgmt/synth is disabling the FreeBSD official repository and just have the Synth one ON. The last time I used it Synth automatically disabled the FreeBSD one.
How does this work with:

Code:
  [N] Fetch prebuilt packages    true
And:

Synth is configured to prefetch suitable officially-built packages, but very few are actually retrieved. What's wrong?
This only happens to FreeBSD users. On FreeBSD, there are basically two official repositories: Quarterly and Latest. The 10.2 Release and later have pkg(8) configured to use the Quarterly packages by default. Earlier releases are configured to use the Latest packages.

Either repository is fine, but the provided ports tree has to match! If you decided to continue with the Quarterly branch (a fine choice if you don't like constant rebuilding) then you need to provide Synth with a SVN version of the ports tree set to the same Quarterly branch. As could be deduced from the name, a new SVN branch is created every three months, so Synth users that choose the Quarterly ports and packages need to remember to switch branches in January, April, July, and October.

If you want the newest versions of software always and still leverage prebuilt packages, then ensure pkg(8) is configured for the Latest packages and the ports tree is as well. Unlikely Quarterly users, Latest users never have to change the ports tree configuration.
 

toprank

Member

Thanks: 1
Messages: 32

#11
Primarily habit, to be honest. I can't really argue that typing pkg install app is any quicker than synth install category/port except with synth install I'd have to remember the port category, which might involve a freshports.org search or similar. This is cumbersome in comparison. But also because it should work. And this is a test run before deploying the repository to a webserver for other machines to access remotely. I don't want to install Synth on all the workstations that will be using this repo, so it has to work.
 

lebarondemerde

Daemon

Thanks: 582
Messages: 1,336

#12
toprank

/usr/local/etc/pkg/repos/FreeBSD.conf
Code:
FreeBSD: {
   url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
   mirror_type: "srv",
   signature_type: "fingerprints",
   fingerprints: "/usr/share/keys/pkg",
   enabled: no
}
PacketMan

The problem of using ports-mgmt/synth to install the packages it built, like synth upgrade-system is not related with Synth it-self but with pkg, what is issued by Synth to actutally install the packages.

If some silly dependency that many packages depends fail during the process, when Synth later issue pkg it will do using --yes (without confirmation) and you can easily end up without a large number of your packages uninstalled.
 

PacketMan

Aspiring Daemon

Thanks: 131
Messages: 854

#13
PacketMan
If some silly dependency that many packages depends fail during the process, when Synth later issue pkg it will do using --yes (without confirmation) and you can easily end up without a large number of your packages uninstalled.
Why is why I said I use synth prepare-system first, to make sure all built well. If anything fails I go investigate and (try to) fix it. Then after that is all resolved I then do the synth upgrade-system. I have not had a single issue to date doing it that way.
 

lebarondemerde

Daemon

Thanks: 582
Messages: 1,336

#14
The point is, Synth does not install the packages by it-self, it just issue pkg to do the job. Using synth prepare-system to build the ports and later synth upgrade-system to install them instead of pkg upgrade will just make the process slower because synth will do some checks it already did when synth prepare-system was used. :D
 

toprank

Member

Thanks: 1
Messages: 32

#16
What is considered best practice when using Synth built repository on the local machine?

synth install category/port

or

synth just-build listofports.txt
pkg install -r Synth port

or only enable Synth (and disable FreeBSD) repository and

synth just-build listofports.txt
pkg install port
 

lebarondemerde

Daemon

Thanks: 582
Messages: 1,336

#17
toprank

For new packages it doesn't matter if you use synth install or synth build or synth just-build, depends on your objectives.

IIRC, synth just-build does not rebuild the repository and then you will need to issue synth rebuild-repository to have the built packages available to be installed.
 
Top