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

cmake/ci: add custom built clangd #204

Merged
merged 1 commit into from
Feb 7, 2024
Merged

cmake/ci: add custom built clangd #204

merged 1 commit into from
Feb 7, 2024

Conversation

Hyxogen
Copy link
Contributor

@Hyxogen Hyxogen commented Feb 6, 2024

This change will add clangd to our packages.

If you want to build clangd manually, you'll have to add clang-tools-extra to LLVM_ENABLE_PROJECTS. Also if you want it to get installed with the install-distribution rule, you'll have to specify LLVM_ENABLE_PROJECTS before specifying the initial cache with -C (see debian/build.sh for an example).

This closes: leaningtech/cheerp-meta#144

@Hyxogen Hyxogen requested a review from yuri91 February 6, 2024 13:39
Copy link
Member

@yuri91 yuri91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any estimate on how much this increases the build times?

Also, can I just enable the "clang-tools-extra" project and build only clangd? how long does that take compared to building everything together?

I am thinking that for a dev environment it's nice to have clangd, but rebuild it infrequently (it does not matter that it has all the latest commits) to avoid increasing the build times.

So I might want to build it in a separate build directory.

llvm/CheerpCmakeConf.cmake Show resolved Hide resolved
@Hyxogen
Copy link
Contributor Author

Hyxogen commented Feb 6, 2024

any estimate on how much this increases the build times?

Looking at the CI for building windows and macos (those that don't use ccache) it seems that that building takes about 4-5 minutes longer

Also, can I just enable the "clang-tools-extra" project and build only clangd? how long does that take compared to building everything together?

Yes you can, as for how long: I'm currently benchmarking build times but by seeing how many files it compiles, it is probably the same for building just Cheerp

@Hyxogen
Copy link
Contributor Author

Hyxogen commented Feb 6, 2024

A clean build of only clang-tools-extra seems to take about 15 minutes on my machine when using 8 threads

@yuri91
Copy link
Member

yuri91 commented Feb 6, 2024

I also experimented a bit, but I had issues when only enabling clang-tools-extra. I had to still enable clang;clang-tools-extra and then only do make clangd. Did you change anything else?

Anyway, I think that it wold make sense to not build clangd on the CI on feature branches, since it would increase the feedback time for nothing.
For master we can build it together with clang to share some of the compilation time, and on our machines we can decide for ourselves, and maybe just build clangd every now and then in a different build directory.

So the actionable items for you are:

  • find the best cmake invocation to build only clangd, and maybe document it somewhere
  • tweak the CI as described above

@Hyxogen
Copy link
Contributor Author

Hyxogen commented Feb 7, 2024

I also experimented a bit, but I had issues when only enabling clang-tools-extra. I had to still enable clang;clang-tools-extra and then only do make clangd. Did you change anything else?

I thought this worked, but I just built the all rule. However when trying to only build clangd it didn't work. It seems that you also have to enable clang for it to work

So the best cmake invocation that I have found to build only clangd is to enable both clang and clang-tools-extra and then only build the clangd rule

@Hyxogen
Copy link
Contributor Author

Hyxogen commented Feb 7, 2024

I believe it will now only build on the master branch, I'll give you a ping when I have verified that it indeed works.

@Hyxogen Hyxogen requested a review from yuri91 February 7, 2024 07:33
This change will add clangd to our packages.

If you want to build clangd manually, you'll have to add
`clang-tools-extra` to `LLVM_ENABLE_PROJECTS`. Also if you want it to
get installed with the `install-distribution` rule, you'll have to
specify `LLVM_ENABLE_PROJECTS` before specifying the initial cache with
`-C` (see `debian/build.sh` for an example).

This closes: leaningtech/cheerp-meta#144
@yuri91 yuri91 merged commit e8f410b into master Feb 7, 2024
1 check passed
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.

clangd
2 participants