Skip to content
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

pio test -c parameter is not working on esp8266 #4299

Closed
roipoussiere opened this issue Jun 1, 2022 · 5 comments
Closed

pio test -c parameter is not working on esp8266 #4299

roipoussiere opened this issue Jun 1, 2022 · 5 comments

Comments

@roipoussiere
Copy link

roipoussiere commented Jun 1, 2022

What kind of issue is this? PlatformIO Core

Configuration

Operating system: Ubuntu 21.10

PlatformIO Version: PlatformIO Core, version 6.0.1

Description of problem

The command pio test -c some_file.ini works for esp32 boards, but not on esp8266 boards.

Steps to Reproduce

  1. create a file named custom.ini and fill it with a esp32 config:
[env]
framework = arduino
platform = espressif32
board = esp32dev

[env:pins]
test_filter = test_pins
  1. build the test: pio test -c custom.ini --without-uploading --without-testing -v: the build works as expected.
  2. now edit the custom.ini file with a esp8266 config:
[env]
framework = arduino
platform = espressif8266
board = esp01

[env:pins]
test_filter = test_pins
  1. build the test: pio test -c custom.ini --without-uploading --without-testing -v: now the build fails with this error:

Actual Results

Processing test_pins in pins environment
-------------------------------------------------------------------------------------------------------------------------------
Building...
TypeError: expected str, bytes or os.PathLike object, not NoneType:
  File ".../.venv/lib/python3.9/site-packages/platformio/builder/main.py", line 184:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/roipoussiere/.platformio/platforms/espressif8266/builder/main.py", line 237:
    target_elf = env.BuildProgram()
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File ".../.venv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py", line 63:
    env.ProcessProgramDeps()
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File ".../.venv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py", line 126:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File ".../.venv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py", line 341:
    SConscript(env.GetFrameworkScript(name), exports="env")
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/roipoussiere/.platformio/platforms/espressif8266/builder/frameworks/arduino.py", line 31:
    SConscript(
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/roipoussiere/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/roipoussiere/.platformio/packages/framework-arduinoespressif8266/tools/platformio-build.py", line 132:
    join(platform.get_package_dir("toolchain-xtensa"), "include")
  File "/usr/lib/python3.9/posixpath.py", line 76:
    a = os.fspath(a)
Building stage has failed, see errors above. Use `pio test -vvv` option to enable verbose output.

Expected Results

The test command should be functional whatever the target board.

If problems with PlatformIO Build System:

The content of platformio.ini: see above

Source file to reproduce issue:

It seems that the source file doesn't matter, but here is a minimal test file:

#include <unity.h>

void test_pass() {
	TEST_PASS();
}

void setup() {
	delay(2000); // wait until the test runner establishes serial connection
	UNITY_BEGIN();
	RUN_TEST(test_pass);
	UNITY_END();
}

void loop() {}
void setUp() {}
void tearDown() {}
@ivankravets
Copy link
Member

ivankravets commented Jun 1, 2022

PACKAGES:

  • tool-esptool @ 1.413.0 (4.13)
  • tool-esptoolpy @ 1.30000.201119 (3.0.0)

Can't reproduce this issue. You have posted absolutely different custom.ini.

@roipoussiere
Copy link
Author

roipoussiere commented Jun 2, 2022

Can't reproduce this issue. You have posted absolutely different custom.ini.

I don't understand your message and the reason of the wontfix, could you add more details?

I checked my .ini files, their contents match what I shared above.

Should I add more details to allow you to reproduce the issue?
Do you think it's something related to esptool?

I also reproduced this on a fresh python venv, with only platformio installed.

@roipoussiere
Copy link
Author

roipoussiere commented Jun 2, 2022

Ok, those lines on the stacktrace I shared:

CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp01.html
PLATFORM: Espressif 8266 (4.0.0) > Espressif Generic ESP8266 ESP-01 512k
HARDWARE: ESP8266 80MHz, 80KB RAM, 512KB Flash
PACKAGES: 
 - tool-esptool @ 1.413.0 (4.13) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0)

are indeed not present when I reproduce the error with the .ini I shared, I edited my first post.

@mcspr
Copy link
Contributor

mcspr commented Jun 2, 2022

Could also reproduce this. When custom.ini is named platformio.ini, everything works. When doing -c custom.ini, it fails with the error above on this line:
https://github.com/esp8266/Arduino/blob/f5ef02d6431626f67b0a6b960479ee37e87af20b/tools/platformio-build.py#L138

platform.get_package_dir("toolchain-xtensa") returns None instead of the correct path to the packages dir.

@ivankravets ivankravets reopened this Jun 2, 2022
@ivankravets ivankravets added this to the 6.0.3 milestone Jun 2, 2022
@ivankravets
Copy link
Member

Thanks! This is a bug. Please re-test with pio upgrade --dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants