diff --git a/HISTORY.rst b/HISTORY.rst index 0c25869e..ceef275e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -11,6 +11,7 @@ PlatformIO Core 4.0 * Handle project configuration (monitor, test, and upload options) for PIO Remote commands (`issue #2591 `_) * Fixed an issue with the broken latest news for PIO Home +* Fixed an issue when ``env.BoardConfig()`` does not work for custom boards in extra scripts of libraries (`issue #3264 `_) 4.1.0 (2019-11-07) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index f910aaed..a7fbb8b9 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -44,7 +44,8 @@ def BoardConfig(env, board=None): try: board = board or env.get("BOARD") assert board, "BoardConfig: Board is not defined" - config = p.board_config(board) + with fs.cd(env.subst("$PROJECT_DIR")): + config = p.board_config(board) except (AssertionError, exception.UnknownBoard) as e: sys.stderr.write("Error: %s\n" % str(e)) env.Exit(1)