Skip to content

Commit fc0f60e

Browse files
facchinmcmaglie
andauthored
Don't archive preexisting archives if commandline is too long (arduino#1140)
* Don't archive preexisting archives if commandline is too long Fixes https://github.com/arduino-libraries/ArduinoIoTCloud/runs/1693000682?check_suite_focus=true#step:7:277 Should revert arduino-libraries/ArduinoIoTCloud#222 * Added test Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>
1 parent 618a30f commit fc0f60e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

legacy/builder/phases/linker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ func link(ctx *types.Context, objectFiles paths.PathList, coreDotARelPath *paths
7878
properties := buildProperties.Clone()
7979
archives := paths.NewPathList()
8080
for _, object := range objectFiles {
81+
if object.HasSuffix(".a") {
82+
archives.Add(object)
83+
continue
84+
}
8185
archive := object.Parent().Join("objs.a")
8286
if !archives.Contains(archive) {
8387
archives.Add(archive)

test/test_compile.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,3 +594,25 @@ def test_compile_with_custom_libraries(run_command, copy_sketch):
594594
# This compile command has been taken from this issue:
595595
# https://github.com/arduino/arduino-cli/issues/973
596596
assert run_command(f"compile --libraries {first_lib},{second_lib} -b {fqbn} {sketch_path}")
597+
598+
599+
def test_compile_with_archives_and_long_paths(run_command):
600+
# Creates config with additional URL to install necessary core
601+
url = "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
602+
assert run_command(f"config init --dest-dir . --additional-urls {url}")
603+
604+
# Init the environment explicitly
605+
assert run_command("update")
606+
607+
# Install core to compile
608+
assert run_command("core install esp8266:esp8266")
609+
610+
# Install test library
611+
assert run_command("lib install ArduinoIoTCloud")
612+
613+
result = run_command("lib examples ArduinoIoTCloud --format json")
614+
assert result.ok
615+
lib_output = json.loads(result.stdout)
616+
sketch_path = Path(lib_output[0]["library"]["install_dir"], "examples", "ArduinoIoTCloud-Advanced")
617+
618+
assert run_command(f"compile -b esp8266:esp8266:huzzah {sketch_path}")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy