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

llvm/test/tools/UpdateTestChecks/update_cc_test_checks use clang but don't depend on clang #44143

Closed
LebedevRI opened this issue Feb 5, 2020 · 6 comments
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag

Comments

@LebedevRI
Copy link
Member

Bugzilla Link 44798
Resolution FIXED
Resolved on Mar 23, 2020 04:25
Version trunk
OS Linux
CC @arichardson,@gregbedwell,@MaskRay,@RKSimon,@nico
Fixed by commit(s) rG61dd0603bd8a,rGc29310707e9a

Extended Description

$ ninja check-llvm
[1/295] Generating VCSRevision.h
-- Found Git: /usr/bin/git (found version "2.25.0")
[294/295] Running the LLVM regression tests
FAIL: LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test (33391 of 35753)
******************** TEST 'LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test' FAILED ********************
Script:

: 'RUN: at line 3'; cp /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c && '/usr/bin/python' /repositories/llvm-project/llvm/utils/update_cc_test_checks.py --clang /builddirs/llvm-project/build-Clang9-unknown/./bin/clang --opt /builddirs/llvm-project/build-Clang9-unknown/./bin/opt /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 4'; diff -u /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c.expected /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 6'; '/usr/bin/python' /repositories/llvm-project/llvm/utils/update_cc_test_checks.py --clang /builddirs/llvm-project/build-Clang9-unknown/./bin/clang --opt /builddirs/llvm-project/build-Clang9-unknown/./bin/opt /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 7'; diff -u /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c.expected /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c

Exit Code: 1

Command Output (stdout):

$ ":" "RUN: at line 3"
$ "cp" "/repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c" "/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c"
$ "/usr/bin/python" "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py" "--clang" "/builddirs/llvm-project/build-Clang9-unknown/./bin/clang" "--opt" "/builddirs/llvm-project/build-Clang9-unknown/./bin/opt" "/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c"

command stderr:

/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
WARNING: Could not determine clang builtins directory, some tests might not update correctly.
/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
Traceback (most recent call last):
File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 304, in
sys.exit(main())
File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 265, in main
get_function_body(args, filename, clang_args, extra_commands, prefixes, triple_in_cmd, func_dict)
File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 161, in get_function_body
raw_tool_output = common.invoke_tool(args.clang, clang_args, filename)
File "/repositories/llvm-project/llvm/utils/UpdateTestChecks/common.py", line 50, in invoke_tool
stdout = subprocess.check_output([exe] + cmd_args, stdin=ir_file)
File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/builddirs/llvm-project/build-Clang9-unknown/./bin/clang', '-cc1', '-triple', 'x86_64-unknown-linux-gnu', '/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c', '-emit-llvm', '-o', '-']' returned non-zero exit status 127

error: command failed with exit status: 1

--


Testing Time: 702.24s


Failing Tests (1):
LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test

Expected Passes : 35113
Expected Failures : 149
Unsupported Tests : 490
Unexpected Failures: 1
FAILED: test/CMakeFiles/check-llvm
cd /builddirs/llvm-project/build-Clang9-unknown/test && /usr/bin/python /builddirs/llvm-project/build-Clang9-unknown/./bin/llvm-lit -sv /builddirs/llvm-project/build-Clang9-unknown/test
ninja: build stopped: subcommand failed.

@arichardson
Copy link
Member

The tests should be checking for the presence of clang and be UNSUPPORTED if it's not avilable: https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/lit.local.cfg

I checked that the tests don't run if I delete bin/clang from the build directory.

This seems like your build directory contains a broken clang?

/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE

@arichardson
Copy link
Member

I am not sure if it's possible to add a cmake dependency just for those tests since the clang target is probably not defined when they run?

@LebedevRI
Copy link
Member Author

The tests should be checking for the presence of clang and be UNSUPPORTED if
it's not avilable:
https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/
UpdateTestChecks/update_cc_test_checks/lit.local.cfg

I checked that the tests don't run if I delete bin/clang from the build
directory.

This seems like your build directory contains a broken clang?
What makes you think it's broken? It's simply not rebuilt.
And that is a perfectly correct state,
because buildsystem wasn't asked whether clang is up-to-date and usable.

/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup
error:
/builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.
11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE

@arichardson
Copy link
Member

This seems like your build directory contains a broken clang?
What makes you think it's broken? It's simply not rebuilt.
And that is a perfectly correct state,
because buildsystem wasn't asked whether clang is up-to-date and usable.

Yes sorry, I realized after posting that comment what the real issue is. I've posted https://reviews.llvm.org/D74051 which should fix it.
Seems like it is indeed possible to add the clang depedency.

I am not sure if this is desirable, but I can't see a better solution that allows incremental check-llvm to work.

@RKSimon
Copy link
Collaborator

RKSimon commented Feb 5, 2020

Shouldn't this test live in

clangtest/tools/UpdateTestChecks/update_cc_test_checks

or similar?

@RKSimon
Copy link
Collaborator

RKSimon commented Mar 23, 2020

D74051 landed at rG61dd0603bd8a, moving the tests into clang\test\utils\update_cc_test_checks

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

3 participants