-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Locale issue with includes finder #243
Comments
IIRC |
Yeah, around here: https://github.com/arduino/arduino-builder/blob/master/src/arduino.cc/builder/includes_finder_with_regexp.go#L47-L52 But it seems like this should "Just Work" because it tries to match the regex first. I tried the following test to make sure I'm not crazy: main.go:
So why would this result not be used if the regex should clearly work? =( I would think the locale should really be a non-issue if we can successfully parse it out of the source. Of course, |
I was actually thinking about the
But your debug output suggests that the regular regex already matches, so the old compiler fallback is not needed. Perhaps you can add some more debug output to see what is failing exactly? I tried to reproduce this by setting LANG=nl_NL.UTF-8 (I don't have the de locale installed) and then running arduino, but then it does not seem to fail for me. |
Surrounding
and
looks good to me. This would avoid any problem during that phase while allowing translated gcc output for whoever likes it 🙂 |
What you propose will probably work, but it might be more elegant to not touch the current environment, but only change the environment for the command being run. I think this can be done using Cmd.Env: https://golang.org/pkg/os/exec/#Cmd Since that does not seem to override single values from the env, but replaces all of the env, this would involve fetching the current environment, changing LANG and setting that into Cmd.Env. Since The Cmd instance is buried inside the builder_utils and utils, that would also involve some extra value-passing to get the data in the right place. Applying that change probably touches on the same cod as #236, so it might be useful to merge that one first. |
Hello!
arduino-builder is failing to find includes and pull in used libraries with some at least some locales. This script demonstrates the problem for me:
I've copied /usr/local/arduino/examples/01.Basics/BareMinimum to my working directory for this purpose and added
#include <SPI.h>
to the top of it, a la:Executing my script then yields the following output:
Setting my locale to en_US.UTF-8 makes it all happy again. I assumed it was falling back to
findIncludeForOldCompilers
, but I've no idea why it would -- I extractedINCLUDE_REGEXP
and the matching bits to its own golang application and it matched just fine in isolation.I've only tested this on FreeBSD systems, but all of the relevant tests pass here so I assume it's reproducible elsewhere, too.
The text was updated successfully, but these errors were encountered: