[mapguide-commits] r10280 - in branches/4.0/MgDev/Bindings: . src/Managed/DotNet/OSGeo.MapGuide.Portable/build
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Nov 9 00:44:32 PST 2026
Author: jng
Date: 2026-11-09 00:44:32 -0800 (Mon, 09 Nov 2026)
New Revision: 10280
Modified:
branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets
Log:
#2897: Recreate the MgPortable libFDO.so link when staging the linux FDO tree
MgPortablePlatform::Initialize() dlopens <FdoPath>libFDO.so, and FdoPath is FDO/lib64 in the
packaged layout. That name cannot be shipped as a symlink, and it cannot be a copy either: the glue
has already loaded the flat libFDO-<ver>.so through its $ORIGIN RUNPATH, and a second copy is a
second FDO instance whose static destructors crash at process exit
(FdoXslSingleton::~FdoXslSingleton -> XalanTransformer::terminate). Create it at build/publish time
as a relative symlink to the flat library instead, so the dlopen resolves to the already-loaded
inode.
- OSGeo.MapGuide.Portable.targets: add the libFDO-*.so item and create FDO/lib64/libFDO.so in
StageLinuxFdoForBuild and StageLinuxFdoForPublish. The link target is ../../libFDO-<ver>.so,
which is the flat library those targets copy beside the application.
- setup_linux_native_libs.cmd: update the materialisation comment. :Materialize is still needed for
the common tarball's links and for older portable tarballs, but the portable tarball's FDO tree is
symlink-free and names the versioned providers in providers.xml, so it no longer supplies the
placeholders that materialisation was added for.
Verified in the generic thin container against the Release portable tarball arranged the way the
package stages it: loading libPortableUnmanagedApi.so and then FDO/lib64/libFDO.so maps exactly one
libFDO-4.2.0.so and exits 0, and connections for SDF, SHP, SQLite, OGR, GDAL, WMS, WFS, MySQL,
PostgreSQL and ODBC all create.
Modified: branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
===================================================================
--- branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd 2026-11-09 01:50:30 UTC (rev 10279)
+++ branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd 2026-11-09 08:44:32 UTC (rev 10280)
@@ -45,10 +45,11 @@
set "MG_LINUX64=%~p0\linux-x64"
set "PORTABLE_DIR=%~p0\src\Managed\DotNet\OSGeo.MapGuide.Portable"
set "PORTABLE_NATIVE=%PORTABLE_DIR%\runtimes\linux-x64\native"
-rem 7-Zip cannot create the tarball's symlinks, so every unversioned library name in it arrives as
-rem a zero-length file. MgPortablePlatform::Initialize dlopens <FdoPath>libFDO.so and providers.xml
-rem names each provider by its bare library name, so each of those has to be replaced by a copy of
-rem the versioned library it stood for.
+rem The portable tarball is symlink-free: providers.xml names the versioned providers, and the .NET
+rem targets create FdoPath's libFDO.so link at build time (a copy would be a second FDO instance).
+rem The common tarball's unversioned links are unused too - the copies below name the versioned
+rem libraries - but 7-Zip extracts a tar symlink as a zero-length file, so replace any placeholder
+rem that remains with the file it stood for. This also keeps an older tarball working.
for %%F in ("%MG_LINUX64%\lib64\*" "%MG_LINUX64%\fdo\lib64\*") do call :Materialize "%%~F"
rem The package keeps the two platforms apart: FDO\windows holds the Windows providers the Windows
rem build stages, and FDO\linux is where the FDO install of this tarball goes (lib64, its
Modified: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets
===================================================================
--- branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets 2026-11-09 01:50:30 UTC (rev 10279)
+++ branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets 2026-11-09 08:44:32 UTC (rev 10280)
@@ -18,6 +18,7 @@
<MgPortableLinuxFdoFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\**\*" />
<MgPortableLinuxFdoLibFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\lib64\*.*" />
<MgPortableLinuxFdoComFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\lib64\com\**\*" />
+ <MgPortableLinuxFdoRealLibFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\lib64\libFDO-*.so" />
</ItemGroup>
<ItemGroup Condition=" '$(OS)' == 'Windows_NT' ">
@@ -41,6 +42,12 @@
<Copy SourceFiles="@(MgPortableLinuxFdoLibFile)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(MgPortableLinuxFdoComFile)" DestinationFiles="@(MgPortableLinuxFdoComFile->'$(OutDir)com/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(MgPortableLinuxPlatformIni)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
+ <!-- The tarball ships no links (NuGet would copy them as duplicates), and FdoPath is
+ FDO/lib64. MgPortablePlatform::Initialize() dlopens <FdoPath>libFDO.so; a file there
+ would be a second FDO instance, because the flat libFDO has already been loaded
+ through the $ORIGIN RUNPATH of PortableUnmanagedApi.so, and two instances crash when
+ their static destructors run. Link the name to that already-loaded flat library. -->
+ <Exec Command="ln -sfn ../../%(MgPortableLinuxFdoRealLibFile.Filename)%(MgPortableLinuxFdoRealLibFile.Extension) "$(OutDir)FDO/lib64/libFDO.so"" Condition=" '@(MgPortableLinuxFdoRealLibFile)' != '' " />
</Target>
<Target Name="StageLinuxFdoForPublish" AfterTargets="Publish" Condition=" '@(MgPortableLinuxFdoFile)' != '' ">
@@ -48,6 +55,7 @@
<Copy SourceFiles="@(MgPortableLinuxFdoLibFile)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(MgPortableLinuxFdoComFile)" DestinationFiles="@(MgPortableLinuxFdoComFile->'$(PublishDir)com/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(MgPortableLinuxPlatformIni)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
+ <Exec Command="ln -sfn ../../%(MgPortableLinuxFdoRealLibFile.Filename)%(MgPortableLinuxFdoRealLibFile.Extension) "$(PublishDir)FDO/lib64/libFDO.so"" Condition=" '@(MgPortableLinuxFdoRealLibFile)' != '' " />
</Target>
<Target Name="StageWindowsFdoForBuild" AfterTargets="Build" Condition=" '@(MgPortableWindowsFdoFile)' != '' ">
More information about the mapguide-commits
mailing list