From b966748aaf67d79d402b447022906cff073c95f9 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Wed, 23 Sep 2015 15:21:20 +0200 Subject: [PATCH] Turned out MSG_MISSING_COMPILER_PATH was useless. See #11 and https://github.com/arduino/Arduino/commit/a89f5e68cf5cc5e323d099cb798dfd9cc6c0c11a Signed-off-by: Federico Fissore --- src/arduino.cc/builder/constants/constants.go | 1 - .../builder/setup_build_properties.go | 5 --- .../test/setup_build_properties_test.go | 40 ------------------- 3 files changed, 46 deletions(-) diff --git a/src/arduino.cc/builder/constants/constants.go b/src/arduino.cc/builder/constants/constants.go index 6a61d804..e69ff862 100644 --- a/src/arduino.cc/builder/constants/constants.go +++ b/src/arduino.cc/builder/constants/constants.go @@ -202,7 +202,6 @@ const MSG_LIBRARY_CAN_USE_SRC_AND_UTILITY_FOLDERS = "Library can't use both 'src 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)." const MSG_LOOKING_FOR_RECIPES = "Looking for recipes like {0}*{1}" const MSG_MISSING_BUILD_BOARD = "Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}" -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." const MSG_MISSING_CORE_FOR_BOARD = "Selected board depends on '{0}' core (not installed)." const MSG_MUST_BE_A_FOLDER = "{0} must be a folder" const MSG_PACKAGE_UNKNOWN = "{0}: Unknown package" diff --git a/src/arduino.cc/builder/setup_build_properties.go b/src/arduino.cc/builder/setup_build_properties.go index b8cba4ef..16f5ca28 100644 --- a/src/arduino.cc/builder/setup_build_properties.go +++ b/src/arduino.cc/builder/setup_build_properties.go @@ -61,11 +61,6 @@ func (s *SetupBuildProperties) Run(context map[string]interface{}) error { } buildProperties[constants.BUILD_PROPERTIES_BUILD_ARCH] = strings.ToUpper(targetPlatform.PlatformId) - if buildProperties[constants.BUILD_PROPERTIES_COMPILER_PATH] == constants.EMPTY_STRING { - targetPackage := context[constants.CTX_TARGET_PACKAGE].(*types.Package) - return utils.Errorf(context, constants.MSG_MISSING_COMPILER_PATH, targetPackage.PackageId, actualPlatform.PlatformId) - } - buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE] = context[constants.CTX_BUILD_CORE].(string) buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH] = filepath.Join(actualPlatform.Folder, constants.FOLDER_CORES, buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE]) buildProperties[constants.BUILD_PROPERTIES_BUILD_SYSTEM_PATH] = filepath.Join(actualPlatform.Folder, constants.FOLDER_SYSTEM) diff --git a/src/arduino.cc/builder/test/setup_build_properties_test.go b/src/arduino.cc/builder/test/setup_build_properties_test.go index 09879970..e85abd8b 100644 --- a/src/arduino.cc/builder/test/setup_build_properties_test.go +++ b/src/arduino.cc/builder/test/setup_build_properties_test.go @@ -32,7 +32,6 @@ package test import ( "arduino.cc/builder" "arduino.cc/builder/constants" - "arduino.cc/builder/i18n" "arduino.cc/builder/props" "arduino.cc/builder/types" "arduino.cc/builder/utils" @@ -148,42 +147,3 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) { 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"]) require.Equal(t, "non existent path with space and a =", buildProperties["tools.avrdude.config.path"]) } - -func TestSetupBuildPropertiesWithMissingCompilerPath(t *testing.T) { - DownloadCoresAndToolsAndLibraries(t) - - context := make(map[string]interface{}) - - buildPath := SetupBuildPath(t, context) - defer os.RemoveAll(buildPath) - - context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600" - context[constants.CTX_HARDWARE_FOLDERS] = []string{filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"} - context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools", "./tools_builtin"} - context[constants.CTX_FQBN] = "arduino:avr:uno" - context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch1", "sketch.ino") - context[constants.CTX_CUSTOM_BUILD_PROPERTIES] = []string{"name=fake name", "tools.avrdude.config.path=non existent path with space and a ="} - - commands := []types.Command{ - &builder.SetupHumanLoggerIfMissing{}, - &builder.AddAdditionalEntriesToContext{}, - &builder.HardwareLoader{}, - &builder.ToolsLoader{}, - &builder.TargetBoardResolver{}, - &builder.SketchLoader{}, - } - - for _, command := range commands { - err := command.Run(context) - NoError(t, err) - } - - targetPlatform := context[constants.CTX_TARGET_PLATFORM].(*types.Platform) - delete(targetPlatform.Properties, constants.BUILD_PROPERTIES_COMPILER_PATH) - - command := builder.SetupBuildProperties{} - err := command.Run(context) - require.Error(t, err) - - require.Equal(t, i18n.Format(constants.MSG_MISSING_COMPILER_PATH, "arduino", "avr"), err.Error()) -}