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

Fix bad error message when board ID part of FQBN is wrong #1506

Merged
merged 1 commit into from
Oct 18, 2021
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
2 changes: 1 addition & 1 deletion arduino/cores/packagemanager/package_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) (
board := platformRelease.Boards[fqbn.BoardID]
if board == nil {
return targetPackage, platformRelease, nil, nil, nil,
fmt.Errorf(tr("board %s:%s not found"), platformRelease, fqbn.BoardID)
fmt.Errorf(tr("board %s not found"), fqbn.StringWithoutConfig())
}

buildProperties, err := board.GetBuildProperties(fqbn.Configs)
Expand Down
4 changes: 2 additions & 2 deletions i18n/data/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -2444,8 +2444,8 @@ msgid "binary file not found in %s"
msgstr "binary file not found in %s"

#: arduino/cores/packagemanager/package_manager.go:189
msgid "board %s:%s not found"
msgstr "board %s:%s not found"
msgid "board %s not found"
msgstr "board %s not found"

#: commands/board/list.go:41
msgid "board not found"
Expand Down
5 changes: 2 additions & 3 deletions test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def test_compile_using_boards_local_txt(run_command, data_dir):
# Verifies compilation fails because board doesn't exist
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
assert res.failed
assert "Error during build: Error resolving FQBN: board arduino:avr@1.8.3:nessuno not found" in res.stderr
assert "Error during build: Error resolving FQBN: board arduino:avr:nessuno not found" in res.stderr

# Use custom boards.local.txt with made arduino:avr:nessuno board
boards_local_txt = Path(data_dir, "packages", "arduino", "hardware", "avr", "1.8.3", "boards.local.txt")
Expand Down Expand Up @@ -943,8 +943,7 @@ def test_compile_manually_installed_platform_using_boards_local_txt(run_command,
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
assert res.failed
assert (
"Error during build: Error resolving FQBN: board arduino-beta-development:avr@1.8.3:nessuno not found"
in res.stderr
"Error during build: Error resolving FQBN: board arduino-beta-development:avr:nessuno not found" in res.stderr
)

# Use custom boards.local.txt with made arduino:avr:nessuno board
Expand Down