laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
496 stars 156 forks source link

cannot build 2.6.0 on windows x64 (error LNK2001: unresolved external symbol XactReadOnly) #627

Closed w0pr closed 1 year ago

w0pr commented 1 year ago

PostgreSQL server version: 13.13-1 image

Using Oracle instantclient SDK Version 19.21.0.0.0.

I run from VS2022 Development prompt: msbuild oracle_fdw.sln /p:Configuration=Debug /p:Platform=x64 /p:OracleClient="..\..\..\instantclient-sdk-windows.x64-19.21.0.0.0dbru\instantclient_19_21" /p:PostgreSQL="C:\Programme\PostgreSQL\13"

However, I get the following linker error: error LNK2001: unresolved external symbol XactReadOnly

 oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxpro
j]

What's missing? I did manage to build on Linux though some time ago.

laurenz commented 1 year ago

I don't have Windows here, but that looks like you are not linking with PostgreSQL. Do you have a postgres.lib in C:\Programme\PostgreSQL\13\lib?

chrullrich commented 1 year ago

The missing symbol is apparently only exported on Windows since 15.1, at least that is how https://github.com/postgres/postgres/commit/8ec569479fc28ddd634a13dc100b36352ec3a3c2 reads to me. It is used unconditionally by oracle_fdw.

We need to get you a Windows CI environment.

w0pr commented 1 year ago

I don't have Windows here, but that looks like you are not linking with PostgreSQL. Do you have a postgres.lib in C:\Programme\PostgreSQL\13\lib?

The missing symbol is apparently only exported on Windows since 15.1, at least that is how postgres/postgres@8ec5694 reads to me. It is used unconditionally by oracle_fdw.

We need to get you a Windows CI environment.

Building against current PostgreSQL version15.5-1 gives me two missing symbols:

