Failures running tests

I suspect this is a problem on my side, but I’m seeing some test failures after updating the tree:

******************** TEST 'CIRCT :: firrtl/lower-to-rtl-module.mlir' FAILED ********************
: 'RUN: at line 1';   /Users/chrisl/Projects/circt/build/bin/circt-opt -pass-pipeline='lower-firrtl-to-rtl-module' /Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir -verify-diagnostics  | /Users/chrisl/Projects/circt/llvm/build/bin/FileCheck /Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir
Exit Code: 2

Command Output (stderr):
/Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir:144:8: error: unexpected error: custom op 'func' expected valid '@'-identifier for symbol name
  func private @UnknownFunction() {
/Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir:139:6: error: expected error "cannot lower this port type to RTL" was not produced
  // expected-error @+1 {{cannot lower this port type to RTL}}
/Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir:143:6: error: expected error "unexpected operation 'func' in a firrtl.circuit" was not produced
  // expected-error @+1 {{unexpected operation 'func' in a firrtl.circuit}}
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /Users/chrisl/Projects/circt/llvm/build/bin/FileCheck /Users/chrisl/Projects/circt/test/firrtl/lower-to-rtl-module.mlir

I think this is because of the recent merge of the new LLVM. However, when I do “git submodule update” in the top level circt directory, the LLVM submodule doesn’t get updated. Did the command change to update LLVM?



I don’t think so…

Let me pull master and try to reproduce. Did you recompile LLVM before trying to run the CIRCT tests?

Err, I guess if the LLVM submodule didn’t get updated for you, there would be nothing to do…

@clattner I was able to pull master and update the LLVM submodule with git submodule update (see attached log log.txt (4.6 KB)).

I’m compiling LLVM/MLIR at the new commit and then I’ll run the CIRCT tests…

Yah exactly. Among other deficiencies, I’m a pretty newb at advanced git stuff. When I do ‘git status’ in the circt/llvm directory I get:

$ git status
HEAD detached at 2e36e0dad52
nothing to commit, working tree clean

Should I repull a new llvm?

I think another way to achieve the same thing would be to do

git checkout df9ae599288

In the circt/llvm directory. You may need git fetch in that directory, if the git checkout fails.

Yup, submodules are a pain… I prefer other package manager’s approach of having the hash of the dependency be build information, not version-control information.

When you git pull, it updates your checkout (i.e. files in the repo) but it leaves submodules alone (I’m guessing because it hates us). So while it would be unexpected for some random file in your checkout to remain on its old version after a git pull, that is exactly what happens with submodules. My guess is that if you run git status in circt (not circt/llvm), it would tell you that the llvm submodule is not up-to-date (unless you’ve already fixed it by manually making it up-to-date like @mikeurbach suggested). The cure for this ailment is git submodule update --init --recursive (--init and --recursive are technically unnecessary but usually either are what you want or have no affect)

Back before I had enough git scars that I get knee pain when a submodule is out of date, I used to have post-checkout hook that would let me know if a submodule needed updating (something as simple as a script that runs git status would do).

Ok, I blew away the LLVM submodule, reupdated it and rebuilt, the errors went away. Sorry for the noise! :slight_smile:

haha :slight_smile: that explains my git experience