Mir

Merge lp:~robert-ancell/mir/server-headers into lp:~mir-team/mir/trunk

Proposed by Robert Ancell
Status: Merged
Approved by: Robert Ancell
Approved revision: no longer in the source branch.
Merged at revision: 523
Proposed branch: lp:~robert-ancell/mir/server-headers
Merge into: lp:~mir-team/mir/trunk
Diff against target: 39 lines (+15/-0)
2 files modified
debian/libmirserver-dev.install (+1/-0)
src/server/CMakeLists.txt (+14/-0)
To merge this branch: bzr merge lp:~robert-ancell/mir/server-headers
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Needs Fixing
Daniel van Vugt Approve
Thomas Voß Pending
Robert Carr Pending
Review via email: mp+154239@code.launchpad.net

This proposal supersedes a proposal from 2013-03-14.

Commit message

Install the server headers so that Mir compositors can be developed separately from lp:mir

Description of the change

Install the server headers so that Mir compositors can be developed separately from lp:mir

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Thomas Voß (thomas-voss) wrote : Posted in a previous version of this proposal

Looks good, a minor niggle: Could you rename SERVER_PUBLIC_HEADERS to MIR_SERVER_PUBLIC_HEADERS to match the naming pattern?

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Is this a full or partial resolution for bug 1136938?

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

P.S. I think Thomas is wrong. SERVER_PUBLIC_HEADERS is a local variable. It does not need a namespace "MIR_" prefix.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

I used to distinguish locals by making them lower case. We could start doing that...

Revision history for this message
Robert Ancell (robert-ancell) wrote : Posted in a previous version of this proposal

Yes, it does fix bug 1136938.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

It works well. Stylistically I have no immediate complaint. And bug 1136938 is indeed fixed.

However the list of "server headers" is very long. Some headers such as:
    ${CMAKE_SOURCE_DIR}/include/server/mir/graphics/gl_renderer.h
should not be installed as part of the server (that one is for example code and tests only). There will probably be other such headers that should not be in that list so please re-evaluate the minimum set of headers you really need right now.

review: Needs Fixing
Revision history for this message
Robert Ancell (robert-ancell) wrote : Posted in a previous version of this proposal

> Looks good, a minor niggle: Could you rename SERVER_PUBLIC_HEADERS to
> MIR_SERVER_PUBLIC_HEADERS to match the naming pattern?

This matches CLIENT_PUBLIC_HEADERS in src/client/CMakeLists.txt so I'll leave that as consistent. If the naming is wrong it should be updated for both in a separate patch.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

I don't like this being a list of individual files - there's too much chance of it getting out of step.

I would expect everything under either include/common/mir or include/server/mir to be part of this.

IMO if there are things there that shouldn't be exposed then that is a separate issue.

review: Needs Fixing
Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

