-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix P4C extension boilerplate CI build & test issue #32
Conversation
|
||
# FIXME: This is a temporary hack. With our current CMake configs, somehow | ||
# p4mlir-opt ended up in this directory. | ||
tool_dirs += [os.path.join(config.p4c_binary_dir, "bin")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is fixed by https://github.com/p4lang/p4mlir-incubator/pull/7/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR12 or some additional changes in third-party/llvm/CMakeLists.txt
in the same PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let me take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not able to resolve this. If you are also okay with it, I suggest we leave this as a TODO. So we can re-enable CI test on other PRs sooner.
Somehow the |
Well, that doesn't seem to be testing the latest commit. Let me try using #33. |
https://github.com/p4lang/p4mlir-incubator/actions/runs/12994911907/job/36240417411#step:9:12345
Now the CI test can pass! I'll take another look at the CMake hack issue after work today. |
Still, it seems you returned to the old way of building LLVM separately rather than doing it as a sub-project. I found the former approach quite error-prone during development:
Note that after https://github.com/p4lang/p4mlir-incubator/pull/7/files everything is supposed to work if the code is just dropped into |
@asl Thanks for your comments! The main reason I switched back to the old CMake config was to start from a known working state to better isolate CI issues. Now that things are working in CI, I'm taking another look at CMake changes in #3 and #7. I have to admit that my knowledge on CMake is quite limited. So I still don't fully understand some of your comments. Let me explain my current understanding below, and maybe you can help me clarify my misunderstandings. Overall, I was following the out-of-tree component build approach from the MLIR standalone example. I noticed that this approach is used in some popular MLIR-based projects, like CIRCT. So I was assuming it is a solid approach and just went with it.
I thought we could specify local LLVM locations when building an out-of-tree MLIR project, by passing in some CMake options, like the following: p4mlir-incubator/build_tools/build_p4mlir.sh Lines 21 to 24 in af6e91b
Or maybe that's not enough?
Is that achievable with the out-of-tree approach as well? We currently have the following script for building LLVM/MLIR: p4mlir-incubator/build_tools/build_mlir.sh Lines 20 to 29 in af6e91b
I imagine we could tweak CMake options here to enable RTTI and EH, right?
Then it seems to make more sense to rebase this PR to #7. I'll try it. |
Signed-off-by: Bili Dong <[email protected]>
Signed-off-by: Bili Dong <[email protected]>
Signed-off-by: Bili Dong <[email protected]>
Signed-off-by: Bili Dong <[email protected]>
3397f67
to
0410960
Compare
Signed-off-by: Bili Dong <[email protected]>
Signed-off-by: Bili Dong <[email protected]>
@@ -1,15 +1,45 @@ | |||
cmake_minimum_required(VERSION 3.20.0) | |||
project(p4mlir LANGUAGES CXX) | |||
|
|||
add_subdirectory(third_party) | |||
# TODO: Consider unify the build process and remove this option. | |||
option(BUILD_P4MLIR_OUT_OF_TREE "Whether to build P4MLIR out-of-tree" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asl How about making out-of-tree build optional for now? This way your local development workflow won't be disrupted. And our current CI build scripts also work.
This is superseded by #46. |
No description provided.