Skip to content

Add configurable mavlink repo URL and Hash#2706

Merged
julianoes merged 3 commits intomavlink:mainfrom
Ryanf55:configurable-mavlink
Nov 25, 2025
Merged

Add configurable mavlink repo URL and Hash#2706
julianoes merged 3 commits intomavlink:mainfrom
Ryanf55:configurable-mavlink

Conversation

@Ryanf55
Copy link
Copy Markdown
Contributor

@Ryanf55 Ryanf55 commented Nov 6, 2025

Proposal for allowing people to use their own forks of mavlink at compile time.

Usage: cmake -B build -DMAVSDK_MAVLINK_URL=https://github.com/ryanf55/mavlink

@Ryanf55 Ryanf55 changed the title Add configurable mavlink location Add configurable mavlink repo URL and Hash Nov 6, 2025
julianoes
julianoes previously approved these changes Nov 6, 2025
Copy link
Copy Markdown
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this. I think I suggested that once in the past actually.

Note that with v4, MavlinkPassthrough will be off by default, but there will be a configure option to bring it back.

Copy link
Copy Markdown
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking, but would there be a way to keep the default values in third_party/mavlink/CMakeLists.txt instead of moving them to the superbuild options? So that it stays consistent with the other dependencies and keeps CMakeLists "self-contained".

What do you think?

@Ryanf55
Copy link
Copy Markdown
Contributor Author

Ryanf55 commented Nov 6, 2025

Nitpicking, but would there be a way to keep the default values in third_party/mavlink/CMakeLists.txt instead of moving them to the superbuild options? So that it stays consistent with the other dependencies and keeps CMakeLists "self-contained".

What do you think?

I tried that initially, however the values did not appear in build/CMakeCache.txt and could not be set from CLI. I suspect it may have to do with calling project again, but unclear. I would prefer that too if it worked.

@JonasVautherin
Copy link
Copy Markdown
Collaborator

JonasVautherin commented Nov 7, 2025

Fair enough. I'd like to note that - somewhat ironically - this adds some "oddities" to the build system, as the dependency helpers now depend on knowledge that is stored in the superbuild 🙈. But it makes it easier to have a custom dialect, so that's a tradeoff. See how we got there? 😇

If @julianoes is fine with it, that's good for me as well 👍.

@julianoes
Copy link
Copy Markdown
Collaborator

I think, I agree with @JonasVautherin. It would be nicer to have these used/defined not just for the SUPERBUILD. Let me try it...

@Ryanf55
Copy link
Copy Markdown
Contributor Author

Ryanf55 commented Nov 7, 2025

FWIW, here's more details.

If we instead put these variables in the third_party/mavlink/CMakeLists.txt, you will get a cache entry show up in the subproject.

ryan@friedmanr-ubuntu:~/Dev/MAVSDK/build$ grep -Rn MAVSDK_MAVLINK_HASH
third_party/mavlink/CMakeCache.txt:231:MAVSDK_MAVLINK_HASH:STRING=5e3a42b8f3f53038f2779f9f69bd64767b913bb8

Unfortunately, if you try to set this in the top level build command, you cannot; you get this warning.

CMake Warning:
  Manually-specified variables were not used by the project:

    MAVSDK_MAVLINK_URL

If we can find a way to control cache options in subprojects, that would allow us to keep it self contained.
Removing the project command gets rid of that warning, but the cache variable is left as default instead of obeying the command line.

@julianoes
Copy link
Copy Markdown
Collaborator

Oh, I see. Thanks for the explanation.

@julianoes
Copy link
Copy Markdown
Collaborator

julianoes commented Nov 9, 2025

Do you mind fixing the conflict? Then we can merge this.

Done.

@julianoes julianoes force-pushed the configurable-mavlink branch from 5e0ce09 to a5eec2a Compare November 10, 2025 01:49
@julianoes julianoes marked this pull request as ready for review November 10, 2025 01:50
@julianoes
Copy link
Copy Markdown
Collaborator

Oh dear, this broke CI? 😑

Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
@julianoes julianoes force-pushed the configurable-mavlink branch from a5eec2a to fcf85d7 Compare November 23, 2025 03:09
@sonarqubecloud
Copy link
Copy Markdown

@julianoes
Copy link
Copy Markdown
Collaborator

@Ryanf55 are you happy with this?

@Ryanf55
Copy link
Copy Markdown
Contributor Author

Ryanf55 commented Nov 25, 2025

@Ryanf55 are you happy with this?

Looks great, thanks for fixing the broken CI by adding those build flags in!

@julianoes julianoes merged commit 02df9d5 into mavlink:main Nov 25, 2025
54 checks passed
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.

3 participants