-
Notifications
You must be signed in to change notification settings - Fork 440
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
plugins v2: port the qmake plugin #3391
Conversation
4a76a7e
to
c14c81d
Compare
Codecov Report
@@ Coverage Diff @@
## master #3391 +/- ##
==========================================
+ Coverage 90.76% 90.78% +0.01%
==========================================
Files 255 256 +1
Lines 18218 18250 +32
==========================================
+ Hits 16536 16568 +32
Misses 1682 1682
Continue to review full report at Codecov.
|
c14c81d
to
d67e11c
Compare
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 for contributing this. Is the goal to make use of #3392 in this PR?
snapcraft/plugins/v2/qmake.py
Outdated
def get_build_commands(self) -> List[str]: | ||
return [ | ||
self._get_qmake_configure_command(), | ||
'(unset CFLAGS CXXFLAGS LDFLAGS; make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}")', |
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 guess unset is done as it is already done in _get_qmake_conflgure_commands. Mind adding a comment for that if it is the case, or if there is another reason, why the unset is done for future observers?
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 expect that the exported ones may conflict with qmake generated ones... but certainly would appreciate a comment :D
This is certainly a fine approach. FWIW when I need to do something like this, i'll use env -u <var1>...
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.
In particular, the generated Makefile generated by qmake for the sample snap contains:
CFLAGS = -pipe -O2 -fPIC $(DEFINES)
CXXFLAGS = -pipe -O2 -fPIC $(DEFINES)
Having the environment variables set during the build will override the values from the Makefile, potentially miscompiling the project.
I would not be surprised if the same is true for a few other plugins.
I think this will need some reworking if #3392 is accepted, yes. We can't fold |
The default implementation returns False, indicating that the source code should be copied to the build directory prior to invoking the build commands.
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.
LGTM, but a comment with the unset would be icing on the cake!
Thanks!
part_build_work_dir to part_build_dir.
e2e7068
to
0c9b983
Compare
I've rebased the plugin on top of PR #3392, and switched to out-of-tree builds. I reintroduced the |
0c9b983
to
5c8d8eb
Compare
5c8d8eb
to
19a6144
Compare
I've changed it again to just |
return {"g++", "make", "qt5-qmake"} | ||
|
||
def get_build_environment(self) -> Dict[str, str]: | ||
return {"QT_SELECT": "qt5"} |
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.
Taking a note to see if this is required.
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.
IIRC, the qtchooser code is still part of the archive in 20.04, and you'd need to install qt5-default
for things to function without the environment variable.
./runtests.sh static
?./runtests.sh tests/unit
?This is a port of the v1 qmake plugin. It makes the following changes to the plugin properties:
options
renamed toqmake-parameters
to match other V2 pluginsqt-version
dropped, since Ubuntu 20.04 does not ship Qt 4, and there is no Qt 6 (yet).project-files
dropped in favour ofqmake-parameters
. We're performing a srcdir=builddir build, so there is no reason to rewrite paths.