Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: restore latest toolchain for Windows' bindings tests #173

Closed
commial opened this issue Aug 11, 2023 · 2 comments
Closed

CI: restore latest toolchain for Windows' bindings tests #173

commial opened this issue Aug 11, 2023 · 2 comments
Labels
tests Relative to the testing capabilities

Comments

@commial
Copy link
Contributor

commial commented Aug 11, 2023

Track the temporary fix introduced in #172

@commial commial added the tests Relative to the testing capabilities label Aug 11, 2023
@commial
Copy link
Contributor Author

commial commented Aug 11, 2023

UPDATE Bug still happens with the most recent toolchain (1.79, 06/2024)

Here is the error obtained in the CI, using a 1.70 toolchain:

ClCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\CL.exe /c /I"D:\a\MLA\MLA\bindings\C\tests\windows-msvc\\..\..\\" /Zi /nologo /W3 /WX- /diagnostics:column /sdl /O2 /Oi /GL /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /permissive- /Fo"x64\Release-cpp\\" /Fd"x64\Release-cpp\vc143.pdb" /external:W3 /Gd /TP /FC /errorReport:queue src\read.c src\main.c src\write.c
  read.c
  main.c
  write.c
Link:
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"D:\a\MLA\MLA\bindings\C\tests\windows-msvc\x64\Release-cpp\mla-bindings-test.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"D:\a\MLA\MLA\bindings\C\tests\windows-msvc\\..\..\..\..\target\x86_64-pc-windows-msvc\release" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Bcrypt.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:\a\MLA\MLA\bindings\C\tests\windows-msvc\x64\Release-cpp\mla-bindings-test.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental /LTCGOUT:"x64\Release-cpp\mla-bindings-test.iobj" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\a\MLA\MLA\bindings\C\tests\windows-msvc\x64\Release-cpp\mla-bindings-test.lib" /MACHINE:X64 "x64\Release-cpp\read.obj"
  "x64\Release-cpp\main.obj"
  "x64\Release-cpp\write.obj"
mla.lib(mla.mla.466e2007-cgu.11.rcgu.o) : error LNK2001: unresolved external symbol __imp_NtWriteFile [D:\a\MLA\MLA\bindings\C\tests\windows-msvc\mla-bindings-test.vcxproj]
mla.lib(mla.mla.466e2007-cgu.11.rcgu.o) : error LNK2001: unresolved external symbol __imp_RtlNtStatusToDosError [D:\a\MLA\MLA\bindings\C\tests\windows-msvc\mla-bindings-test.vcxproj]
D:\a\MLA\MLA\bindings\C\tests\windows-msvc\x64\Release-cpp\mla-bindings-test.exe : fatal error LNK1120: 2 unresolved externals [D:\a\MLA\MLA\bindings\C\tests\windows-msvc\mla-bindings-test.vcxproj]
Done Building Project "D:\a\MLA\MLA\bindings\C\tests\windows-msvc\mla-bindings-test.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\a\MLA\MLA\bindings\C\tests\windows-msvc\mla-bindings-test.sln" (default targets) -- FAILED.

Build FAILED.

@commial
Copy link
Contributor Author

commial commented Jun 17, 2024

From what I understand, since Cargo 1.70 ntdll.lib might have to be added to the dependency list at link time.

This is what rustc indicates:

# Tested on bindings/C 
$ cargo rustc -- --print=native-static-libs
...
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: bcrypt.lib advapi32.lib kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib /defaultlib:msvcrt

As a result, from what I understand, this is not a bug in MLA but more a lack of configuration on the user's side.

In MLA C bindings, adding this dependency (as asked by rustc) indeed fixed the problem (see #203).

Feel free to re-open this issue if I'm missing something

@commial commial closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relative to the testing capabilities
Projects
None yet
Development

No branches or pull requests

1 participant