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

Update expected skip condition for llvm framework test on msys2 #9591

Merged
merged 2 commits into from
Nov 20, 2021

Conversation

jon-turney
Copy link
Member

Supersedes: #9534, #9547

@jon-turney
Copy link
Member Author

jon-turney commented Nov 18, 2021

Test is now expected to run, not skip, on msys2 with clang. So change the skip_on_jobname from 'msys2' to 'msys2-gcc', as it's only expected to skip there.

@jon-turney
Copy link
Member Author

jon-turney commented Nov 18, 2021

Now that the run is expected, we can see that it is failing during the build stage, for reasons I don't understand:

[1/2] "clang" "-Isum.exe.p" "-I." "-I..\test cases\frameworks\15 llvm" "-ID:/a/_temp/msys64/mingw64/include" "-fcolor-diagnostics" "-DNDEBUG" "-Wall" "-Winvalid-pch" "-std=c99" "-O0" "-g" "-pthread" "-D_FILE_OFFSET_BITS=64" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" -MD -MQ sum.exe.p/sum.c.obj -MF "sum.exe.p\sum.c.obj.d" -o sum.exe.p/sum.c.obj "-c" "../test cases/frameworks/15 llvm/sum.c"
[2/2] "clang++"  -o sum.exe sum.exe.p/sum.c.obj "-Wl,--allow-shlib-undefined" "-Wl,--start-group" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUAsmParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUCodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUDesc.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUDisassembler.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUInfo.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUUtils.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAggressiveInstCombine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAnalysis.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAsmParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAsmPrinter.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBinaryFormat.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitWriter.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitstreamReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCFGuard.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCore.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCoroutines.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoCodeView.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoDWARF.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoMSF.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDemangle.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMExecutionEngine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMFrontendOpenMP.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMGlobalISel.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMIRReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMInstCombine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMInstrumentation.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMLinker.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMC.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCDisassembler.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCJIT.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMIRParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMObjCARCOpts.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMObject.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMOrcShared.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMOrcTargetProcess.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMPasses.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMProfileData.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMRemarks.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMRuntimeDyld.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMScalarOpts.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMSelectionDAG.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMSupport.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTarget.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTextAPI.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTransformUtils.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMVectorize.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86CodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86Desc.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86Info.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMipo.a" "D:/a/_temp/msys64/mingw64/lib/libz.dll.a" "advapi32.lib" "ole32.lib" "psapi.lib" "pthread.lib" "shell32.lib" "uuid.lib" "-pthread" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group"
FAILED: sum.exe 
"clang++"  -o sum.exe sum.exe.p/sum.c.obj "-Wl,--allow-shlib-undefined" "-Wl,--start-group" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUAsmParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUCodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUDesc.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUDisassembler.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUInfo.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAMDGPUUtils.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAggressiveInstCombine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAnalysis.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAsmParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMAsmPrinter.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBinaryFormat.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitWriter.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMBitstreamReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCFGuard.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCore.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMCoroutines.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoCodeView.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoDWARF.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDebugInfoMSF.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMDemangle.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMExecutionEngine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMFrontendOpenMP.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMGlobalISel.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMIRReader.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMInstCombine.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMInstrumentation.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMLinker.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMC.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCDisassembler.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCJIT.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMCParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMMIRParser.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMObjCARCOpts.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMObject.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMOrcShared.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMOrcTargetProcess.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMPasses.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMProfileData.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMRemarks.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMRuntimeDyld.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMScalarOpts.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMSelectionDAG.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMSupport.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTarget.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTextAPI.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMTransformUtils.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMVectorize.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86CodeGen.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86Desc.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMX86Info.a" "D:/a/_temp/msys64/mingw64/lib/libLLVMipo.a" "D:/a/_temp/msys64/mingw64/lib/libz.dll.a" "advapi32.lib" "ole32.lib" "psapi.lib" "pthread.lib" "shell32.lib" "uuid.lib" "-pthread" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group"
clang++: error: no such file or directory: 'advapi32.lib'
clang++: error: no such file or directory: 'ole32.lib'
clang++: error: no such file or directory: 'psapi.lib'
clang++: error: no such file or directory: 'pthread.lib'
clang++: error: no such file or directory: 'shell32.lib'
clang++: error: no such file or directory: 'uuid.lib'
ninja: build stopped: subcommand failed.

https://github.com/mesonbuild/meson/runs/4253951135?check_suite_focus=true#step:5:2768

