Bug 155446 - LibreOffice does not build with ccache enabled on Windows
Summary: LibreOffice does not build with ccache enabled on Windows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: All Windows (All)
: medium normal
Assignee: Hossein
URL:
Whiteboard: target:24.2.0 target:7.6.6 target:7.6.5
Keywords:
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2023-05-23 08:29 UTC by Hossein
Modified: 2024-02-17 13:01 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-05-23 08:29:33 UTC
Description:
On Windows, building LibreOffice master with ccache enabled using Visual Studio became possible with the patches from Luboš Luňák in 2021.

At the time, a patched version of Cygwin ccache.exe binary was used. Unfortunately, the performance was not good, and the decision was not to use it.

Right now, the official binaries of the Cygwin contain the above patches, and they work with Visual Studio.

But with the latest sources, LibreOffice does not build when ccache enabled on Windows. OpenSSL is one of the libraries that LibreOffice depends on, and it does not build with ccache enabled.

Steps to Reproduce:
1. Build LibreOffice from sources on Windows using LODE instructions:
https://wiki.documentfoundation.org/Development/lode
2. Download ccache binary from Github, and put it in C:\cygwin64\bin (or other relevant folder, if you have changed the default Cygwin folder).

cccache 4.8.1
Windows x86_64 binary release
https://github.com/ccache/ccache/releases

3. Enable ccache in autogen.input with --enable-ccache
4. Build OpenSSL with:
    ./autogen.sh; make openssl

Actual Results:
Build fails with:

$ make openssl
cd C:/cygwin64/home/user/lode/dev/core/external/openssl && C:/cygwin64/home/user/lode/opt/bin/make -j 8 -rs
[build LOC] openssl
[build UPK] openssl-3.0.8.tar.gz
[build LOC] top level modules: openssl
[build PAT] openssl
Configuring OpenSSL version 3.0.8 for target VC-WIN64A
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created makefile.in
Created makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************

jom 1.1.2 - empower your cores

        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/crypto/bn_conf.h.in" > include\crypto\bn_conf.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/crypto/dso_conf.h.in" > include\crypto\dso_conf.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/asn1.h.in" > include\openssl\asn1.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/asn1t.h.in" > include\openssl\asn1t.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/bio.h.in" > include\openssl\bio.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/cmp.h.in" > include\openssl\cmp.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/cms.h.in" > include\openssl\cms.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/conf.h.in" > include\openssl\conf.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/crmf.h.in" > include\openssl\crmf.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/crypto.h.in" > include\openssl\crypto.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/ct.h.in" > include\openssl\ct.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/err.h.in" > include\openssl\err.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/ess.h.in" > include\openssl\ess.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/fipskey.h.in" > include\openssl\fipskey.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/lhash.h.in" > include\openssl\lhash.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/ocsp.h.in" > include\openssl\ocsp.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/opensslv.h.in" > include\openssl\opensslv.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/pkcs12.h.in" > include\openssl\pkcs12.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/pkcs7.h.in" > include\openssl\pkcs7.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/safestack.h.in" > include\openssl\safestack.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/srp.h.in" > include\openssl\srp.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/ssl.h.in" > include\openssl\ssl.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/ui.h.in" > include\openssl\ui.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/x509.h.in" > include\openssl\x509.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/x509_vfy.h.in" > include\openssl\x509_vfy.h
        "C:/cygwin64/bin/perl.exe" "-I." -Mconfigdata "util/dofile.pl" "-omakefile" "include/openssl/x509v3.h.in" > include\openssl\x509v3.h
        C:\cygwin64\bin\jom.exe / depend
        C:\cygwin64\bin\jom.exe / _build_sw
        "C:\cygwin64\bin\ccache.exe C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe "  -Z7  /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -I"." -I"include" -I"apps/include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"C:/Program Files/Common Files/SSL\"" -D"ENGINESDIR=\"C:/Program Files/OpenSSL/lib/engines-3\"" -D"MODULESDIR=\"C:/Program Files/OpenSSL/lib/ossl-modules\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG"   -c /Foapps\lib\libapps-lib-app_libctx.obj "apps/lib/app_libctx.c"
