Seafile-Client Windows Build

Hello Community,
I need to recompile Seafile-Client for Windows.
Followed docs for but it will not working peoperly. I’m getting error

python .\build-msi-vs.py 8.0.0
[INFO] Building libsearpc
[INFO] running devenv “C:\tools\seafile\scripts\build…\libsearpc/libsearpc.sln” /Rebuild “Release|x64”, cwd=C:\tools\seafile\scripts\build…\libsearpc

Microsoft Visual Studio 2019 Version 16.11.10.
Copyright (C) Microsoft Corp. All rights reserved.

The license for Visual Studio expires in 30 days.
Rebuild started…
1>------ Rebuild All started: Project: libsearpc, Configuration: Release x64 ------
1>searpc-client.c
1>C:\tools\libsearpc\lib\searpc-client.h(10,10): fatal error C1083: Cannot open include file: ‘glib.h’: No such file or directory
1>searpc-named-pipe-transport.c
1>C:\tools\libsearpc\lib\searpc-named-pipe-transport.c(4,10): fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory
1>searpc-server.c
1>C:\tools\libsearpc\lib\searpc-server.c(7,10): fatal error C1083: Cannot open include file: ‘jansson.h’: No such file or directory
1>searpc-utils.c
1>C:\tools\libsearpc\lib\searpc-utils.c(2,10): fatal error C1083: Cannot open include file: ‘glib.h’: No such file or directory
1>Generating Code…
1>Done building project “libsearpc.vcxproj” – FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
[ERROR] error when running command:
devenv “C:\tools\seafile\scripts\build…\libsearpc/libsearpc.sln” /Rebuild “Release|x64”

Spent almost 2 days to resolve issue but nothing works properly
Is there anyone who can help?
Thank You

I have the same isssue. What I already found out:

after the installation of all dependencies using vcpkg i had to run the following command to integrate them into Visual Studio.

vcpkg integrate install

Currenty i have still some issues with glib on Windows.

Additionally the Script build-mssi-vs.py under seafile/scripts/build shows some more Informations.

  • QT has to be at Versio 5.15.1 and not 5.13.1

  • A Code Sigining Certificat has to be in place

  • wix has to be installed under C:\wix\bin

Code from Script

CERTFILE = “C:/certs/seafile.pfx”

QT_DIR = “C:/Qt/Qt5.15.1/5.15.1/msvc2019_64”

WIX_BIN = “C:/wix/bin”

OPENSSL_DIR = “C:/packagelib”

I hope someone from Seafile can clarify the issues and update the Documentation.

I made some Progress butt didn’t managed it to build windows.

  • Install VS Studio 2019 in English (important)
  • Install Wix
  • Install Parafin
  • Install vcpkg
  • Install QT 5.15.1 not 5.13.1

Installing third-party libraries

Install packages

vcpkg.exe install glib:x64-windows curl[core,openssl]:x64-windows openssl:x64-windows libevent:x64-windows jansson:x64-windows sqlite3:x64-windows pthreads:x64-windows getopt-win32:x64-windows

Make installed packages available user-wide

vcpkg integrate install

Copy Glib-2.0 Folder to VS2019 include Folder

Source: \vcpkg\packages\glib_x64-windows\include\glib-2.0
Destination C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include

Copy Glib.h File to VS2019 include Folder

Source: \vcpkg\packages\glib_x64-windows\include\glib-2.0\glib.h
Destination C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include
##Copy Glibconfig.h to VS2019 include Folder
Source: \vcpkg\packages\glib_x64-windows\lib\glib-2.0\include\glibconfig.h
Destination:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include

After That the Build Process starts without dependency issues and run for some time

python build-msi-vs.py 8.0.5

Then i get the following error:

