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

SdFat Upstream Conflicts with Adafruit SDFat Fork #2828

Open
brentru opened this issue Feb 27, 2025 · 2 comments
Open

SdFat Upstream Conflicts with Adafruit SDFat Fork #2828

brentru opened this issue Feb 27, 2025 · 2 comments

Comments

@brentru
Copy link
Contributor

brentru commented Feb 27, 2025

@earlephilhower Hi - Since v4.4.2, when upstream SDFat was added, I've noticed the compiler occasionally forcing the BSP's SDFat version to be compiled. This occurs even when we declare the adafruit/sdfat fork as a library dependency. An example of this is here where the compilation fails because the Arduino-Pico BSP's sdfat was used instead of the Adafruit Fork (defined in library.properties).

But sometimes, it properly takes the adafruit/sdfat fork. This behavior is very confusing and has been present since arduino-pico v4.4.2. This feels like it could be a regression with how the compiler resolves libraries.

Do you have any idea what the "correct" behavior should be here? If we're using a SDFat fork as a library dependency, should we uninstall the arduino-pico's upstream SDFat dependency?

@brentru
Copy link
Contributor Author

brentru commented Feb 27, 2025

cc @tyeth as you're also experiencing this issue

@earlephilhower
Copy link
Owner

earlephilhower commented Feb 27, 2025

This is all to do with arduino-cli and not the actual compiler so I'm not sure what we can do here. AIUI, the CLI has a set of rules to handle when there are multiple copies of "the same" header present, and the first one is the version comparison.

We're at the latest unmodified SdFat release (2.3.0 w/new really fast SDIO mode). It's got an unmodified SdFat.h configuration file (we set the 1 or 2 needed #defines in the compiler command line). Given the large changes in each release upstream, I'm quite happy to use @greiman's untouched code! We use it internally here to implement the SD and SDFS filesystems.

Looks like Adafruit_SdFat has a changed SdFat.h for your settings and a lower version (2.2.x?). But it is referenced and pulled in with the same header file name SdFat.h and not Adafruit_SdFat.h? I thought there needed to be a header of the same name as the library for the cli to work right...

Can Adafruit_SdFat just bump its own version number up to, say, 100+real version number (i.e. 102.2.3) so that when installed it will override any unmodified official versions? It'll bust the core here using the normal SD library, but if the user installs add'l libraries through the manager then they can uninstall them as needed.

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

No branches or pull requests

2 participants