# Multiple problems with synth



## Invarianz (Apr 22, 2020)

I have multiple problems with synth and its environment and can someone not find a way to debug these issues. It seems that they are all related to the configuration files synth defines and reads:
The first issue has to do with the /etc/make.conf file, where I define many options for my packages (e.g. I don't need wayland or qt dependencies etc.).
The relevant part comes from the manual page of synth:

```
<profile>-make.conf
               This is an optional, user-provided file.    If it exists,
               the builder's /etc/make.conf will be appended with the
               contents    of this    file. For the default profile, the
               file would normally be located at
               /usr/local/etc/synth/LiveSystem-make.conf
```
For me /etc/make.conf is never read or appended to. Only when /usr/local/etc/synth/LiveSystem-make.conf is an exact copy of /etc/make.conf does synth read my build options. Am I doing something wrong that /etc/make.conf is completely ignored?
The second part has to do with additional variables one can define during build time; the relevant man page entry is:

```
<profile>-environment
               This is an optional, user-provided file.    It contains a
               list of name-value pairs    joins with an equals sign
               (e.g. HTTP_PROXY=http://proxyserver:8888), one pair per
               line.  If the file exists, these    variables will be de-
               fined in    the builder environment.  For the default pro-
               file, the file would normally be    located    at
               /usr/local/etc/synth/LiveSystem-environment
```
I'm using the package x11-wm/dwm from the ports tree. It offers an environment variable called `DWM_CONF=/path/to/personal/config.h` to customize its behaviour during compilation. 
Also this file is completely ignored when building the package with synth. Event though /usr/local/etc/synth/LiveSystem-environment is defined with the proper line.
I can go on with the `OPTIONS_SET += BOOTSTRAP` not working with lang/gcc6-aux and other options working..
Is there any way for me to look at the currently defined environment variables inside synth while it is running or during a test? Something with its setting is seriously off and I doubt that this is a bug in any form since a lot of people are using it succesfully.


----------



## SirDice (Apr 23, 2020)

Invarianz said:


> Am I doing something wrong that /etc/make.conf is completely ignored?


No, it's supposed to be ignored.  Synth is a "clean-room" environment, so nothing from the host OS is used. The text refers to /etc/make.conf _inside_ the build jail, not the one on the host.


----------



## Invarianz (Apr 23, 2020)

That's already very helpful and explains my initial issues with /etc/make.conf. Is there any way for me to debug the remaining issues or any suggestion were the problems come from?


----------



## SirDice (Apr 23, 2020)

Invarianz said:


> It offers an environment variable called `DWM_CONF=/path/to/personal/config.h` to customize its behaviour during compilation.
> Also this file is completely ignored when building the package with synth.


You may need to export the variable; `export DWM_CONF=/path/to/personal/config.h`



Invarianz said:


> I can go on with the `OPTIONS_SET += BOOTSTRAP` not working with lang/gcc6-aux and other options working..


Remove the space between the variable and the `+=`.


----------



## Invarianz (Apr 23, 2020)

SirDice said:


> You may need to export the variable; `export DWM_CONF=/path/to/personal/config.h`


Doing this results in the following error when looking at the log for dwm:

```
~$ cat /var/log/synth/x11-wm___dwm.log 
=> Building x11-wm/dwm
Started : Thursday, 23 APR 2020 at 12:11:35 UTC
Platform: 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64

Environment definition failed, aborting entire build
```
So exporting variables seems to break the process completely.

The other diffculty with `OPTIONS_SET += BOOTSTRAP` is even weirder. To show the complete picture; this is my full LiveSystem-make.conf:

```
CPUTYPE?=penryn
MAKE_SHELL?=bash

OPTIONS_SET =  ALSA 
OPTIONS_SET += BASH BOOTSTRAP
OPTIONS_SET += CPU_OPTS COLORD CURL 
OPTIONS_SET += DBUS DJVU DOCS
OPTIONS_SET += FFMPEG FREEBSD FREEBSD_TEMPLATE FREETYPE FONTCONFIG
OPTIONS_SET += HELP
OPTIONS_SET += LAME LIBPROXY
OPTIONS_SET += MANPAGES MAN3 MMX
OPTIONS_SET += OPTIMIZED_CFLAGS OPENBLAS OBLAS OPENGL OPENJPEG OPENSSL
OPTIONS_SET += PYGMENTS
OPTIONS_SET += SSE SSH SVN
OPTIONS_SET += THREADS
OPTIONS_SET += VAAPI
OPTIONS_SET += WASM
OPTIONS_SET += X11 XINERAMA

OPTIONS_UNSET =  AVAHI
OPTIONS_UNSET += BABEL BDB BROADWAY
OPTIONS_UNSET += CANBERRA CMAKE_MODULES COMICS CONTRIB CVS
OPTIONS_UNSET += DEBUG DESKTOPFILES DMENUANDSTERM DTRACE
OPTIONS_UNSET += ECLIPSE EMACS EPUB EXAMPLES EXTENSIONS
OPTIONS_UNSET += FREI0R
OPTIONS_UNSET += GCONF GCRYPT GDBM GDK_PIXBUF GHOSTSCRIPT GITWEB GNOME3 GNUTLS GTK1 GTK2 GUI
OPTIONS_UNSET += ICONV IMLOCALE_FIX ISO14755 IPV6
OPTIONS_UNSET += JACK
OPTIONS_UNSET += KDE4 KERBEROS KEYRING
OPTIONS_UNSET += LADSPA LDAP LIBSIGSEGV LIBUNWIND LIGHTNING
OPTIONS_UNSET += NAS NAUTILUS NETLIB NETTLE NEXT_SCROLLBAR NLS
OPTIONS_UNSET += P4 PERL PGO PROFILE PROFILING PULSEAUDIO
OPTIONS_UNSET += RXVT_SCROLLBAR
OPTIONS_UNSET += TEST TRACE TOOLS
OPTIONS_UNSET += UNICODE3
OPTIONS_UNSET += OBJC OPENCV OPUS OSS
OPTIONS_UNSET += QT4 QT5
OPTIONS_UNSET += SDL SDL2 SEND_EMAIL SNDIO SUBTREE
OPTIONS_UNSET += VDPAU
OPTIONS_UNSET += WAYLAND
OPTIONS_UNSET += XEMACS XIM XTERM_SCROLLBAR XPS
OPTIONS_UNSET += ZSH
```
I can confirm by inspecting the build packages, using `pkg options PKGNAME`, that all other options are set correctly.
I consequently do not think that your suggestion:


SirDice said:


> Remove the space between the variable and the `+=`.


is the main culprit here. I will however try again with simpler build options; only defining `BOOTSTRAP` to see what happens.


----------

