question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Core 5.0.x can't handle platform-packages directive

See original GitHub issue

Configuration

Operating system: Windows 10 64bit

PlatformIO Version (platformio --version): 5.0.1.

Description of problem

Platformio mishandles platform-packages directive

Steps to Reproduce

  1. Create a new project with platformio.ini as follows:
[env:adafruit_feather_nrf52840]
platform = nordicnrf52
board = adafruit_feather_nrf52840
framework = arduino
monitor_speed = 115200
;platform_packages = framework-arduinoadafruitnrf52 @ https://github.com/orrmany/Adafruit_nRF52_Arduino.git#develop-ant-plus-ble
  1. Add src/main.cpp with boiler plate blinky example:
#include <Arduino.h>
void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  // wait for a second
  delay(100);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(100);
}
  1. build your project. Observe that Platformio downloads and install the nRF55 platform with its toolchain, then it builds the project succesfully

  2. Edit your platformio.ini. Remove the leading semicolon from the front of the line: platform_packages = framework-arduinoadafruitnrf52 @ https://github.com/orrmany/Adafruit_nRF52_Arduino.git#develop-ant-plus-ble

  3. attempt to build

Actual Results

The build fails, the build script asserts (due to faulty download of wrong platform packages), like this:

AssertionError: :
  File "C:\Users\egbozie\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 169:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\egbozie\.platformio\platforms\nordicnrf52\builder\main.py", line 194:
    target_elf = env.BuildProgram()
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\egbozie\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 61:
    env.ProcessProgramDeps()
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\egbozie\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 127:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\egbozie\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 342:
    SConscript(env.GetFrameworkScript(f), exports="env")
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 661:
    return method(*args, **kw)
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\egbozie\.platformio\platforms\nordicnrf52\builder\frameworks\arduino.py", line 29:
    env.SConscript("arduino/adafruit.py")
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\egbozie\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\egbozie\.platformio\platforms\nordicnrf52\builder\frameworks\arduino\adafruit.py", line 38:
    assert isdir(CORE_DIR)

Expected Results

It should build normally using the nRF52 platform fork https://github.com/orrmany/Adafruit_nRF52_Arduino.git#develop-ant-plus-ble

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:adafruit_feather_nrf52840]
platform = nordicnrf52
board = adafruit_feather_nrf52840
framework = arduino
monitor_speed = 115200
;platform_packages = framework-arduinoadafruitnrf52 @ https://github.com/orrmany/Adafruit_nRF52_Arduino.git#develop-ant-plus-ble

Source file to reproduce issue:

#include <Arduino.h>
void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  // wait for a second
  delay(100);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(100);
}

Additional info

Obviously, PlatformIO downloads some bogus “midi-test” v. 1.0.0. package instead of the nRF52 platform fork above

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:44 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
ivankravetscommented, Nov 10, 2020

@orrmany Very good question! So, found the root why do you need to work official package. Could check these docs https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#override-package-files ?

If it is not clear, we would be happy to improve.

So, the goal is that you will not worry about the framework package. You will just patch it to your needs. This will help you to be up-to-date with the latest framework and apply your changes.

1reaction
ivankravetscommented, Nov 10, 2020

We don’t have forks because we don’t modify official software. The only what we do - we put package.json and fill manifest with metadata. Some packages are mirrored on Bintray. We plan to release our new front-end to the new registry soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Target frameworks in SDK-style projects - .NET | Microsoft Learn
Learn about target frameworks for .NET apps and libraries.
Read more >
DIRECTIVE Packages & Articles Sent or Brought to Facilities I ...
I. DESCRIPTION: This Directive establishes the policy of the Department concerning packages and articles sent or brought to facilities and ...
Read more >
Multi-targetting .Net Framework and .Net Core in a single project
A 15-second guide and 15-minute walk through. You have a .Net Core project, whether a netstandard library, or a netcore app, and you'd...
Read more >
Working with IWebHostEnvironment and IHostingEnvironment ...
NET Core 2.x and 3.x. I have a not insignificant number of library projects/packages both public and internal and every single one of...
Read more >
core - Apache HTTP Server Version 2.4
x and later. This directive has been disabled. For backwards compatibility of configuration files, it may be specified with the value none ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found