diff --git a/releasenotes.md b/releasenotes.md index 9f9596c98..0bd482767 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -31,6 +31,7 @@ - `@if` declarations were missing from -P output #1973. - Check exe and lib output so -o works with directories. - Swizzling an inline vector in a struct would cause a crash. +- Fixed error and poor error message when using an invalid target name. ### Stdlib changes diff --git a/src/build/libraries.c b/src/build/libraries.c index 4c5559bdc..41ca9291a 100644 --- a/src/build/libraries.c +++ b/src/build/libraries.c @@ -111,7 +111,7 @@ static Library *add_library(JSONObject *object, const char *dir) { char *res = strdup(provides); str_ellide_in_place(res, 32); - error_exit("Invalid 'provides' module name in %s, was '%s'.", library->dir, res); + error_exit("Invalid 'provides' module name in %s, was '%s', the name should only contain alphanumerical letters and '_'.", library->dir, res); } library->provides = provides; library->execs = get_optional_string_array(context, object, "exec"); diff --git a/src/build/project.c b/src/build/project.c index 59d97d2e1..ebe9d0e39 100644 --- a/src/build/project.c +++ b/src/build/project.c @@ -208,7 +208,7 @@ static void load_into_build_target(BuildParseContext context, JSONObject *json, { char *name_copy = strdup(name); str_ellide_in_place(name_copy, 32); - error_exit("Error reading %s: invalid library target '%s'.", filename, name_copy); + error_exit("Error reading %s: invalid library target name '%s' – it should only contain alphanumerical letters and '_'.", context.file, name_copy); } }