Synth: Introducing new custom package repository builder for FreeBSD and DragonFly

It's 100% Synth packages. I even deleted all packages and reinstalled them all from the Synth repo to make sure everything was consistent. Oh well, it's OK now I have learnt about the -r switch to pkg install. That will do the trick :)
 
i just discovered that at least on dragonfly, the graceful shutdown no longer works on synth rebuild-repository. It appears that when synth is in text mode (as opposed to curses mode), the keypress detection is not triggered by control characters. Can anyone confirm the same from FreeBSD? I might have to change this shutdown key to capital-Q or something. really obnoxious.
 
the same thing seems to happen on FreeBSD as well. Hopefully I can figure out how to make control codes always work, but I may have to switch the key again.
 
FYI. From reading the man pages for pkg I think I worked out why I was having issues with it looking in the wrong repo. It says:

Install a package from a remote package repository. If a package is found in more than one remote repository, then installation happens from the first one. Downloading a package is tried from each package repository in turn, until the package is successfully fetched.

And if I run pkg -vv it shows FreeBSD before Synth:

Code:
Repositories:
  FreeBSD: {
  url  : "pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest",
  enabled  : yes,
  priority  : 0,
  mirror_type  : "SRV",
  signature_type  : "FINGERPRINTS",
  fingerprints  : "/usr/share/keys/pkg"
  }
  Synth: {
  url  : "file:///var/synth/live_packages",
  enabled  : yes,
  priority  : 0
  }

So I guess it maybe sees the FreeBSD one first and then installs/upgrades from that. Although just using -r Synth on the install/upgrade commands solves the problem as it only uses Synth then.
 
xtaz, it's very much recommended that you don't mix the official repo with your self built packages. It works only to an extent that you can replace leaf ports (ports that are not required by other ports) from the other repository, anything else and you might cause a dependency conflict that can not be solved by the dependency solver.
 
Indeed. I'm just mentioning this because other people might have the same confusion as me. The instructions for synth don't say to disable the FreeBSD repo, and in fact it's designed to work with it to fetch packages from an external repo if it doesn't need to build them itself. Comments in this thread also state that because synth's config starts with 00 that it takes priority over the FreeBSD repo because they are supposedly read in alphabetical order. Clearly the way pkg works means that this isn't always the case. So either you have to disable the external repo completely or you have to remember to use the -r switch to point it to a specific repo. This basically started off because I wondered why pkg install gmake wanted to install lua52 and gmp, which I found was because pkg was not in fact using Synth as a priority at all. So just mentioning my findings in case it helps others :)
 
FYI. From reading the man pages for pkg I think I worked out why I was having issues with it looking in the wrong repo. It says:

Install a package from a remote package repository. If a package is found in more than one remote repository, then installation happens from the first one. Downloading a package is tried from each package repository in turn, until the package is successfully fetched.

And if I run pkg -vv it shows FreeBSD before Synth:

So I guess it maybe sees the FreeBSD one first and then installs/upgrades from that. Although just using -r Synth on the install/upgrade commands solves the problem as it only uses Synth then.

The display order doesn't matter.
I think actually pkg(8) is broken.
The "first" one is the one that appears first in an alphabetical sort. This is why the synth conf file starts with "00_". The synth repo is the first one.

However, with -VV, I'm seeing synth first. You didn't define your own synth.conf did you?
 
xtaz, it's very much recommended that you don't mix the official repo with your self built packages. It works only to an extent that you can replace leaf ports (ports that are not required by other ports) from the other repository, anything else and you might cause a dependency conflict that can not be solved by the dependency solver.

this isn't exactly true. When synth has the prefetch option, it fetchs packages from the official repo and saves it in the synth repo and then when the repo is created it looks like synth created. So anyone with prefetch option enable is mixing packages (but the packages were vetted)
 
Clearly the way pkg works means that this isn't always the case. So either you have to disable the external repo completely or you have to remember to use the -r switch to point it to a specific repo. This basically started off because I wondered why pkg install gmake wanted to install lua52 and gmp, which I found was because pkg was not in fact using Synth as a priority at all. So just mentioning my findings in case it helps others :)

okay, so you already knew about alphabetical. I don't think the "priority" setting works at all.
I don't know if the order of -VV is significant or not (I tend to think it is but I'm not sure).
I still think the conf files priority is alphabetical.
 
I'm curious about how the "foreign environment" building is going to work. There must be ports that make assumptions about what is available in terms of binaries based on the uname(1) output. Let's say the host is FreeBSD 10 amd64 and you're building for FreeBSD 9 amd64. Just as an example FreeBSD 9 still has /usr/bin/dig file because it still has BIND in base and some ports might test for the existence of this file or could try to use some other FreeBSD 9 only binaries. I don't see how Synth could build such ports successfully if it can't provide the "real thing" for the build environment.
 
check any log produced by 1.00, specifically the ENV variables set.
you will see definitions for UNAME components. The uname(1) program and the uname(3) libc function both use these values when they are defined instead of sysctl results. That's how it works.
 
Yes I know that it sets the environment correctly and that's what Poudriere does as well when building for foreign environments. I'm more asking about the actual build environment because you have chosen not to go the Poudriere route which is providing pristine environments using separately installed base systems. I can see that your approach would work in most cases but as I said there must be ports that (correctly) assume that a FreeBSD 9 build environment would have all the FreeBSD 9 tools installed.
 
Nothing is different.
if you want to build FreeBSD 9 packages, you need a FreeBSD 9 system root -- just like poudriere.
The quickest way is download and extract.
(this is advanced stuff, but I expect anyone trying this already gets the basics)
 
this might help:

Poudriere:
  • sysroot installed via command (either built or installed or declared)
  • ports install via command (portsnap, svn, declared)
  • sandbox is constructed using freebds jails and poudriere refers to the sandbox as a jail
Synth:
  • sysroot is declared ("/" is default but user is responsible for providing it)
  • ports are declare (PORTSDIR is scanned to get the default)
  • sandbox is constructed by chroots but all based on sysroot. Synth refers to definition as a profile.
 
pristine is a frame of mind. If one extracts a FreeBSD release and doesn't touch it, and creates a synth profile that points to it, that is just as "pristine" as anything poudriere will use. The only risk is when the live system "/" is used. It's very clean but not guaranteed.
 
Hi!

I did run synth upgrade-systemand I got:
Scanning existing packages.
libc++-208080.txz failed dependency check.



The task is complete. Final tally:
Initial queue size: 2
packages built: 1
ignored: 1
skipped: 0
failed: 0

Duration: 00:00:48
The build logs can be found at: /var/log/synth
Scanning entire ports tree.
progress: 13.69%
culprit: devel/compiler-rt-devel
Scan aborted because dependency is malformed.
FETCH: compiler-rt-devel-3.9.d20160216.txz (devel/compiler-rt-devel)

I quit Synth with ctrl-q because nevwr fetch the file. And devel/compiler-rt-devel is marked broken.

Thank you.
BTW: I have updated Synth.
 
There are also a problem with synth status
Querying system about current package installations.
Stand by, comparing installed packages against the ports tree.
Scanning existing packages.
libc++-208080.txz failed dependency check.
These are the ports that would be built:
=> devel/libc++
=> net-im/skype4
Total packages that would be built: 2
The complete build list can also be found at:
/tmp/synth_status_results.txt
In the results.txt are the same two files.
 
fernandel the maintainer broke the port
Code:
> make -V BUILD_DEPENDS
clang-devel: not found
make: "/usr/ports/Mk/Uses/compiler.mk" line 69: warning: "clang-devel --version" returned non-zero status
make: "/usr/ports/Mk/Uses/compiler.mk" line 120: warning: "clang++-devel -### /dev/null 2>&1" returned non-zero status
llvm-config-devel:/usr/ports/devel/llvm-devel /usr/local/bin/cmake:/usr/ports/devel/cmake ninja:/usr/ports/devel/ninja
It's not Synth's fault.

I didn't understand your comment about /tmp/synth_status_results.txt. It's supposed to be the same as what is on the screen.
 
fernandel the maintainer broke the port
Code:
> make -V BUILD_DEPENDS
clang-devel: not found
make: "/usr/ports/Mk/Uses/compiler.mk" line 69: warning: "clang-devel --version" returned non-zero status
make: "/usr/ports/Mk/Uses/compiler.mk" line 120: warning: "clang++-devel -### /dev/null 2>&1" returned non-zero status
llvm-config-devel:/usr/ports/devel/llvm-devel /usr/local/bin/cmake:/usr/ports/devel/cmake ninja:/usr/ports/devel/ninja
It's not Synth's fault.

I didn't understand your comment about /tmp/synth_status_results.txt. It's supposed to be the same as what is on the screen.

Before it did show me all my built ports also.
 
i'm not sure why you quoted it and underlined it. Synth did exactly what the man page said it would do. I am very confused about what you are trying to tell me.
 
I like your synth. I try it and it works as expected.

I have prepare some ports which are not yet part of the ports tree and I want to test them.
When manually add port to the ports tree I got message before the build start:
Code:
Scan of devel/wrapper failed, it will not be considered.

What I have to done that synth build this port?
 
Back
Top