-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
qtcreator 4.9.1 -> 4.10.0 #70573
qtcreator 4.9.1 -> 4.10.0 #70573
Conversation
I thought I commented, not sure why it didn't get posted... Recommenting now.... So this is obviously a big changeset, and as I see- this has two components:
That said, may I request that you mention some steps as to how to go about making these changes for the future versions. Or perhaps make the clazy version optional? |
Clang is critical in sense that without it qtcreator becoming just text editor, i.e. no code completion, no symbol searches etc. Qt team manages there own repos of llvm, clang+clang-tools-extra+clazy is just one repository with submodules, so i don't think we need to turn it optional. Now to part how i was figuring out what to do:
|
It's improper for me to mention it since you've spent hours getting this to work. But QtCreator has great debugging capabilities and a decent LSP server :). The reason why I mentioned making this feature optional on a param is to set the right expectations for the update. When, say, qt 4.11 comes around, I can make the hash update and cover a decent percent of crowd (using it for debugger/LSP et al) but wouldn't be able to invest all the time you did. When that happens, people would be disappointed that the upgrade lost them features. |
2d1c4ca
to
c000bd7
Compare
Ok, i can see your point now, I've updated nix expression with |
Thank you. Btw, I don't have approved permissions or would have approved a week back :) |
@teto Could you please merge if you're okay with akaWolf's and my approval? I'm new and I don't know what's the standard practice when a maintainer doesn't have write access to the repository. Sorry for bothering you out of the blue! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
||
void HeaderPathFilter::tweakHeaderPaths() | ||
{ | ||
- removeClangSystemHeaderPaths(builtInHeaderPaths); |
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.
Can you explain this change? It doesn't look like a modification to a regex.
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 mentioned this in my previous comment.
Compilation was successful, so i opened up test project in qtcreator only to see that clang code model fails to find clang includes.
After some code inspection i found out that qtcreator searches for includes in directory that is bundled with it, to make it so system clang don't interfere with search pathes there is method in code removeClangSystemHeaderPaths(builtInHeaderPaths);. In our case we want qtcreator to search for clang system include, so i removed it.
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.
And why is this combined with the already existing Fix-clang-libcpp-regex patch?
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.
Cause it's solves the same problem, i may split it into two different patches or rename patch if needed.
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.
It should be very obvious which patches are applied for which reason. Otherwise future maintainers won't be able to adapt or remove them. So adding an explanation to the comment and/or giving it a more descriptive name would be nice.
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.
Looking at the code [1], it appears that "removeClangSystemHeaderPaths" removes the system clang include directories. It's not clear at all why we should disable this. Perhaps it is supposed to be able to find includes from clang_qt_vendor
instead?
[1] https://github.com/qt-creator/qt-creator/blob/master/src/plugins/cpptools/headerpathfilter.cpp
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.
Also is this an issue that is seen in 4.10.0 only or 4.9.1 as well?
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.
Ok, i've splitted up the patch into two different patches and added comment.
Looking at the code [1], it appears that "removeClangSystemHeaderPaths" removes the system clang include directories. It's not clear at all why we should disable this. Perhaps it is supposed to be able to find includes from clang_qt_vendor instead?
As i previously mentioned qtcreator in classic linux packaging comes with clang, clazy and it's includes in one single package. Path for it is something like /usr/share/qtcreator/include ...
In our case we reuse system clang recipe to build different sources for clang, so it's pathes still found by system paths.
Also is this an issue that is seen in 4.10.0 only or 4.9.1 as well?
They changed behavior, previously system paths was removed only if there is "darwin" in system triple, as i don't have mac to test it i leave'd it untouched. So 4.9.1 worked as intended.
c000bd7
to
77c9fc4
Compare
I think you mixed up filenames. There shouldn't be a change to the "0001-Fix-clang-libcpp-regexp.patch" file. |
77c9fc4
to
dfe88cf
Compare
You're right, but there is change, because of filechanges of patched files (line numbers), fixed it. |
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.
Fine by me if @veprbl agrees.
I know I'm sounding like a broken record but if the default value of |
@GrahamcOfBorg eval |
Question is: will hydra build package with all options, or only default ones? Because of clang it will take about 1 hour to fully build clang + qtcreator, so it's not very user friendly. Personally, i think it's better to build ide with full functionality, especially core one like clang code model. |
I don't think Looking at the r-ryantm's logs at https://discourse.nixos.org/t/nixpkgs-update-r-ryantm-logs/1464/44 I see:
This was thrown from https://github.com/ryantm/nixpkgs-update/blob/master/src/Nix.hs#L242
What needs to be done (as a first step at least) is |
What is the proper way to do it? I still have little expirience in nix DSL, something i have in mind:
|
Maybe builtins.concatStringsSep "." (lib.take 2 (builtins.splitVersion "4.10.1")) |
Added optional withClangPlugins to disable clang plugins compilation and, therefore, vendor clang dependency.
dfe88cf
to
8ca4cee
Compare
Thanks, i've updated mr to include your remarks. |
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 can confirm that the 0002-Dont-remove-clang-header-paths.patch indeed fixes the code completion, but I don't know why. I also would like to point out that ArchLinux uses stock clang[1] and compiles clazy plugin separately[2] and they don't need this patch. I think, we should be looking to do the same and get rid of this withClangPlugins
option, which, in my opinion, is not very useful.
[1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/qtcreator
[2] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/clazy
@GrahamcOfBorg build qtcreator |
I don't have archlinux installed, so i can't confirm if they have code model working. To get rid of clang fork i see a need for multiple mr's:
As of tl;dr changes needed to get rid of clang fork will take time and multiple mr's, for now, in my opinion, it's ok to merge this changes. |
@deadloko Thanks! |
Added optional withClangPlugins to disable clang plugins compilation and, therefore, vendor clang dependency. (cherry picked from commit 1eafac2)
@veprbl nice, thanks! |
Motivation for this change
There was discussion with @SRGOM about upgrade on
#61348
Things done
-fno-rtti
flag as clang tooling libraries is built with static linkage.withClangPlugins
option to make it possible to compile qtc without vendor clang dependency.Tested using sandboxing (nix.useSandbox on NixOS, or option
sandbox
innix.conf
on non-NixOS)Built on platform(s)
Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
Tested compilation of all pkgs that depend on this change using
nix-shell -p nix-review --run "nix-review wip"
Tested execution of all binary files (usually in
./result/bin/
)Determined the impact on package closure size (by running
nix path-info -S
before and after)Ensured that relevant documentation is up to date
Fits CONTRIBUTING.md.
Additionally tested that clang code model works on test project as i described in Feature/qt clang integration #61348
Notify maintainers
cc @akaWolf