Skip to content

[skip changelog] Document library dependency version constraints #1786

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

Merged
merged 1 commit into from
Jun 28, 2022
Merged

[skip changelog] Document library dependency version constraints #1786

merged 1 commit into from
Jun 28, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 28, 2022

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • [N/A] Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • [N/A] UPGRADING.md has been updated with a migration guide (for breaking changes)

What kind of change does this PR introduce?

Documentation update.

What is the current behavior?

Arduino libraries may specify dependencies on other libraries in their metadata. The Arduino Library Manager offers the option to install these dependencies when the user installs the library.

By default, the latest version of the dependency is installed. However, libraries may be compatible or tested working only with specific versions of a dependency. In this case, the library developer may wish to specify a particular version or version range of the dependency.

Arduino CLI and the Arduino Library index system has had support for such dependency version constraints for the last 2.5 years, but it was never documented so has only been used by the few library developers who discovered it via other means.

What is the new behavior?

The dependencies version constraint system is fully documented in the Arduino library specification. This will allow meaningful benefit to finally come from the work done to add this valuable capability.

Does this PR introduce a breaking change, and is titled accordingly?

No breaking changes.

Other information:

I had to resort to some unusual markup in order to produce a syntax table that would be formatted correctly by the Prettier formatter (which expects the escaped pipe \| approach supported by the "GitHub Flavored Markdown" dialect) and also rendered correctly in the MkDocs/Python-Markdown-produced website (which faithfully adheres to the original Markdown specification, and so does not recognize the pipe escaping syntax): mkdocs/mkdocs#2761


Version constraints documentation from the go.bug.st/relaxed-semver package that provides this capability to Arduino CLI: https://github.com/bugst/relaxed-semver#version-constraints


Version constraints are not supported by Arduino IDE 1.x (it always installs the latest version of the dependency after user confirmation), and older versions of Arduino CLI and Arduino IDE 2.x. I have documented the cutoff versions in the specification. The specific points in the development history are:

Arduino libraries may specify dependencies on other libraries in their metadata. The Arduino Library Manager offers the
option to install these dependencies when the user installs the library.

By default, the latest version of the dependency is installed. However, libraries may be compatible or tested working
only with specific versions of a dependency. In this case, the library developer may wish to specify a particular
version or version range of the dependency.

Arduino CLI and the Arduino Library index system has had support for such dependency version constraints for the last
2.5 years, but it was never documented so has only been used by the few library developers who discovered it via other
means.

The dependencies version constraint system is hereby fully documented in the Arduino library specification. This will
allow meaningful benefit to finally come from the work done to add this valuable capability.
@per1234 per1234 added topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels Jun 28, 2022
@per1234 per1234 requested review from ubidefeo and umbynos June 28, 2022 09:22
@per1234 per1234 self-assigned this Jun 28, 2022
@per1234
Copy link
Contributor Author

per1234 commented Jun 28, 2022

The failure of the link check is expected due to there not having been a release since the Mac ARM 64 bit build target was added to the release links table.

@per1234 per1234 merged commit 9b6c9c4 into arduino:master Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants