[Libreoffice-commits] core.git: config_host/config_buildconfig.h.in configure.ac desktop/source

2023-11-13 Thread Mike Kaganski (via logerrit)
 config_host/config_buildconfig.h.in |9 +
 configure.ac|   20 
 desktop/source/lib/init.cxx |8 ++--
 3 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 93b4928dddf9cdd55450450995fefe324d771221
Author: Mike Kaganski 
AuthorDate: Sun Nov 12 10:30:19 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Nov 13 10:57:02 2023 +0100

Re-introduce build config to version info reported by LOK

... as an opt-in --with-buildconfig-recorded configure option.
This allows to have the data in the admin console, as implemented in
commit cbfac11330882c7d0a817b6c37a08b2ace2b66f4 (Send build config
(configure options) in LOKit version info JSON, 2022-11-07), when
reprobuilds are not required. The default is no build config, which
is compatible with reprobuilds.

This reverts commit 389def871853c885289627452f40b3ae0a8dabc8.

Change-Id: I7f0be489a1c82268d0ca38cb761843c9d432a14b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159344
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/config_host/config_buildconfig.h.in 
b/config_host/config_buildconfig.h.in
new file mode 100644
index ..a3b531e34e07
--- /dev/null
+++ b/config_host/config_buildconfig.h.in
@@ -0,0 +1,9 @@
+/* Options passed to configure script */
+
+#ifndef CONFIG_BUILDCONFIG_H
+#define CONFIG_BUILDCONFIG_H
+
+#define BUILDCONFIG ""
+#define BUILDCONFIG_RECORDED 0
+
+#endif
diff --git a/configure.ac b/configure.ac
index 303f143df198..0234537eb02b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2862,6 +2862,25 @@ AC_ARG_WITH(coredumpctl,
 [Use coredumpctl (together with systemd-run) to retrieve core dumps of 
crashing test
 processes.]))
 
+AC_ARG_WITH(buildconfig-recorded,
+AS_HELP_STRING([--with-buildconfig-recorded],
+[Put build config into version info reported by LOK. Incompatible with 
reproducible builds.]),
+)
+
+AC_MSG_CHECKING([whether to record build config])
+if test -z "$with_buildconfig_recorded"; then
+with_buildconfig_recorded=no
+fi
+if test "$with_buildconfig_recorded" = no; then
+AC_MSG_RESULT([no])
+else
+AC_MSG_RESULT([yes])
+# replace backslashes, to get a valid c++ string
+config_args=$(echo $ac_configure_args | tr '\\' '/')
+AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$config_args"]],[Options passed to 
configure script])
+AC_DEFINE([BUILDCONFIG_RECORDED],[1],[Options passed to configure script])
+fi
+
 dnl ===
 dnl Do we want to use pre-build binary tarball for recompile
 dnl ===
@@ -15070,6 +15089,7 @@ AC_CONFIG_FILES([config_host.mk
  
vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
 
 AC_CONFIG_HEADERS([config_host/config_atspi.h])
+AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
 AC_CONFIG_HEADERS([config_host/config_buildid.h])
 AC_CONFIG_HEADERS([config_host/config_box2d.h])
 AC_CONFIG_HEADERS([config_host/config_clang.h])
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3283cf7731e5..3ee743d4aada 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -7242,8 +7243,11 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER 
LibreOfficeKit* /*pThis*/)
 "\"ProductName\": \"%PRODUCTNAME\", "
 "\"ProductVersion\": \"%PRODUCTVERSION\", "
 "\"ProductExtension\": \"%PRODUCTEXTENSION\", "
-"\"BuildId\": \"%BUILDID\" "
-"}"_ustr));
+"\"BuildId\": \"%BUILDID\""
+#if BUILDCONFIG_RECORDED
+", \"BuildConfig\": \"" BUILDCONFIG "\""
+#endif
+" }"_ustr));
 }
 
 static void aBasicErrorFunc(const OUString& rError, const OUString& rAction)


[Libreoffice-commits] core.git: config_host/config_buildconfig.h.in configure.ac desktop/source

2023-11-05 Thread Thorsten Behrens (via logerrit)
 config_host/config_buildconfig.h.in |8 
 configure.ac|5 -
 desktop/source/lib/init.cxx |4 +---
 3 files changed, 1 insertion(+), 16 deletions(-)

New commits:
commit 389def871853c885289627452f40b3ae0a8dabc8
Author: Thorsten Behrens 
AuthorDate: Sun Nov 5 00:34:46 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Sun Nov 5 21:25:18 2023 +0100

reprobuild: don't include build machine setup in binaries

The configure line can leak data from the building machine (path
names, level of parallelism etc), which leads to non-reproducible
build results.

Change-Id: I042afc3d7bad19e8e274147be2a9eb0abcf5436e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158871
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/config_host/config_buildconfig.h.in 
b/config_host/config_buildconfig.h.in
deleted file mode 100644
index 0c93d6e02f84..
--- a/config_host/config_buildconfig.h.in
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Options passed to configure script */
-
-#ifndef CONFIG_BUILDCONFIG_H
-#define CONFIG_BUILDCONFIG_H
-
-#define BUILDCONFIG ""
-
-#endif
diff --git a/configure.ac b/configure.ac
index cb2f975bdd97..7b821c6343d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -523,10 +523,6 @@ git_date=`git log -1 --pretty=format:"%cd" 
--date=format:'%Y' 2>&/dev/null`
 LIBO_THIS_YEAR=${git_date:-2023}
 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
 
-# replace backslashes, to get a valid c++ string
-config_args=$(echo $ac_configure_args | tr '\\' '/')
-AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$config_args"]],[Options passed to 
configure script])
-
 dnl ===
 dnl Product version
 dnl ===
@@ -15045,7 +15041,6 @@ AC_CONFIG_FILES([config_host.mk
  
vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
 
 AC_CONFIG_HEADERS([config_host/config_atspi.h])
-AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
 AC_CONFIG_HEADERS([config_host/config_buildid.h])
 AC_CONFIG_HEADERS([config_host/config_box2d.h])
 AC_CONFIG_HEADERS([config_host/config_clang.h])
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 71eeabcbc380..3283cf7731e5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -7243,8 +7242,7 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER 
LibreOfficeKit* /*pThis*/)
 "\"ProductName\": \"%PRODUCTNAME\", "
 "\"ProductVersion\": \"%PRODUCTVERSION\", "
 "\"ProductExtension\": \"%PRODUCTEXTENSION\", "
-"\"BuildId\": \"%BUILDID\", "
-"\"BuildConfig\": \""  BUILDCONFIG  "\" "
+"\"BuildId\": \"%BUILDID\" "
 "}"_ustr));
 }
 


[Libreoffice-commits] core.git: config_host/config_buildconfig.h.in configure.ac desktop/source

2022-11-07 Thread Andras Timar (via logerrit)
 config_host/config_buildconfig.h.in |8 
 configure.ac|4 
 desktop/source/lib/init.cxx |4 +++-
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit cbfac11330882c7d0a817b6c37a08b2ace2b66f4
Author: Andras Timar 
AuthorDate: Mon Oct 10 23:38:56 2022 +0200
Commit: Andras Timar 
CommitDate: Mon Nov 7 20:35:46 2022 +0100

Send build config (configure options) in LOKit version info JSON

Change-Id: I29a6cca467e5f1e9ba59528edefbb397ceb81780
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141197
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141494
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/config_host/config_buildconfig.h.in 
b/config_host/config_buildconfig.h.in
new file mode 100644
index ..0c93d6e02f84
--- /dev/null
+++ b/config_host/config_buildconfig.h.in
@@ -0,0 +1,8 @@
+/* Options passed to configure script */
+
+#ifndef CONFIG_BUILDCONFIG_H
+#define CONFIG_BUILDCONFIG_H
+
+#define BUILDCONFIG ""
+
+#endif
diff --git a/configure.ac b/configure.ac
index b4b9a7a24eb7..9a445fefabc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -522,6 +522,8 @@ AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
 LIBO_THIS_YEAR=`date +%Y`
 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
 
+AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$ac_configure_args"]],[Options passed to 
configure script])
+
 dnl ===
 dnl Product version
 dnl ===
@@ -14830,6 +14832,8 @@ AC_CONFIG_FILES([config_host.mk
  instsetoo_native/util/openoffice.lst
  sysui/desktop/macosx/Info.plist
  
vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
+
+AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
 AC_CONFIG_HEADERS([config_host/config_buildid.h])
 AC_CONFIG_HEADERS([config_host/config_box2d.h])
 AC_CONFIG_HEADERS([config_host/config_clang.h])
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6414a3fe1ca9..6008820da1bb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 
 #include 
@@ -6539,7 +6540,8 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER 
LibreOfficeKit* /*pThis*/)
 "\"ProductName\": \"%PRODUCTNAME\", "
 "\"ProductVersion\": \"%PRODUCTVERSION\", "
 "\"ProductExtension\": \"%PRODUCTEXTENSION\", "
-"\"BuildId\": \"%BUILDID\" "
+"\"BuildId\": \"%BUILDID\", "
+"\"BuildConfig\": \""  BUILDCONFIG  "\" "
 "}"));
 }