Mir

Merge lp:~vanvugt/mir/mir-display-config-header into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~vanvugt/mir/mir-display-config-header
Merge into: lp:mir
Diff against target: 90 lines (+32/-6)
5 files modified
include/client/mir_toolkit/mir_client_library.h (+1/-1)
include/client/mir_toolkit/mir_display_config.h (+3/-3)
include/client/mir_toolkit/mir_display_configuration.h (+26/-0)
src/client/display_configuration_api.cpp (+1/-1)
tests/mir_test/display_config_matchers.cpp (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/mir-display-config-header
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Disapprove
Alan Griffiths Needs Information
Andreas Pokorny (community) Disapprove
Mir CI Bot continuous-integration Approve
Alexandros Frantzis (community) Disapprove
Review via email: mp+311246@code.launchpad.net

Commit message

Correct a header file name to match the API it provides:
  MirDisplayConfig and mir_display_config_*

To post a comment you must log in.
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

In the 1.0 API cleanup discussion we decided to go with MirDisplayConfiguration and mir_display_configuration_* naming. This MP proposes the opposite of what we decided.

review: Disapprove
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3833
https://mir-jenkins.ubuntu.com/job/mir-ci/2212/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2866
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2931
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2923
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2923
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2923
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2895/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2895/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2895/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2895/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2895/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2895
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2895/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2212/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

yes .. the other way round..

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

You propose renaming all the API functions making them harder to type, rather than just fixing the inconsistently named header file?

That makes no sense.

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

> In the 1.0 API cleanup discussion we decided to go with
> MirDisplayConfiguration and mir_display_configuration_* naming. This MP
> proposes the opposite of what we decided.

Color me confused: mir_toolkit/mir_connection.h has this...

    /**
     * Query the display
     *
     * \deprecated Use mir_connection_create_display_configuration() instead.
     *
     * \warning return value must be destroyed via mir_display_config_destroy()
     * \warning may return null if connection is invalid
     * \param [in] connection The connection
     * \return structure that describes the display configuration
     */
    MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection);

And mir_connection_create_display_configuration() returns MirDisplayConfig, so we're already in the process of deprecating use of MirDisplayConfiguration in favour of MirDisplayConfig and have decided to reverse that but use the new function names?

I don't see the intermediate steps that get us there.

review: Needs Information
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> And mir_connection_create_display_configuration() returns MirDisplayConfig,
> so we're already in the process of deprecating use of MirDisplayConfiguration
> in favour of MirDisplayConfig and have decided to reverse that but use the
> new function names?
>
> I don't see the intermediate steps that get us there.

Since we have messed up the naming of DisplayConfig(uration) and related functions in this way, it's hard to provide a sensible deprecation path (but perhaps possible with some header trickery). We will probably need to go with a clean break at 1.0 without deprecation. It's not ideal, but we need to clean the mess, and this is our chance.

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

There is a clean path forward. I thought it was obvious but let me explain:

1. Land this branch to make the file name consistent with the "new" API.

2. Add a new function (so it's not an API break) that wraps the remaining inconsistent function Alan mentioned, but using the correct naming convention:

MirDisplayConfig* mir_connection_get_display_config(MirConnection* connection)
{
    return mir_connection_create_display_configuration(connection);
}

3. Now we have consistently _display_config functions operating on MirDisplayConfig. We can deprecate the rest when we want.

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

2.5. We also need new functions with correct suffixes to wrap these:

  mir_connection_preview_base_display_configuration
  mir_connection_confirm_base_display_configuration

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

> There is a clean path forward. I thought it was obvious but let me explain:
>
> 1. Land this branch to make the file name consistent with the "new" API.

You've already collected two "Disapproves" because this MP is not consistent the intended API - it moves the "wrong way".

It is obviously possible to get to places other than the intended API with only one ABI break, but that's not what I've been questioning.

> 2. Add a new function (so it's not an API break) that wraps the remaining
> inconsistent function Alan mentioned, but using the correct naming convention:
>
> MirDisplayConfig* mir_connection_get_display_config(MirConnection* connection)
> {
> return mir_connection_create_display_configuration(connection);
> }

Doesn't that break the convention that things that are "created" need to be released while "get" is for things that don't?

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

The intended API you imply (which is only hearsay right now and less related to the real API that exists) is both too wordy and also involves breaking the ABI. So I still maintain this proposal is the best way forward since it does not have those problems.

As for "created" vs "get", "created" is a historical mistake. We are not creating the display config; we are only copying it from the server. Hence "get" or "copy" is a more appropriate verb than "create".

I think a reasonable person reading these comments will agree with me so am waiting on more votes.

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

> The intended API you imply (which is only hearsay right now and less related
> to the real API that exists) is both too wordy and also involves breaking the
> ABI. So I still maintain this proposal is the best way forward since it does
> not have those problems.

"Hearsay" is a poor characterisation of something that was agreed by the team IRL (in Den Haag). Your not paying attention or being out the room at the time does not entitle you to be so dismissive.

You don't seem to have realized it but I agree that you're suggesting a more easily reached destination. But it remains the wrong one (unless we persuade the team to change its mind).

> As for "created" vs "get", "created" is a historical mistake. We are not
> creating the display config; we are only copying it from the server. Hence
> "get" or "copy" is a more appropriate verb than "create".

Nonsense.

> I think a reasonable person reading these comments will agree with me so am
> waiting on more votes.

Good luck!

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

I would like to not get drawn into a personal argument, but in the interest of not letting others victimize me publicly and get away with it, it must be noted that I was only not in the room at the time because I was busy doing my job; attending sessions in Den Haag.

I believe this is a reasonable change and something we should consider more generally (using "config" over "configuration") since some of our function names are getting quite long. Also most of the existing new display API uses "config" over "configuration" already. I'm not choosing it because it's the path of least resistance but also because it's the cleanest one.

And I believe even more strongly that it's poor API design to say something is "created" when it's a key requirement that the user be aware they're actually copying the server's current configuration and not "creating" a blank or default object.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

I would like to think we were all doing our jobs. Im still in favour of MirDisplayConfiguration. 6 characters isnt *to* many extra characters to type. Yes it break ABI, yes it'll be a bit more work. We are already planning on breaking the ABI. I dont see a reason we should avoid this when a majority of us agreed on a name already.

review: Disapprove
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

7*

Unmerged revisions

3833. By Daniel van Vugt

Public headers should look different

3832. By Daniel van Vugt

Done.

3831. By Daniel van Vugt

Prototype

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/client/mir_toolkit/mir_client_library.h'
2--- include/client/mir_toolkit/mir_client_library.h 2016-07-18 07:38:38 +0000
3+++ include/client/mir_toolkit/mir_client_library.h 2016-11-18 10:15:15 +0000
4@@ -26,7 +26,7 @@
5 #include <mir_toolkit/mir_platform_message.h>
6 #include <mir_toolkit/cursors.h>
7 #include <mir_toolkit/mir_cookie.h>
8-#include <mir_toolkit/mir_display_configuration.h>
9+#include <mir_toolkit/mir_display_config.h>
10 #include <mir_toolkit/mir_input_device.h>
11 #include <mir_toolkit/mir_error.h>
12
13
14=== renamed file 'include/client/mir_toolkit/mir_display_configuration.h' => 'include/client/mir_toolkit/mir_display_config.h'
15--- include/client/mir_toolkit/mir_display_configuration.h 2016-10-31 02:37:31 +0000
16+++ include/client/mir_toolkit/mir_display_config.h 2016-11-18 10:15:15 +0000
17@@ -16,8 +16,8 @@
18 * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
19 */
20
21-#ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
22-#define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
23+#ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIG_H_
24+#define MIR_TOOLKIT_MIR_DISPLAY_CONFIG_H_
25
26 #include "client_types.h"
27
28@@ -551,4 +551,4 @@
29 }
30 #endif
31
32-#endif //MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
33+#endif /* MIR_TOOLKIT_MIR_DISPLAY_CONFIG_H_ */
34
35=== added file 'include/client/mir_toolkit/mir_display_configuration.h'
36--- include/client/mir_toolkit/mir_display_configuration.h 1970-01-01 00:00:00 +0000
37+++ include/client/mir_toolkit/mir_display_configuration.h 2016-11-18 10:15:15 +0000
38@@ -0,0 +1,26 @@
39+/*
40+ * Copyright © 2016 Canonical Ltd.
41+ *
42+ * This program is free software: you can redistribute it and/or modify it
43+ * under the terms of the GNU Lesser General Public License version 3,
44+ * as published by the Free Software Foundation.
45+ *
46+ * This program is distributed in the hope that it will be useful,
47+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
48+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+ * GNU Lesser General Public License for more details.
50+ *
51+ * You should have received a copy of the GNU Lesser General Public License
52+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
53+ */
54+
55+#ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
56+#define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
57+
58+#ifdef __GNUC__
59+#warning "mir_display_configuration.h is deprecated. Please use mir_display_config.h instead."
60+#endif
61+
62+#include <mir_toolkit/mir_display_config.h>
63+
64+#endif /* MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_ */
65
66=== modified file 'src/client/display_configuration_api.cpp'
67--- src/client/display_configuration_api.cpp 2016-10-31 02:37:31 +0000
68+++ src/client/display_configuration_api.cpp 2016-11-18 10:15:15 +0000
69@@ -16,7 +16,7 @@
70 * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
71 */
72
73-#include <mir_toolkit/mir_display_configuration.h>
74+#include "mir_toolkit/mir_display_config.h"
75 #include <mir/require.h>
76 #include "mir/output_type_names.h"
77 #include "display_configuration.h"
78
79=== modified file 'tests/mir_test/display_config_matchers.cpp'
80--- tests/mir_test/display_config_matchers.cpp 2016-10-31 02:37:31 +0000
81+++ tests/mir_test/display_config_matchers.cpp 2016-11-18 10:15:15 +0000
82@@ -20,7 +20,7 @@
83 #include "mir/graphics/display_configuration.h"
84 #include "mir_protobuf.pb.h"
85 #include "mir_toolkit/client_types.h"
86-#include "mir_toolkit/mir_display_configuration.h"
87+#include "mir_toolkit/mir_display_config.h"
88 #include <gtest/gtest.h>
89
90 namespace mg = mir::graphics;

Subscribers

People subscribed via source and target branches