Repository navigation
fix(lib_deps): install the archive of a GitHub URL's #ref (#2018) - #2031
Merged
Merged
Conversation
`lib_deps = https://github.com/O/R.git#3.0.12` kept the `#3.0.12` fragment in the URL it appended `/archive/refs/heads/main.zip` to, so the request went to the repository page, GitHub answered with HTML, and the zip reader failed with "Could not find EOCD". The ref also ended up in the library name and install directory (`r.git#3.0.12`). GitHub lib_deps now go through the shared PlatformIO spec parser (parse_package_spec) and the platform-repository owner/repo split (github_owner_repo, now pub). The new GitHubSource: - accepts https/http/www, `.git` or not, `git+https://`, and the `Name=<url>` custom-name form; - downloads `archive/<ref>.zip` (tags, branches and SHAs alike), or `archive/HEAD.zip` without a ref instead of guessing main/master; - puts a filesystem-safe ref in the install dir (`esp32-audioi2s-3.0.12`), so changing the ref never reuses the old checkout; - checks the download is a zip and names an HTML response clearly. Fixes #2018
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 17, 2026
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2018
Root cause
library_downloader::download_github_libraryappended/archive/refs/heads/main.zipto the rawlib_depsstring. Withhttps://github.com/schreibfaul1/ESP32-audioI2S.git#3.0.12the#3.0.12made everything after it a URL fragment, so the request went to the repository page. GitHub answered 200 with HTML, and the zip reader failed with "Could not find EOCD".LibrarySpec's own GitHub parser only stripped a trailing.git, so the ref also leaked into the library name and install dir (esp32-audioi2s.git#3.0.12). Without a ref, the code guessedmainand thenmaster.Fix
New
fbuild-library/src/library/github_source.rs(GitHubSource). It reuses existing parsers instead of adding a third GitHub URL parser:fbuild_core::platformio_package::parse_package_specsplits off the#refandgit+prefix (the shared PlatformIO grammar).fbuild_packages_fetch::platformio_repository::github_owner_repo, nowpub, splits owner/repo for platform repositories.Behaviour:
https://github.com/O/R[.git][#ref],git+https://…,http://andwww.spellings, and PlatformIO'sName=<url>custom-name form (checked againstplatformio/package/meta.py_parse_custom_name).O/R#refstays a registry spec, as it is in PlatformIO.https://github.com/O/R/archive/<ref>.zip, which GitHub serves for tags, branches and commit SHAs. Ref segments are percent-encoded. With no ref it downloadsarchive/HEAD.zip(the default branch) instead of guessingmainand thenmaster.LibrarySpec::install_dir_name()=<name>-<safe ref>, e.g.esp32-audioi2s-3.0.12. Changing the ref no longer reuses the previous ref's checkout. A ref that needs characters replaced also gets a short digest, soa/banda_bdon't collide.<url> returned an HTML page, not a zip archive; check that the repository and ref exist.library.jsonmetadata records the owner and the ref as version. Thefbuild installrow shows the ref and the archive URL.dl.registry.platformio.org, so GitHub archives are fetched from the primary, as before.Tests
github_source_tests.rs:HEAD.zipName=form#[ignore = "network: downloads from github.com"]test that installs the tag and checkssrc/Audio.cppis 273879 bytes (the size in the 3.0.12 archive; upstream never bumps its manifest version)Red first: before the fix,
LibrarySpec::parse(<issue URL>).namewasESP32-audioI2S.git#3.0.12.Validation
soldr cargo fmt --all: clean.soldr cargo clippy --workspace --all-targets -- -D warnings: passes.bash test -p fbuild-library,-p fbuild-packages-fetch,-p fbuild-build-engine: all pass.E2E
Ran the issue's project (esp32dev blink +
lib_deps = https://github.com/schreibfaul1/ESP32-audioI2S.git#3.0.12) withFBUILD_DEV_MODE=1and freshly built CLI and daemon.fbuild install:fetched library schreibfaul1/ESP32-audioI2S 3.0.12 … https://github.com/schreibfaul1/ESP32-audioI2S/archive/3.0.12.zip. Installed intolibs/esp32-audioi2s-3.0.12.src/src/Audio.cppis 273879 bytes, matching the tag archive.fbuild build --clean: succeeded (firmware 259 KB).libesp32-audioi2s.awas built.Secondary ("unused lib_deps library is still built")
No change here. This is PlatformIO parity, not a divergence. In PlatformIO's
ProjectAsLibBuilder.process_dependencies(platformio/builder/tools/piolib.py), everylib_depsentry is added as a dependency withdepend_on(...)whatever the includes say.lib_ldf_modeaffects only the libraries' own dependency search (search_deps_recursive) and the scan oflib/and global storage. So PlatformIO also compilesfastled/FastLEDlisted inlib_depsfor a blink that includes onlyArduino.h. Skipping such libraries would make fbuild diverge from PlatformIO, so it is a design decision and not part of this fix.