This is an archive of the discontinued LLVM Phabricator instance.

[gn build] port a3172df59c32 (check-lldb)
ClosedPublic

Authored by zequanwu on Sep 9 2022, 12:40 PM.

Diff Detail

Event Timeline

zequanwu created this revision.Sep 9 2022, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:40 PM
zequanwu requested review of this revision.Sep 9 2022, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:40 PM
thakis added a comment.Sep 9 2022, 7:37 PM

Thanks!

write_file runs at gn time. Is it possible to instead make an action that writes this as a build step, and then make check-lldb depend on that?

It's a bit more involved: You have to create a python script that writes the output (since action()s always run python scripts). llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn has an example of an action(), I can help you if you get stuck. (llvm/utils/gn/gn.py help action has some notes too.)

On one hand, write_file is pretty fast. On the other hand, we currently don't need to do any work like this at GN time in LLVM's gn build, and it'd be nice if it stayed that way. (People who don't build check-lldb don't need this file, so it's wasted work.)

And just FYI, iirc check-lldb in the GN build only runs a subset of the tests that run in the CMake build. (Maybe only the lit-based ones? Maybe those are called "API" tests?)

Thanks again for working on unbreaking check-lldb in the GN build :)

zequanwu updated this revision to Diff 459526.Sep 12 2022, 11:22 AM

Use an action to write file.

thakis accepted this revision.Sep 12 2022, 4:52 PM

Thanks!

llvm/utils/gn/secondary/lldb/test/BUILD.gn
139

If you llvm/utils/gn/gn.py format llvm/utils/gn/secondary/lldb/test/BUILD.gn, it'll probably put this on a single line. (But whatever gn's formatter output is correct.)

143

Pass root_build_dir as second arg, then GN will write a relative path in the generated ninja file. As-is works too, but then it writes an absolute path. It's nice if the generated ninja files are machine-independent. (i.e. replace this line with rebase_path(outputs[0], root_build_dir),)

151–152

Please keep alphabetized, put new dep here. (gn format should fix this for you.)

This revision is now accepted and ready to land.Sep 12 2022, 4:52 PM
This revision was automatically updated to reflect the committed changes.
zequanwu marked 3 inline comments as done.