I agree, it should use install(DIRECTORY,

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:499
http://jenkins.qa.ubuntu.com/job/mir-ci/104/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/105/console

Click here to trigger a rebuild:
http://jenkins.qa.ubuntu.com/job/mir-ci/104/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote : Posted in a previous version of this proposal

Updated, I think this addresses the concerns listed:

Thomas - variable no longer exists
Alan, Robert - whole directory now installed
Daniel - still probably installs headers that are not required, however I agree with Alan here that these headers should not be in include/server if that is the case.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

I would expect everything under either include/common/mir or include/server/mir to be part of this.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:502
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~robert-ancell/mir/server-headers/+merge/154239/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-ci/136/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-raring-i386-build/47/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/137/console
        deb: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/137/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://jenkins.qa.ubuntu.com/job/mir-ci/136/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Set Needs review ---> Work In Progress --> Needs review
to force Jenkins to try again.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I would like to say we're done with this issue but there's a new problem. Make install creates:
    include/mir/server/mir/foo/bar.h
You can see two "mir" directories. Users will have to:
    #include <mir/server/mir/foo/bar.h>
which does not look right.

Despite all our previous disagreements about include directories, I *think* it's safe to say the appearance of "mir" twice is a mistake.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Let us all agree what we are trying to do before trying to fix it in different ways.

I've started a thread on mir-devel - please join us there.

review: Needs Fixing
Revision history for this message
Robert Ancell (robert-ancell) wrote :

> I would like to say we're done with this issue but there's a new problem. Make
> install creates:
> include/mir/server/mir/foo/bar.h
> You can see two "mir" directories. Users will have to:
> #include <mir/server/mir/foo/bar.h>
> which does not look right.
>
> Despite all our previous disagreements about include directories, I *think*
> it's safe to say the appearance of "mir" twice is a mistake.

This is not a mistake - the pkg-config file causes you to compile with -I/usr/include/mir/server and a program uses:
     #include <mir/foo.h>

This would be less confusing if the directory was versioned, i.e. /usr/include/mir-0/server or /usr/include/mirserver-0

I'll update the directory as I think that's where we'll end up anyway.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

> Let us all agree what we are trying to do before trying to fix it in different
> ways.
>
> I've started a thread on mir-devel - please join us there.

I disagree we need to solve all the details. The point of this merge is you are currently unable to compile against libmirserver as no headers are installed. This merge makes these headers available - their locations and content can be changed at a later date.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh I see what you're doing with the pkgconfig include paths now, sorry. That kind of makes sense, and I also see now that _many_ SDKs are installed using the pattern: /usr/include/LIBNAME-VERSION/...

So it works well, assuming you're always using pkgconfig and assuming you accept that "#include <mir/foo/bar.h>" is no longer unique. Because you might have:
   /usr/include/mirserver/mir/foo/bar.h
   /usr/include/mirclient/mir/foo/bar.h

I don't like those two assumptions. They could both be resolved by using "/usr/include/mir/...".

I also don't like that we're installing so many headers, but we can fix that by simply moving things around within the source tree, later.

In the interest of being pragmatic and not holding people up, I think it's good enough for a first step. Even after external projects #include <mir/server/something.h> then we're still able to change the physical location of that "mir" directory without forcing anyone to change their code. So we have no reason to hold this up.

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

> So it works well, assuming you're always using pkgconfig and assuming you
> accept that "#include <mir/foo/bar.h>" is no longer unique. Because you might
> have:
> /usr/include/mirserver/mir/foo/bar.h
> /usr/include/mirclient/mir/foo/bar.h
>
> I don't like those two assumptions. They could both be resolved by using
> "/usr/include/mir/...".

Correct. I've been mulling that over and I'm not sure if it's a good or bad thing. Note it is generally safe because we're actually copying subdirectories from our source tree so they can't overlap. But yeah, it is something we should consider.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I don't think this succeeds in supporting *any* use case - especially the ones we care about.

Specifically, there are a lot of include/server/mir headers that reference mir::geometry, so at the very least /usr/include/mirserver should be merging include/shared/mir.

I still think it better to:

1. first agree what we are trying to support.
2. second agree how we plan to support it.
3. propose changes to make that happen.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Alan, I've installed the common headers now. We can iterate on this later.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/libmirserver-dev.install'
2--- debian/libmirserver-dev.install 2013-02-01 11:08:00 +0000
3+++ debian/libmirserver-dev.install 2013-03-21 21:56:22 +0000
4@@ -1,2 +1,3 @@
5+usr/include/mirserver
6 usr/lib/pkgconfig/mirserver.pc
7 usr/lib/libmirserver.so
8
9=== modified file 'src/server/CMakeLists.txt'
10--- src/server/CMakeLists.txt 2013-03-11 17:42:55 +0000
11+++ src/server/CMakeLists.txt 2013-03-21 21:56:22 +0000
12@@ -9,6 +9,11 @@
13 add_subdirectory(frontend/)
14 add_subdirectory(shell/)
15
16+set(PREFIX "${CMAKE_INSTALL_PREFIX}")
17+set(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}")
18+set(LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
19+set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/mirserver")
20+
21 configure_file(
22 ${CMAKE_CURRENT_SOURCE_DIR}/mirserver.pc.in
23 ${CMAKE_CURRENT_BINARY_DIR}/mirserver.pc
24@@ -62,6 +67,15 @@
25 install(TARGETS mirserver
26 LIBRARY DESTINATION lib
27 )
28+ install(DIRECTORY
29+ ${CMAKE_SOURCE_DIR}/include/server/mir DESTINATION "include/mirserver"
30+ )
31+ install(DIRECTORY
32+ ${CMAKE_SOURCE_DIR}/include/shared/mir DESTINATION "include/mirserver"
33+ )
34+ install(DIRECTORY
35+ ${CMAKE_SOURCE_DIR}/include/shared/mir_toolkit DESTINATION "include/mirserver"
36+ )
37 else()
38 target_link_libraries(mirserver
39 LINK_PUBLIC

Subscribers

People subscribed via source and target branches