@dcbaker
Copy link
Member

dcbaker commented Nov 18, 2021

Those like windows only libs, are they supposed to be used with msys? It almost looks like we've found an llvm we shouldn't have

@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #9591 (d577f0d) into master (cc80187) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9591      +/-   ##
==========================================
+ Coverage   67.40%   67.45%   +0.04%     
==========================================
  Files         400      400              
  Lines       85340    85340              
  Branches    17576    17576              
==========================================
+ Hits        57524    57563      +39     
+ Misses      23212    23171      -41     
- Partials     4604     4606       +2     
Impacted Files Coverage Δ
mesonbuild/dependencies/cmake.py 85.65% <100.00%> (+0.89%) ⬆️
mesonbuild/scripts/vcstagger.py 87.50% <0.00%> (-4.17%) ⬇️
mesonbuild/minstall.py 68.65% <0.00%> (-0.77%) ⬇️
mesonbuild/mesonlib/universal.py 81.57% <0.00%> (-0.33%) ⬇️
dependencies/cmake.py 81.39% <0.00%> (ø)
mesonbuild/interpreter/interpreter.py 82.34% <0.00%> (+0.10%) ⬆️
mesonbuild/msubprojects.py 55.91% <0.00%> (+0.40%) ⬆️
mesonbuild/scripts/symbolextractor.py 52.56% <0.00%> (+0.85%) ⬆️
mesonbuild/compilers/detect.py 55.86% <0.00%> (+1.37%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc80187...d577f0d. Read the comment docs.

@jon-turney
Copy link
Member Author

Those like windows only libs, are they supposed to be used with msys? It almost looks like we've found an llvm we shouldn't have

It looks like those are coming from msys2's LLVMExports.cmake, so guessing wildly, maybe that doesn't understand correctly about msys2?

@jeremyd2019
Copy link

I'm not seeing anything in msys2's clang package to make me think it's doing something like that. Maybe

# On Windows, CMake library dependencies can be passed as bare library names,
# e.g. 'version' should translate into 'version.lib'. CMake brute-forces a
# combination of prefix/suffix combinations to find the right library, however
# as we do not have a compiler environment available to us, we cannot do the
# same, but must assume any bare argument passed which is not also a CMake
# target must be a system library we should try to link against
libraries += [f"{j}.lib"]
?
I'm not familiar enough with meson to know if it already knows mingw vs 'normal' windows there

@jon-turney
Copy link
Member Author

Maybe?

Yeah, that does look suspicious. I was kind of assuming that dependency(method: 'cmake') works on msys2, but maybe that's not the case...

@eli-schwartz
Copy link
Member

@mensinda

On msys2, we will now find static llvm using cmake
@jon-turney
Copy link
Member Author

jon-turney commented Nov 19, 2021

Yeah, that seems to be the spot.

I'm not sure that comment is correct. This list of libraries ends up in dep.link_args, which I thought is compiler-neutral and gets massaged into a compiler appropriate format when output by the backend?

That line was added in 0f4e88b (PR #6980), which was accepted without a regression test.

@dcbaker
Copy link
Member

dcbaker commented Nov 19, 2021

The good news is that comment isn't right, we do have a compiler environment. you should have self.clib_compiler there, which is a CCompiler, and self.environment, so we should be able to do something like

libs += self.clib_compiler.find_library(j, self.env, [])

Convert bare library names to a dependency linker argument using
find_library(), rather than hardcoding the MSVC transformation.
@jon-turney
Copy link
Member Author

so we should be able to do something like

Indeed, that seems to work. Thanks.

We don't have any CI coverage of LLVM with MSVC, which I guess is the scenario in #6980, but I guess this is an improvement.

@dcbaker
Copy link
Member

dcbaker commented Nov 20, 2021

Awesome, thanks for figuring this out!

@dcbaker dcbaker merged commit 61ca564 into mesonbuild:master Nov 20, 2021
@jon-turney
Copy link
Member Author

jon-turney commented Nov 21, 2021

We don't have any CI coverage of LLVM with MSVC, which I guess is the scenario in #6980,

Looked at that a bit more since both LLVM and CMake are present in the Azure VM image, so perhaps only a bit of configuration was needed to find it. However, it seems that the Windows installer from llvm.org doesn't provide the required .cmake files (or llvm-config), so we are out of luck.

@nirbheek nirbheek added this to the 0.60.2 milestone Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants