# synth cannot install or upgrade darktable



## topcat (Sep 10, 2019)

Hi, I'm having a very strange problem where ports-mgmt/synth is unable to install graphics/darktable. I'm using the command `synth build graphics/darktable`. It would build it successfully, but after rebuilding the repos the package file would disappear from the repo directory and pkg would fail. Here's what the session looks like:

```
root@giskard:~ [9:51:07]# synth build graphics/darktable
Scanning existing packages.
 progress: 93.92%


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

Duration: 00:01:55
The build logs can be found at: /bigdata/synth/log/synth
Would you like to rebuild the local repository (Y/N)? y
Stand by, recursively scanning 1 port serially.
Scanning existing packages.
darktable-2.6.2_3.txz failed dependency check.
Packages validated, rebuilding local repository.
Local repository successfully rebuilt
Would you like to upgrade your system with the new packages now (Y/N)? y
Updating Synth repository catalogue...
Fetching meta.txz: 100%    260 B   0.3kB/s    00:01
Fetching packagesite.txz: 100%  248 KiB 254.0kB/s    00:01
Processing entries: 100%
Synth repository update completed. 1035 packages processed.
All repositories are up to date.
pkg: No packages available to install matching 'darktable-2.6.2_3' have been found in the repositories
Unfortunately, the system upgraded failed.
```

The problem seems to be the dependency check failure. I have uninstalled graphics/darktable and all its dependencies, but the problem is still present. 

More info: typically my upgrade routine is:

```
portsnap fetch
portsnap update
synth status
synth prepare-system
synth upgrade-system
```


----------



## topcat (Sep 10, 2019)

I have deleted the dependency packages from my local synth repo and am rebuilding. If this does not work I'm going to try nuking the entire repo. That _should_ fix it.

It would be useful it port-mgmt/synth prints out what caused the dependency check to fail.


----------



## topcat (Sep 11, 2019)

Ok I believe there is a problem with either ports-mgmt/synth or graphics/darktable regarding dependencies (probably the latter). According to ports-mgmt/synth, graphics/darktable is always failing the dependency check. I rebuilt the repo from scratch.


----------



## rigoletto@ (Sep 11, 2019)

Have a look on the build log (I don't remember the actual path).

*[EDIT]*



> Build logs
> 
> Every build produces a log. By default they are located at /var/logs/synth, but this location is configurable. The log name is in the format [category]___[portname].log.


----------



## topcat (Sep 11, 2019)

The build log shows no errors. Indeed, the package file is built successfully. However, after building ports-mgmt/synth does a dependency check on all packages, and this fails with the message

```
darktable-2.6.2_3.txz failed dependency check.
```
When this happens the package is deleted from the repository. The deletion is normal behaviour, but the dependency check should not fail.


----------



## rigoletto@ (Sep 11, 2019)

I will try to build in here but should take some time. I report later. 

*[EDIT]*

In the meaning time try to build with `test` to see if you get some more information.


----------



## topcat (Sep 11, 2019)

I appreciate it, thank you 

Will you be using synth?

Test build is running...


----------



## rigoletto@ (Sep 11, 2019)

topcat said:


> Will you be using synth?



No, Poudriere.


----------



## rigoletto@ (Sep 11, 2019)

Btw, have a look if that is not related with some OPTION. May be helpful to isolate the source of the problem.


----------



## topcat (Sep 11, 2019)

Further info: I cleared out all the custom options for darktable using:

```
make -C /usr/ports/graphics/darktable rmconfig
```
Previously I was using the following options:

```
cat /var/db/ports/graphics_darktable/options

# This file is auto-generated by 'make config'.
# Options for darktable-2.2.3
_OPTIONS_READ=darktable-2.2.3
_FILE_COMPLETE_OPTIONS_LIST=COLORD DOCS FLICKR GEO GPHOTO GRAPHMAGICK LIBSECRET LUA NLS OPENEXR OPENJPEG PRINT WEBP
OPTIONS_FILE_SET+=COLORD
OPTIONS_FILE_SET+=DOCS
OPTIONS_FILE_SET+=FLICKR
OPTIONS_FILE_SET+=GEO
OPTIONS_FILE_SET+=GPHOTO
OPTIONS_FILE_UNSET+=GRAPHMAGICK
OPTIONS_FILE_UNSET+=LIBSECRET
OPTIONS_FILE_SET+=LUA
OPTIONS_FILE_SET+=NLS
OPTIONS_FILE_SET+=OPENEXR
OPTIONS_FILE_SET+=OPENJPEG
OPTIONS_FILE_SET+=PRINT
OPTIONS_FILE_SET+=WEBP
```
The dependency check still fails unfortunately, but both normal and `test` builds are successful. So I believe it's something to do with how synth is reading the dependencies.


----------



## topcat (Sep 11, 2019)

Update: I believe I have found the problem.

I checked the synth build log files for anomalies and found something interesting in the darktable log which is not present in the logs for any of the other ports:

```
actual-package-depends: dependency on /usr/lib/libomp.so not registered (normal if it belongs to base)
```
It turns out that this is the problem. If I remove the OpenMP dependency in the darktable Makefile, then the above message disappears and synth is able to install the port. The port no longer fails the dependency check.

So, what can we do to fix this issue? I think with Poudriere you might not get this problem, but anyone using synth will be unable to install darktable.

Relevant lines from the Makefile which I commented out:

```
#.if ${ARCH} == amd64 && ${CHOSEN_COMPILER_TYPE} == clang
## Enable OpenMP support with Clang 6.0.
#LLVM_VER=      60
#BUILD_DEPENDS+=        clang${LLVM_VER}:devel/llvm${LLVM_VER}
#
#CPP=           clang-cpp${LLVM_VER}
#CC=            clang${LLVM_VER}
#CXX=           clang++${LLVM_VER}
#
#LIB_DEPENDS+=  libomp.so:devel/llvm${LLVM_VER}
#.endif
```


----------



## rigoletto@ (Sep 11, 2019)

Hmm. Still building in here[1] but many things have problems with OpenMP but I don't remember why (have a look on bugs). Better just disable it for now then.

[1] I've not update by a week so many things are outdated.


----------



## topcat (Sep 11, 2019)

Thank you for checking. I wonder if we can add an option to the Makefile to disable OpenMP properly without having to manually comment it out. For now I'll just do that.


----------



## rigoletto@ (Sep 11, 2019)

I will point bapt@ (the openmp maintainer) to here. Thank for looking at it.

*[EDIT]*

Btw, I do recommend you to open a bug report too.


----------



## topcat (Sep 11, 2019)

Bug report created: 240488


----------



## rigoletto@ (Sep 11, 2019)

Summon marino.


----------



## topcat (Sep 16, 2019)

I created this issue on github: https://github.com/jrmarino/synth/issues/168


----------

