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

message_definitions: add all_with_development.xml #1924

Closed
wants to merge 1 commit into from

Conversation

julianoes
Copy link
Collaborator

With this commit we have:

  • all_with_development.xml: for development and message ID conflict checking.
  • all.xml: for released software connecting to all flight stacks, e.g. QGC, MAVSDK, pymavlink.

With this commit we have:
- all_with_development.xml: for development and message ID conflict
  checking.
- all.xml: for released software connecting to all flight stacks, e.g.
  QGC, MAVSDK, pymavlink.
@hamishwillee
Copy link
Collaborator

@julianoes Don't we also need to build both of these in CI?

@hamishwillee
Copy link
Collaborator

We're looking at including "all.xml" in QGC as this means that we automatically get all stakeholder dialects supported. The argument against that was that we don't want development.xml in releases, because then we end up with the problems we had using "WIP" in common - stuff we might want to modify that we no longer can.

So all.xml now splits out development. If you really want to build with development then you use "all_with_development.xml".

@peterbarker

  • Is this conceptually and practically OK
  • Is there an other places that need to be updated - e.g. tests

@bkueng As discussed offline, I understand you want to be able to build QGC with development.xml. Can you do what is needful to ensure that releases do not ever include development, but daily builds do ("all_with_development.xml")? Note that having a build flag or whatever is OK but it should be set up so that the default is all.xml and you have to do something special to get the development version. My reasoning here is that PX4 v1.13 released with development because that was the default setting in main when the release was cut.

@peterbarker
Copy link
Contributor

peterbarker commented Nov 23, 2022 via email

@hamishwillee
Copy link
Collaborator

@peterbarker Thanks. Understood that we want to build all dialects so tests need to be updated.

all.xml then includes both "all_without_development.xml" and "development.xml". That's really rather an ugly name, but doing things this way won't break existing users.

Yes, the name is horrible, and I hate the fact that "all" doen't really mean "all".

But sometimes you have to be pragmatic. If we want to use all.xml in ground stations and also not include development.xml in releases then this is probalby the best way.

You might also consider that if we have users that have release code with development.xml, present via all.xml, we want to break them. They are doing the wrong thing using development in release code.

Having that checkbox in QGC to allow or disallow use of WIP messages would simplify this rather a lot.

We want to discourage use of development.xml in releases. Some approach like this might help QGC achieve the result, but then the next system that comes along won't do the same thing.

Anyway, let's give @bkueng and @julianoes a chance to comment. Definitely does require thought.

@bkueng
Copy link
Member

bkueng commented Nov 24, 2022

Thanks for looking into this.

I can see this go either way, build-time or run-time.
Build-time ensures nothing slips in by accident.

@peterbarker
Copy link
Contributor

I can see this go either way, build-time or run-time. Build-time ensures nothing slips in by accident.

Mmmmm.... depends on the implementation language. If we goofed with MAVProxy, for example, we could release a version of the code depending on development messages - and that wouldn't be caught until someone crossed the relevant codepath.

I'm not all that familiar with MissionPlanner development, but I believe it might be possible to get the same effect in there - runtime-loading of code is great, but also the pits.

I think on balance Hamish is right, 'though. I'll ask for a bit of time at our DevCall tomorrow to discuss.

@davidbuzz
Copy link
Contributor

davidbuzz commented Nov 28, 2022

why not make a qgc-release.xml that just leaves-out development.xml?
.. and maybe a qgc-dev.xml that includes development.xml ?

@peterbarker
Copy link
Contributor

UTC2300  - https://github.com/mavlink/mavlink/pull/1924
Why isn’t this all about WIP tags rather than development.xml?
Development.xml is really just WIP messages destined for common.xml (or standard.xml) eventually?
Need James to weigh in
It’s nice that we’re moving towards QGC compiling against all.xml

@hamishwillee
Copy link
Collaborator

Why isn’t this all about WIP tags rather than development.xml?

WIP tags were an early attempt to manage experimental behaviour. We moved to development.xml as a cleaner way of managing what is "standard" - in part because we never got ability to exclude WIP tags by default.

We're working to move WIP out of common.xml - either accepted or moved to development, or something else. We will occasionally need them though, because they are the only way currently we can extend some existing entities in common.

why not make a qgc-release.xml that just leaves-out development.xml? And maybe a qgc-dev.xml that includes development.xml ?

  1. If it existed it should be gcs_dev, gcs_rel (not QGC-specfiic)
  2. Perhaps a hierarchy :
    all > dev > gcs_rel > dialects > common > standard > minimal.xml.
        > test
        > ?
    
    Does that work?

Still not sure what's best. Ambivalent as long as it is hard to include development.xml in releases.

