You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pe...@apache.org on 2026/08/29 11:59:16 UTC
(openoffice) 13/17: odk: an x64 SDK must stamp windows_x86_64 into description.xml
This is an automated email from the ASF dual-hosted git repository.
leginee pushed a commit to branch win10-msvc-trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 31d987f26a98a5625c012d48682b407148914a0f
Author: Peter Kovacs <pe...@apache.org>
AuthorDate: Wed Aug 26 23:36:10 2026 +0200
odk: an x64 SDK must stamp windows_x86_64 into description.xml
platform.mk mapped UNOPKG_PLATFORM "Windows" to windows_x86
unconditionally, so an extension built with a 64-bit SDK declared the
32-bit platform and the office it belongs to refused to install it.
The two platform strings an extension carries are checked differently,
which is what makes UNOPKG_PLATFORM the wrong source for this one:
- the manifest media-type parameter goes through platform_fits(),
which also accepts a token with no architecture in it and matches on
the OS alone. "Windows" is therefore right on both architectures and
UNOPKG_PLATFORM stays as it is -- it is also the directory name
inside the .oxt.
- description.xml's <platform value="..."/> goes through
isValidPlatform(), which compares against a fixed list of exact
tokens. Nothing but windows_x86_64 will match a 64-bit build.
Nothing in the SDK environment knows the architecture -- settings.mk
derives PROCTYPE from config.guess, which does not exist on Windows and
leaves PROCTYPE empty there -- so the value is baked in when the SDK is
built, as SDK_PLATFORMID in the generated dk.mk. PLATFORMID is already
computed by solenv/inc/settings.mk as $(RTL_OS:l)_$(RTL_ARCH:l), which
is what the main build's own extensions are stamped with, so both sides
now derive from the same place: windows_x86 on wntmsci14, windows_x86_64
on wntmscx14. dk.mk is included before platform.mk, and the fallback
keeps an SDK built before this change working.
Verified with GNU make against the four cases: x64 SDK ->
windows_x86_64, x86 SDK -> windows_x86, SDK without SDK_PLATFORMID ->
windows_x86, Linux_x86_64 -> linux_x86_64. Not exercised by an actual
extension build.
Co-Authored-By: Claude Opus 5 <no...@anthropic.com>
Claude-Session: https://claude.ai/code/session_012NFKmwTogkytKnrTBX5Lax
---
main/odk/pack/copying/dk.mk | 7 +++++++
main/odk/pack/copying/makefile.mk | 2 +-
main/odk/settings/platform.mk | 12 +++++++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/main/odk/pack/copying/dk.mk b/main/odk/pack/copying/dk.mk
index 28ba9d4542..b3979c0216 100644
--- a/main/odk/pack/copying/dk.mk
+++ b/main/odk/pack/copying/dk.mk
@@ -23,3 +23,10 @@
SDKVERSION=@@RELEASE@@
BUILDID=@@BUILDID@@
SCM_REVISION=@@SCMREVISION@@
+
+# The extension platform token for the architecture this SDK was built for,
+# i.e. what description.xml's <platform value="..."/> has to say. Baked in
+# here because nothing in the SDK environment knows the architecture:
+# settings.mk derives PROCTYPE from config.guess, which does not exist on
+# Windows. See settings/platform.mk.
+SDK_PLATFORMID=@@PLATFORMID@@
diff --git a/main/odk/pack/copying/makefile.mk b/main/odk/pack/copying/makefile.mk
index 54cd41a317..42bf976324 100644
--- a/main/odk/pack/copying/makefile.mk
+++ b/main/odk/pack/copying/makefile.mk
@@ -231,7 +231,7 @@ $(DESTDIRBIN)/addsym-macosx.sh : addsym-macosx.sh
$(DESTDIRSETTINGS)/dk.mk : dk.mk
@@-rm -f $@
-$(MKDIRHIER) $(@:d)
- tr -d "\015" < dk.mk | sed -e 's/@@RELEASE@@/$(PRODUCT_RELEASE)/' -e 's/@@BUILDID@@/$(RSCREVISION)/' -e 's/@@SCMREVISION@@/$(SCMREVISION)/'> $@
+ tr -d "\015" < dk.mk | sed -e 's/@@RELEASE@@/$(PRODUCT_RELEASE)/' -e 's/@@BUILDID@@/$(RSCREVISION)/' -e 's/@@SCMREVISION@@/$(SCMREVISION)/' -e 's/@@PLATFORMID@@/$(PLATFORMID)/' > $@
$(CONVERTTAGFLAG) : $(DOCUHTMLFILES)
# $(PERL) $(CONVERTTAGSCRIPT) 1 "$(TITLE)" "$(OFFICEPRODUCTNAME)" $(DOCUHTMLFILES)
diff --git a/main/odk/settings/platform.mk b/main/odk/settings/platform.mk
index 8471e6b448..085594df1a 100644
--- a/main/odk/settings/platform.mk
+++ b/main/odk/settings/platform.mk
@@ -59,7 +59,17 @@ else
EXTENSION_PLATFORM=solaris_x86
else
ifeq "$(UNOPKG_PLATFORM)" "Windows"
- EXTENSION_PLATFORM=windows_x86
+ # UNOPKG_PLATFORM deliberately carries no architecture: it names the
+ # manifest platform, and the office matches that with platform_fits(),
+ # which accepts an OS-only token on every architecture. The
+ # description.xml platform value has no such shortcut -- it goes
+ # through isValidPlatform(), which wants the exact token -- so an x64
+ # SDK must say windows_x86_64 here or the office it belongs to will
+ # reject its own extensions. Nothing in the SDK environment knows the
+ # architecture (settings.mk gets PROCTYPE from config.guess, which does
+ # not exist on Windows), so dk.mk carries the value baked in at SDK
+ # build time. The fallback keeps an SDK built before that works.
+ EXTENSION_PLATFORM=$(if $(SDK_PLATFORMID),$(SDK_PLATFORMID),windows_x86)
endif
endif
endif