oracle_fdw.obj : error LNK2019: unresolved external symbol ExecGetJunkAttribute referenced in function setModifyParameters [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
w0pr commented 1 year ago

I don't have Windows here, but that looks like you are not linking with PostgreSQL. Do you have a postgres.lib in C:\Programme\PostgreSQL\13\lib?

Yes. But there is only "DefaultXactReadOnly" in postgres.lib: image

XactReadOnly is only found in postgis_topology-3.dll: image

chrullrich commented 1 year ago

Building against current PostgreSQL version15.5-1 gives me two missing symbols:

oracle_fdw.obj : error LNK2019: unresolved external symbol ExecGetJunkAttribute referenced in function setModifyParameters [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]

Interesting (?). XactReadOnly is exported in 15.5. ExecGetJunkAttribute is exported in 13.13, but not in 15.5 or 16.1, and that is because it has been inline static since 14.1 and defined in executor.h. It cannot not be there.

Can you double-check the command line or the .props file you are using to point to the respective Oracle client and PostgreSQL files, please, to make sure you aren't mixing versions somehow?

chrullrich commented 1 year ago

[...] make sure you aren't mixing versions somehow?

That includes re-using existing .obj files; msbuild probably does not detect that the source has changed. Delete the msvc\x64 directory or try msbuild ...etc... /t:Rebuild.

w0pr commented 1 year ago

[...] make sure you aren't mixing versions somehow?

That includes re-using existing .obj files; msbuild probably does not detect that the source has changed. Delete the msvc\x64 directory or try msbuild ...etc... /t:Rebuild.

Tried both (simultaneously). Still same error with missing symbol.

w0pr commented 1 year ago

Building against current PostgreSQL version15.5-1 gives me two missing symbols:

oracle_fdw.obj : error LNK2019: unresolved external symbol ExecGetJunkAttribute referenced in function setModifyParameters [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]

Interesting (?). XactReadOnly is exported in 15.5. ExecGetJunkAttribute is exported in 13.13, but not in 15.5 or 16.1, and that is because it has been inline static since 14.1 and defined in executor.h. It cannot not be there.

Can you double-check the command line or the .props file you are using to point to the respective Oracle client and PostgreSQL files, please, to make sure you aren't mixing versions somehow?

Only thing changed in commandline was 13->15 in PostgreSQL Parameter.

laurenz commented 1 year ago

If XactReadOnly is not exported in older PostgreSQL releases, that would mean that everything since commit e61d62a8f091e45806dd93804c56527c4e34b116 ((Nov. 2022) cannot be built with these releases on Windows, right? That would indeed be a problem. I am surprised that we had no reports about that so far.

chrullrich commented 1 year ago

I agree, and I cannot see how it could work anyway, but I have not actually tried it myself yet. @w0pr's original build error is proof enough that the problem exists, I think.

w0pr commented 1 year ago

If XactReadOnly is not exported in older PostgreSQL releases, that would mean that everything since commit e61d62a ((Nov. 2022) cannot be built with these releases on Windows, right? That would indeed be a problem. I am surprised that we had no reports about that so far.

Maybe I'm the only loon who tries to use oracle_fdw on my local Windows installation, not on Linux like a normal person.

However, trying with 16.1-1 gives 3 missing symbols:

msbuild oracle_fdw.sln /p:Configuration=Debug /p:Platform=x64 /p:OracleClient="..\..\..\instantclient-sdk-windows.x64-19.21.0.0.0dbru\instantclient_19_21" /p:PostgreSQL="C:\Program Files\PostgreSQL\16"

  oracle_fdw.obj : error LNK2019: unresolved external symbol bms_is_empty referenced in function pushdownOrderBy [C:\Users\felix.deutsch\Downloads\oracle_fdw-ORACLE_
FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2019: unresolved external symbol ExecGetJunkAttribute referenced in function setModifyParameters [C:\Users\felix.deutsch\Downloads\oracle
_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\felix.deutsch\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\m
svc\oracle_fdw.vcxproj]
chrullrich commented 1 year ago

Maybe I'm the only loon who tries to use oracle_fdw on my local Windows installation, not on Linux like a normal person.

I admit I don't know if it works, but I can build it just fine against 16.1.

However, trying with 16.1-1 gives 3 missing symbols:

  oracle_fdw.obj : error LNK2019: unresolved external symbol bms_is_empty referenced in function pushdownOrderBy [C:\Users\felix.deutsch\Downloads\oracle_fdw-ORACLE_
FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2019: unresolved external symbol ExecGetJunkAttribute referenced in function setModifyParameters [C:\Users\felix.deutsch\Downloads\oracle
_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\felix.deutsch\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\m
svc\oracle_fdw.vcxproj]

The way you are accumulating undefined symbols is really strange. bms_is_empty isn't even a function in 16.1, but a macro in include/nodes/bitmapset.h, so you should either have it or get an error that that header itself is missing. I still think you are reusing old build output somewhere.

chrullrich commented 1 year ago

Please post the build log (msbuild ...etc... /fl /flp:Verbosity=normal, attach msbuild.log).

w0pr commented 1 year ago

Please post the build log (msbuild ...etc... /fl /flp:Verbosity=normal, attach msbuild.log).

I used a freshly unzipped source directory.

2023-11-22-oracle_fdw-msbuild.log


Der Buildvorgang wurde am 2023-11-22 17:24:25 gestartet.
Projekt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" auf Knoten "1" (Standardziele).
ValidateSolutionConfiguration:
  Die Projektmappenkonfiguration "Debug|x64" wird erstellt.
Das Projekt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" (1) erstellt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" (2) auf Knoten "1" (Standardziele).
InitializeBuildStatus:
  Aktualisieren des Timestamps von "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild".
ClCompile:
  Alle Ausgaben sind aktuell.
Link:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll" /INCREMENTAL /NOLOGO postgres.lib oci.lib delayimp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Delayimp.lib /DELAYLOAD:oci.dll /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.lib" /MACHINE:X64 /DLL "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_gis.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_utils.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_msvc.obj"
     Creating library C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.lib and object C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.exp
oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
Die Erstellung des Projekts "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" ist abgeschlossen (Standardziele) -- FEHLER.

Die Erstellung des Projekts "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" ist abgeschlossen (Standardziele) -- FEHLER.

Fehler beim Buildvorgang.

"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" (Standardziel) (1) ->
"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" (Standardziel) (2) ->
(Link Ziel) -> 
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]

    0 Warnung(en)
    2 Fehler

Verstrichene Zeit 00:00:01.49
chrullrich commented 1 year ago

ClCompile: Alle Ausgaben sind aktuell.

This means it did not recompile anything, but used existing object files. Please run:

rd /s "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64"
w0pr commented 1 year ago

rd /s "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64"

Ok. And rebuild: 2023-11-22-oracle_fdw-msbuild-2022.log

Der Buildvorgang wurde am 2023-11-22 17:38:59 gestartet.
Die Ausführlichkeit der Protokollierung ist auf "Normal" festgelegt.
Projekt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" auf Knoten "1" (Standardziele).
ValidateSolutionConfiguration:
  Die Projektmappenkonfiguration "Debug|x64" wird erstellt.
Das Projekt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" (1) erstellt "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" (2) auf Knoten "1" (Standardziele).
PrepareForBuild:
  Das Verzeichnis "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\" wird erstellt.
  Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
  Das Verzeichnis "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.tlog\" wird erstellt.
InitializeBuildStatus:
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild" wird erstellt, da "AlwaysCreate" angegeben wurde.
  Aktualisieren des Timestamps von "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild".
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\CL.exe /c /ZI /JMC /nologo /W4 /WX- /diagnostics:column /sdl /Od /Oy- /D _CRT_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /EHa /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\\" /Fd"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\vc143.pdb" /external:W4 /Gd /TC /wd4200 /wd4244 /wd4267 /wd4389 /wd4018 /wd4996 /wd4100 /wd4127 /FC /errorReport:queue ..\oracle_fdw.c ..\oracle_gis.c ..\oracle_utils.c oracle_msvc.c
  oracle_fdw.c
C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(55,39): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(65,32): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(83,42): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(97,35): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw.c(7223,2): warning C4053: one void operand for '?:' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  oracle_gis.c
  oracle_utils.c
  oracle_msvc.c
  Generating Code...
C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\oracle_utils.c(3225): warning C4701: potentially uninitialized local variable 'rc' used [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll" /INCREMENTAL /ILK:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.ilk" /NOLOGO postgres.lib oci.lib delayimp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Delayimp.lib /DELAYLOAD:oci.dll /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.lib" /MACHINE:X64 /DLL "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_gis.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_utils.obj"
  "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_msvc.obj"
     Creating library C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.lib and object C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.exp
oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
Die Erstellung des Projekts "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" ist abgeschlossen (Standardziele) -- FEHLER.

Die Erstellung des Projekts "C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" ist abgeschlossen (Standardziele) -- FEHLER.

Fehler beim Buildvorgang.

"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" (Standardziel) (1) ->
"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" (Standardziel) (2) ->
(ClCompile Ziel) -> 
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(55,39): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(65,32): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(83,42): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(97,35): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw.c(7223,2): warning C4053: one void operand for '?:' [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\oracle_utils.c(3225): warning C4701: potentially uninitialized local variable 'rc' used [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]

"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.sln" (Standardziel) (1) ->
"C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj" (Standardziel) (2) ->
(Link Ziel) -> 
  oracle_fdw.obj : error LNK2001: unresolved external symbol XactReadOnly [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\x64\Debug\oracle_fdw.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\username\Downloads\oracle_fdw-ORACLE_FDW_2_6_0\oracle_fdw-ORACLE_FDW_2_6_0\msvc\oracle_fdw.vcxproj]

    6 Warnung(en)
    2 Fehler

Verstrichene Zeit 00:00:03.72
chrullrich commented 1 year ago

This is against 13, which we are more or less agreed genuinely does not work as it is.

Can you try 15 or 16 again?

w0pr commented 1 year ago

This is against 13, which we are more or less agreed genuinely does not work as it is.

Oh, I'm sorry, lost track.

Can you try 15 or 16 again?

15 and 16 both build successfully! 😭

image

laurenz commented 1 year ago

I thought of a simple fix. The variable can also be accessed via the parameter transaction_read_only.

Can you test if the latest code builds with v13 on Windows?

w0pr commented 1 year ago

I thought of a simple fix. The variable can also be accessed via the parameter transaction_read_only.

Can you test if the latest code builds with v13 on Windows?

It builds fine against pgsql 13, thanks!

Der Buildvorgang wurde am 2023-11-23 13:57:42 gestartet.
Die Ausführlichkeit der Protokollierung ist auf "Normal" festgelegt.
Projekt "C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.sln" auf Knoten "1" (Standardziele).
ValidateSolutionConfiguration:
  Die Projektmappenkonfiguration "Debug|x64" wird erstellt.
Das Projekt "C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.sln" (1) erstellt "C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj" (2) auf Knoten "1" (Standardziele).
PrepareForBuild:
  Das Verzeichnis "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\" wird erstellt.
  Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
  Das Verzeichnis "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.tlog\" wird erstellt.
InitializeBuildStatus:
  "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild" wird erstellt, da "AlwaysCreate" angegeben wurde.
  Aktualisieren des Timestamps von "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild".
ClCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\CL.exe /c /ZI /JMC /nologo /W4 /WX- /diagnostics:column /sdl /Od /Oy- /D _CRT_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /EHa /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\\" /Fd"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\vc143.pdb" /external:W4 /Gd /TC /wd4200 /wd4244 /wd4267 /wd4389 /wd4018 /wd4996 /wd4100 /wd4127 /FC /errorReport:queue ..\oracle_fdw.c ..\oracle_gis.c ..\oracle_utils.c oracle_msvc.c
  oracle_fdw.c
C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(55,39): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(65,32): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(83,42): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(97,35): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  (compiling source file '../oracle_fdw.c')

C:\Users\username\Downloads\oracle_fdw\oracle_fdw.c(7231,2): warning C4053: one void operand for '?:' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  oracle_gis.c
  oracle_utils.c
  oracle_msvc.c
  Generating Code...
Link:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.dll" /INCREMENTAL /ILK:"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.ilk" /NOLOGO postgres.lib oci.lib delayimp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Delayimp.lib /DELAYLOAD:oci.dll /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.lib" /MACHINE:X64 /DLL C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.obj
  C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_gis.obj
  C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_utils.obj
  C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_msvc.obj
     Creating library C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.lib and object C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.exp
  oracle_fdw.vcxproj -> C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.dll
FinalizeBuildStatus:
  Die Datei "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.tlog\unsuccessfulbuild" wird gelöscht.
  Aktualisieren des Timestamps von "C:\Users\username\Downloads\oracle_fdw\msvc\x64\Debug\oracle_fdw.tlog\oracle_fdw.lastbuildstate".
Die Erstellung von Projekt "C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj" ist abgeschlossen (Standardziele).

Die Erstellung von Projekt "C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.sln" ist abgeschlossen (Standardziele).

Der Buildvorgang wurde erfolgreich ausgeführt.

"C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.sln" (Standardziel) (1) ->
"C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj" (Standardziel) (2) ->
(ClCompile Ziel) -> 
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(55,39): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(65,32): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile uint32 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(83,42): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  C:\Program Files\PostgreSQL\13\include\server\port\atomics\generic-msvc.h(97,35): warning C4057: 'function': 'volatile __int64 *' differs in indirection to slightly different base types from 'volatile uint64 *' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]
  C:\Users\username\Downloads\oracle_fdw\oracle_fdw.c(7231,2): warning C4053: one void operand for '?:' [C:\Users\username\Downloads\oracle_fdw\msvc\oracle_fdw.vcxproj]

    5 Warnung(en)
    0 Fehler

Verstrichene Zeit 00:00:02.46

oracle_fdw_6534f3ee6ae14be8a7388ae07d68373aa9dcd4f4_pgsql13_msbuild.log

laurenz commented 1 year ago

Thanks for the feedback, and thanks to @chrullrich for the help.