Skip to content

Commit b966748

Browse files
author
Federico Fissore
committed
Turned out MSG_MISSING_COMPILER_PATH was useless. See #11 and
arduino/Arduino@a89f5e6 Signed-off-by: Federico Fissore <[email protected]>
1 parent 1f04e67 commit b966748

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

Diff for: src/arduino.cc/builder/constants/constants.go

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ const MSG_LIBRARY_CAN_USE_SRC_AND_UTILITY_FOLDERS = "Library can't use both 'src
202202
const MSG_LIBRARY_INCOMPATIBLE_ARCH = "WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s)."
203203
const MSG_LOOKING_FOR_RECIPES = "Looking for recipes like {0}*{1}"
204204
const MSG_MISSING_BUILD_BOARD = "Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}"
205-
const MSG_MISSING_COMPILER_PATH = "Third-party platform.txt (package '{0}' platform '{1}') does not define compiler.path. Please report this to the third-party hardware maintainer."
206205
const MSG_MISSING_CORE_FOR_BOARD = "Selected board depends on '{0}' core (not installed)."
207206
const MSG_MUST_BE_A_FOLDER = "{0} must be a folder"
208207
const MSG_PACKAGE_UNKNOWN = "{0}: Unknown package"

Diff for: src/arduino.cc/builder/setup_build_properties.go

-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ func (s *SetupBuildProperties) Run(context map[string]interface{}) error {
6161
}
6262
buildProperties[constants.BUILD_PROPERTIES_BUILD_ARCH] = strings.ToUpper(targetPlatform.PlatformId)
6363

64-
if buildProperties[constants.BUILD_PROPERTIES_COMPILER_PATH] == constants.EMPTY_STRING {
65-
targetPackage := context[constants.CTX_TARGET_PACKAGE].(*types.Package)
66-
return utils.Errorf(context, constants.MSG_MISSING_COMPILER_PATH, targetPackage.PackageId, actualPlatform.PlatformId)
67-
}
68-
6964
buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE] = context[constants.CTX_BUILD_CORE].(string)
7065
buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH] = filepath.Join(actualPlatform.Folder, constants.FOLDER_CORES, buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE])
7166
buildProperties[constants.BUILD_PROPERTIES_BUILD_SYSTEM_PATH] = filepath.Join(actualPlatform.Folder, constants.FOLDER_SYSTEM)

Diff for: src/arduino.cc/builder/test/setup_build_properties_test.go

-40
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ package test
3232
import (
3333
"arduino.cc/builder"
3434
"arduino.cc/builder/constants"
35-
"arduino.cc/builder/i18n"
3635
"arduino.cc/builder/props"
3736
"arduino.cc/builder/types"
3837
"arduino.cc/builder/utils"
@@ -148,42 +147,3 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) {
148147
require.Equal(t, "\"{compiler.path}{compiler.c.cmd}\" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} \"{source_file}\" -o \"{object_file}\"", buildProperties["recipe.c.o.pattern"])
149148
require.Equal(t, "non existent path with space and a =", buildProperties["tools.avrdude.config.path"])
150149
}
151-
152-
func TestSetupBuildPropertiesWithMissingCompilerPath(t *testing.T) {
153-
DownloadCoresAndToolsAndLibraries(t)
154-
155-
context := make(map[string]interface{})
156-
157-
buildPath := SetupBuildPath(t, context)
158-
defer os.RemoveAll(buildPath)
159-
160-
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"
161-
context[constants.CTX_HARDWARE_FOLDERS] = []string{filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"}
162-
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools", "./tools_builtin"}
163-
context[constants.CTX_FQBN] = "arduino:avr:uno"
164-
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch1", "sketch.ino")
165-
context[constants.CTX_CUSTOM_BUILD_PROPERTIES] = []string{"name=fake name", "tools.avrdude.config.path=non existent path with space and a ="}
166-
167-
commands := []types.Command{
168-
&builder.SetupHumanLoggerIfMissing{},
169-
&builder.AddAdditionalEntriesToContext{},
170-
&builder.HardwareLoader{},
171-
&builder.ToolsLoader{},
172-
&builder.TargetBoardResolver{},
173-
&builder.SketchLoader{},
174-
}
175-
176-
for _, command := range commands {
177-
err := command.Run(context)
178-
NoError(t, err)
179-
}
180-
181-
targetPlatform := context[constants.CTX_TARGET_PLATFORM].(*types.Platform)
182-
delete(targetPlatform.Properties, constants.BUILD_PROPERTIES_COMPILER_PATH)
183-
184-
command := builder.SetupBuildProperties{}
185-
err := command.Run(context)
186-
require.Error(t, err)
187-
188-
require.Equal(t, i18n.Format(constants.MSG_MISSING_COMPILER_PATH, "arduino", "avr"), err.Error())
189-
}

0 commit comments

Comments
 (0)