Revert "Run library extra script only at a build process" (breaks mbed framework) // Issue #3915

This commit is contained in:
Ivan Kravets
2022-02-11 17:00:33 +02:00
parent 526abc6a9f
commit 83fe00a0cf
3 changed files with 12 additions and 14 deletions

View File

@ -12,7 +12,6 @@ PlatformIO Core 5
~~~~~~~~~~~~~~~~~~
- Run command from a PlatformIO package with a new `pio exec <https://docs.platformio.org/en/latest/core/userguide/cmd_exec.html>`__ (`issue #4163 <https://github.com/platformio/platformio-core/issues/4163>`_)
- Run library extra script only at a build process (`issue #3915 <https://github.com/platformio/platformio-core/issues/3915>`_)
- Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 <https://github.com/platformio/platformio-core/issues/3865>`_)
5.2.5 (2022-02-10)

2
docs

Submodule docs updated: 36a1264de4...d4f5db0882

View File

@ -285,8 +285,15 @@ class LibBuilderBase(object):
return {}
def process_extra_options(self):
self.env.ProcessFlags(self.build_flags)
self.env.ProcessUnFlags(self.build_unflags)
with fs.cd(self.path):
self.env.ProcessFlags(self.build_flags)
if self.extra_script:
self.env.SConscriptChdir(1)
self.env.SConscript(
os.path.abspath(self.extra_script),
exports={"env": self.env, "pio_lib_builder": self},
)
self.env.ProcessUnFlags(self.build_unflags)
def process_dependencies(self):
if not self.dependencies:
@ -440,15 +447,7 @@ class LibBuilderBase(object):
for lb, lb_search_files in lib_inc_map.items():
self.depend_recursive(lb, lb_search_files)
def build(self): # pylint: disable=too-many-branches
if self.extra_script and not self._is_built:
with fs.cd(self.path):
self.env.SConscriptChdir(1)
self.env.SConscript(
os.path.abspath(self.extra_script),
exports={"env": self.env, "pio_lib_builder": self},
)
def build(self):
libs = []
for lb in self._depbuilders:
libs.extend(lb.build())
@ -461,8 +460,8 @@ class LibBuilderBase(object):
if self._is_built:
return libs
self._is_built = True
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
if self.lib_ldf_mode == "off":