Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ targets = [
]

[workspace.package]
version = "2.5.35"
version = "2.5.36"
edition = "2021"
rust-version = "1.95.0"
license = "AGPL-3.0-only"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,19 @@ impl Esp32Framework {
if lib_dir.exists() {
flags.push(format!("-L{}", lib_dir.display()));
}
// Arduino-ESP32 2.x keeps radio archives such as libphy.a and
// librtc.a beside its linker scripts. WiFi users need these archives
// even though the ordinary SDK libraries live under lib/.
let ld_dir = sdk_dir.join("ld");
if ld_dir.exists() {
flags.push(format!("-L{}", ld_dir.display()));
}
let mut libraries = variant_dir
.as_ref()
.map(|dir| collect_archive_files(dir))
.unwrap_or_default();
libraries.extend(collect_archive_files(&lib_dir));
libraries.extend(collect_archive_files(&ld_dir));
let mut names = std::collections::BTreeSet::new();
for lib in libraries {
if let Some(stem) = lib.file_stem() {
Expand Down
29 changes: 29 additions & 0 deletions crates/fbuild-library/src/library/esp32_framework/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,35 @@ fn old_sdk_libraries_use_selected_variant_before_common_archives() {
assert!(flags.contains(&"-lesp_system".to_string()));
}

#[test]
fn old_sdk_radio_archives_are_linked_from_ld_directory() {
let tmp = tempfile::TempDir::new().unwrap();
let sdk = tmp.path().join("tools").join("sdk").join("esp32");
let common = sdk.join("lib");
let ld = sdk.join("ld");
std::fs::create_dir_all(&common).unwrap();
std::fs::create_dir_all(&ld).unwrap();
std::fs::write(common.join("libesp_phy.a"), "").unwrap();
std::fs::write(ld.join("libphy.a"), "").unwrap();
std::fs::write(ld.join("librtc.a"), "").unwrap();
let fw = Esp32Framework {
base: PackageBase::new(
"test",
"1.0",
"http://example.com",
"http://example.com",
None,
CacheSubdir::Platforms,
tmp.path(),
),
install_dir: Some(tmp.path().to_path_buf()),
};
let flags = fw.get_sdk_lib_flags("esp32", None);
assert!(flags.contains(&format!("-L{}", ld.display())));
assert!(flags.contains(&"-lphy".to_string()));
assert!(flags.contains(&"-lrtc".to_string()));
}

#[test]
fn test_split_defines_preserves_escaped_quotes() {
let content =
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fbuild"
version = "2.5.35"
version = "2.5.36"
description = "PlatformIO-compatible embedded build tool (Rust implementation)"
readme = "README.md"
license = "AGPL-3.0-only"
Expand Down
Loading