The filename, directory name, or volume label syntax is incorrect.
jom: C:\cygwin64\home\user\lode\dev\core\workdir\UnpackedTarball\openssl\Makefile [apps\lib\libapps-lib-app_libctx.obj] Error 1
        "C:\cygwin64\bin\ccache.exe C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe "  -Z7  /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -I"." -I"include" -I"apps/include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"C:/Program Files/Common Files/SSL\"" -D"ENGINESDIR=\"C:/Program Files/OpenSSL/lib/engines-3\"" -D"MODULESDIR=\"C:/Program Files/OpenSSL/lib/ossl-modules\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG"   -c /Foapps\lib\libapps-lib-app_params.obj "apps/lib/app_params.c"
The filename, directory name, or volume label syntax is incorrect.
        "C:\cygwin64\bin\ccache.exe C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe "  -Z7  /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -I"." -I"include" -I"apps/include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"C:/Program Files/Common Files/SSL\"" -D"ENGINESDIR=\"C:/Program Files/OpenSSL/lib/engines-3\"" -D"MODULESDIR=\"C:/Program Files/OpenSSL/lib/ossl-modules\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG"   -c /Foapps\lib\libapps-lib-app_provider.obj "apps/lib/app_provider.c"
jom: C:\cygwin64\home\user\lode\dev\core\workdir\UnpackedTarball\openssl\Makefile [apps\lib\libapps-lib-app_params.obj] Error 1
The filename, directory name, or volume label syntax is incorrect.
jom: C:\cygwin64\home\user\lode\dev\core\workdir\UnpackedTarball\openssl\Makefile [apps\lib\libapps-lib-app_provider.obj] Error 1
jom: C:\cygwin64\home\user\lode\dev\core\workdir\UnpackedTarball\openssl\makefile [build_sw] Error 2
make[1]: *** [C:/cygwin64/home/user/lode/dev/core/external/openssl/ExternalProject_openssl.mk:65: C:/cygwin64/home/user/lode/dev/core/workdir/ExternalProject/openssl/build] Error 1
make: *** [Makefile:121: openssl] Error 2

Expected Results:
Build should pass


Reproducible: Always


User Profile Reset: No

Additional Info:
A more detailed description is provided here:

Using ccache and jom to speed up Windows builds
https://lists.freedesktop.org/archives/libreoffice/2023-May/090397.html

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: dc11f5b151e1a2ea2623fc8cf806a400763955d9
CPU threads: 20; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: CL threaded
Comment 1 Julien Nabet 2023-05-23 11:53:15 UTC
I'm a bit worried here.
I mean on Windows when building from scratch, it's long but it works.
But, when updating local repo, quite often, just running make on the directory impacted or even running a global make fails to build ; as if some kind of dependencies weren't taken into account. In comparison, I almost never encounter the pb on Linux.
I just hope the use of ccache/jom won't make the situation even worse.
Comment 2 Hossein 2023-05-23 12:51:11 UTC
(In reply to Julien Nabet from comment #1)
> I'm a bit worried here.
> I mean on Windows when building from scratch, it's long but it works.
> But, when updating local repo, quite often, just running make on the
> directory impacted or even running a global make fails to build ; as if some
> kind of dependencies weren't taken into account. In comparison, I almost
> never encounter the pb on Linux.
> I just hope the use of ccache/jom won't make the situation even worse.
ccache and jom are optional: you can benefit from them if you want to use them. So, I think they should not worry you. Also, ccache on Windows was used to work.
The problem with dependencies on Windows can have other roots, and should be fixed after the problem is carefully examined and documented.
Comment 3 Commit Notification 2023-08-09 08:15:44 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0c9f095a01682d8cb99a596e568bd81ae96906a5

tdf#155446 Fix problem with ccache on Windows

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2024-02-16 18:26:30 UTC
Hossein committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/aeca67238e26cd148083055e0f223753f7462c14

tdf#155446 Fix problem with ccache on Windows

It will be available in 7.6.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2024-02-17 13:01:24 UTC
Hossein committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-5":

https://git.libreoffice.org/core/commit/755bafba7ea3642df99ca0bd2b77e608ffa3e4d3

tdf#155446 Fix problem with ccache on Windows

It will be available in 7.6.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.