`C:\src\seafile\scripts\build>python build-msi-vs.py 8.0.5
[INFO] Building libsearpc
[INFO] running devenv “C:\src\seafile\scripts\build…\libsearpc/libsearpc.sln” /Rebuild “Release|x64”, cwd=C:\src\seafile\scripts\build…\libsearpc

Microsoft Visual Studio 2019 Version 16.11.11.
Copyright (C) Microsoft Corp. All rights reserved.
Rebuild started…
1>------ Rebuild All started: Project: libsearpc, Configuration: Release x64 ------
1>searpc-client.c
1>C:\src\libsearpc\lib\searpc-client.c(77,66): warning C4311: ‘type cast’: pointer truncation from ‘void *’ to ‘long’
1>searpc-named-pipe-transport.c
1>searpc-server.c
1>searpc-utils.c
1>Generating Code…
1> Creating library C:\src\libsearpc\x64\Release\libsearpc.lib and object C:\src\libsearpc\x64\Release\libsearpc.exp
1>libsearpc.vcxproj → C:\src\libsearpc\x64\Release\libsearpc.dll
1>Done building project “libsearpc.vcxproj”.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
[INFO] Building seafile
[INFO] running devenv C:\src\seafile\scripts\build…\seafile/seafile.sln /Rebuild “Release|x64”, cwd=C:\src\seafile\scripts\build…\seafile

Microsoft Visual Studio 2019 Version 16.11.11.
Copyright (C) Microsoft Corp. All rights reserved.
Rebuild started…
1>------ Rebuild All started: Project: seafile, Configuration: Release x64 ------
1>block-backend-fs.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>block-backend.c
1>block-mgr.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>branch-mgr.c
1>cdc.c
1>rabin-checksum.c
1>commit-mgr.c
1>curl-init.c
1>diff-simple.c
1>fs-mgr.c
1>cache-tree.c
1>index.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>C:\src\seafile\common\index\index.c(36,56): warning C4312: ‘type cast’: conversion from ‘int’ to ‘HANDLE’ of greater size
1>log.c
1>mq-mgr.c
1>obj-backend-fs.c
1>obj-store.c
1>rpc-service.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>seafile-crypt.c
1>vc-common.c
1>cevent.c
1>C:\src\seafile\daemon\cevent.c(39,70): warning C4312: ‘type cast’: conversion from ‘long’ to ‘gconstpointer’ of greater size
1>C:\src\seafile\daemon\cevent.c(78,77): warning C4312: ‘type cast’: conversion from ‘long’ to ‘gpointer’ of greater size
1>C:\src\seafile\daemon\cevent.c(80,68): warning C4312: ‘type cast’: conversion from ‘long’ to ‘gpointer’ of greater size
1>C:\src\seafile\daemon\cevent.c(87,68): warning C4312: ‘type cast’: conversion from ‘long’ to ‘gpointer’ of greater size
1>Generating Code…
1>Compiling…
1>change-set.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>clone-mgr.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>filelock-mgr.c
1>C:\src\seafile\daemon\filelock-mgr.c(336,46): warning C4311: ‘type cast’: pointer truncation from ‘gpointer’ to ‘long’
1>C:\src\seafile\daemon\filelock-mgr.c(360,42): warning C4311: ‘type cast’: pointer truncation from ‘gpointer’ to ‘long’
1>http-tx-mgr.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>C:\src\seafile\daemon\http-tx-mgr.c(1901,70): warning C4312: ‘type cast’: conversion from ‘long’ to ‘void *’ of greater size
1>C:\src\seafile\daemon\http-tx-mgr.c(3621,32): warning C4311: ‘type cast’: pointer truncation from ‘gpointer’ to ‘long’
1>C:\src\seafile\daemon\http-tx-mgr.c(3635,32): warning C4311: ‘type cast’: pointer truncation from ‘gpointer’ to ‘long’
1>job-mgr.c
1>repo-mgr.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>seaf-daemon.c
1>Importing getopt library
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>C:\src\seafile\daemon\seaf-daemon.c(84,42): warning C4113: ‘void (__cdecl *)()’ differs in parameter lists from ‘RegisterMarshalFunc’
1>seafile-config.c
1>seafile-error.c
1>seafile-session.c
1>set-perm.c
1>sync-mgr.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>sync-status-tree.c
1>timer.c
1>vc-utils.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>wt-monitor-structs.c
1>wt-monitor-win32.c
1>wt-monitor.c
1>db.c
1>net.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>Generating Code…
1>Compiling…
1>repo.c
1>task.c
1>utils.c
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\fcntl.h(53,1): warning C4005: ‘O_BINARY’: macro redefinition
1>C:\src\seafile\lib\utils.h(120): message : see previous definition of ‘O_BINARY’
1>Generating Code…
1>c_bpwrapper.cpp
1>LINK : fatal error LNK1104: cannot open file ‘common.lib’
1>Done building project “seafile.vcxproj” – FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
[ERROR] error when running command:
devenv C:\src\seafile\scripts\build…\seafile/seafile.sln /Rebuild “Release|x64”^^
`

Hi,
Do you already have seen the updated build manual?
https://manual.seafile.com/build_seafile/windows/

maybe @Jonathan can keep an eye on the seafile error

I see a problem with this line from you @bosborus
vcpkg.exe install glib:x64-windows curl[core,openssl]:x64-windows openssl:x64-windows
You are installing the latest openssl version (3.X)
But according to the manual we should use 1.1.