Skip to content

Commit 2c361ef

Browse files
committed
[CI] Update binary management after cli change.
With new arduino-cli v0.11.0, output management has changed. See arduino/arduino-cli#687 Binaries are always copied. Signed-off-by: Frederic Pillon <[email protected]>
1 parent f383df9 commit 2c361ef

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

Diff for: CI/build/arduino-cli.py

+2-37
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ def create_output_log_tree():
118118
# Folders
119119
for board in board_fqbn:
120120
createFolder(os.path.join(output_dir, board))
121-
if args.bin:
122-
createFolder(os.path.join(output_dir, board, bin_dir))
123121
createFolder(os.path.join(build_output_dir, board))
124122

125123

@@ -484,8 +482,6 @@ def check_status(status, build_conf, boardKo):
484482

485483
if status[1] == 0:
486484
result = "\033[32msucceeded\033[0m"
487-
if args.bin:
488-
bin_copy(build_conf[0], sketch_name)
489485
nb_build_passed += 1
490486
elif status[1] == 1:
491487
# Check if failed due to a region overflowed
@@ -514,8 +510,6 @@ def check_status(status, build_conf, boardKo):
514510
else:
515511
# else consider it succeeded
516512
result = "\033[32msucceeded*\033[0m"
517-
if args.bin:
518-
empty_bin(build_conf[0], sketch_name)
519513
nb_build_passed += 1
520514
else:
521515
result = "\033[31merror\033[0m"
@@ -645,34 +639,6 @@ def log_final_result():
645639
print(output_dir)
646640

647641

648-
# Create an empty binary
649-
def empty_bin(board_name, sketch_name):
650-
empty_path = os.path.abspath(os.path.join(output_dir, board_name, bin_dir))
651-
createFolder(empty_path)
652-
empty_file = os.path.join(
653-
empty_path, sketch_name + "_COULD_NOT_FIT_IN_THIS_BOARD.bin"
654-
)
655-
try:
656-
f = open(empty_file, "w")
657-
except IOError:
658-
print("Cannot create empty binary: ", empty_file)
659-
else:
660-
f.close()
661-
662-
663-
# Create a "bin" directory for each board and copy all binary files
664-
# from the builder output directory into it
665-
def bin_copy(board_name, sketch_name):
666-
try:
667-
shutil.copy(
668-
os.path.join(build_output_dir, board_name, sketch_name + ".bin"),
669-
os.path.abspath(os.path.join(output_dir, board_name, bin_dir)),
670-
)
671-
except OSError as e:
672-
print("Cannot copy the binary from the arduino-cli output: " + e.strerror)
673-
raise
674-
675-
676642
# Set up specific options to customise arduino builder command
677643
def get_fqbn(b_name):
678644
if b_name in board_custom_fqbn and board_custom_fqbn[b_name]:
@@ -696,8 +662,8 @@ def genBasicCommand(b_name):
696662
cmd.append(build_output_cache_dir)
697663
if args.verbose:
698664
cmd.append("--verbose")
699-
cmd.append("-o")
700-
cmd.append(os.path.join(build_output_dir, b_name, "sketch"))
665+
cmd.append("--output-dir")
666+
cmd.append(os.path.join(output_dir, b_name, bin_dir))
701667
cmd.append("--fqbn")
702668
cmd.append(get_fqbn(b_name))
703669
cmd.append("dummy_sketch")
@@ -865,7 +831,6 @@ def build(build_conf):
865831
)
866832

867833
g1 = parser.add_mutually_exclusive_group()
868-
g1.add_argument("--bin", help="save binaries", action="store_true")
869834
g1.add_argument("--ci", help="custom configuration for CI build", action="store_true")
870835

871836
# Sketch options

0 commit comments

Comments
 (0)