@peterbarker
Copy link
Contributor

WIP tags were an early attempt to manage experimental behaviour. We moved to development.xml as a cleaner way of managing what is "standard" - in part because we never got ability to exclude WIP tags by default.

the same experimental behavior you want to keep out of QGC?

combined with

We're working to move WIP out of common.xml - either accepted or moved to development, or something else. We will occasionally need them though, because they are the only way currently we can extend some existing entities in common.

it really sounds like excluding WIP tags is the correct thing to do. I actually thought we did have this facility and used it in the generated mavlink headers; can you point me to the failed effort, please?

@hamishwillee
Copy link
Collaborator

hamishwillee commented Dec 1, 2022

the same experimental behavior you want to keep out of QGC?

Yes "in release builds"

it really sounds like excluding WIP tags is the correct thing to do.

Yes, except that stuff in development.xml is assumed WIP but not necessarily tagged as such.

But yes, we could do something to default mark everything as WIP or we could explicitly do so in development.xml.

I actually thought we did have this facility and used it in the generated mavlink headers; can you point me to the failed effort, please?

ArduPilot/pymavlink#240

This would fail because it needs to be enabled - no one will remember to do this. It might work if it was default "do not build" unless flag set.

@peterbarker
Copy link
Contributor

peterbarker commented Dec 1, 2022 via email

@hamishwillee
Copy link
Collaborator

Sorry, what would need to be enabled? The purging of WIP messages? Only
a handful of people will ever need to get that right :-)

Yes. It's not so much a matter of purging messages as making sure they can easily be used during development and not during releases. It is far easier IMO to have an XML file that doesn't use them than to try have a GCS filter them after the fact.

I'm more inclined to have a structure as suggested by Buzz. Interested in what @auturgy thinks.

If we get all the major players compiling against all.xml then we should probably consider moving all WIP messages from common.xml to development.xml for consistency's sake.

I'm slowing working on that. Some of them are actually incorrectly marked. At the end of the process there should only be a few WIP items that have to be there. i.e. because they affect existing enums or similar that are defined in common.

@julianoes
Copy link
Collaborator Author

why not make a qgc-release.xml that just leaves-out development.xml?
.. and maybe a qgc-dev.xml that includes development.xml ?

Because I'd also want to use it in MAVSDK, so I wouldn't make it specific to an implementation.

@hamishwillee
Copy link
Collaborator

why not make a qgc-release.xml that just leaves-out development.xml?
.. and maybe a qgc-dev.xml that includes development.xml ?

Because I'd also want to use it in MAVSDK, so I wouldn't make it specific to an implementation.

I mean't "gcs-release". But you could also do the same thing with "all_dialects"

all > all_dialects_with_dev > all_dialects > dialects + common +standard+ minimal
    > test
    > others

@peterbarker
Copy link
Contributor

peterbarker commented Dec 7, 2022 via email

@hamishwillee
Copy link
Collaborator

hamishwillee commented Dec 7, 2022

I might not have been clear in what I was getting at.

I'd really rather not have any magic in the file names when there's a technical measure (the WIP tag) available in all files to inform GCSs use of experimental messages.

@peterbarker

I'd agree if there was any help from the toolchain, but there is not. Essentially to use the WIP tag for this purpose we would have to fix the toolchain so that it will build the libraries without WIP entities, and we might also need to pre-build libraries both in release and development variants. That's possible, but needs work.

A GCS that builds from sources might in theory capture additional information from the WIP tag to dynamically determine which methods to enable/disable at runtime. Again though, that's not supported and a lot of work. A GCS using pre-built libraries can't do this as the data is already lost.

So right now, the easiest way to achieve this is to have a way to not build said messages in the first place. It's not pretty but it is pragmatic.

If you are happy to add support for building libraries without WIP entities we can talk further about this option. Unless I'm missing something?

@hamishwillee
Copy link
Collaborator

We talked about this in the mavlink call last night. The broad agreement was that @peterbarker is right; using the WIP tags to filter messages is a better approach.

Our preference is that mavgen builds without WIP entities by default

  • I am assuming enum values will always be "at the end" and so removing them will not screw up ordering.
  • The entities could then be added back with a build flag and/or environment variable.
  • CI would want to build both versions.

@peterbarker That means we need to re-invigorate, and probably update, ArduPilot/pymavlink#240. As I recall that warns on use of WIP tags, but you have to explicitly enable it. We think actually removing the entities is better, and prefer "default off".
With a warning Tridge needed this to not be enabled by default, because of CI - but with removal the warnings are at build time in the library that uses is, so should be no problem.

@peterbarker @julianoes @auturgy Closing this now.

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.

None yet

5 participants