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

Custom platform packages per build environment #1367

Closed
ivankravets opened this issue Feb 15, 2018 · 9 comments

Comments

3 participants
@ivankravets
Copy link
Member

commented Feb 15, 2018

Would be good to have an option which will allow overriding built-in dev/platform packages or providing a new one. Proposition is to add platform_packages option to platformio.ini. For example,

[env:myenv]
platform = ...
framework = ...
board = ...
platform_packages =
  pkg_with_spec_version@<4.5
  git_pkg@http://github.com/...

Later, custom packages could be used in pair with http://docs.platformio.org/en/latest/projectconf/advanced_scripting.html

@boneskull

This comment has been minimized.

Copy link

commented Feb 15, 2018

Ivan, if I was going to implement, where would I start?

@boneskull

This comment has been minimized.

Copy link

commented Feb 15, 2018

Insofar as "custom tooling", I'm seeing the Custom Uploader docs, but they don't make a distinction between "uploading firmware" and "uploading something else". In other words, pio run -t upload vs. pio run -t uploadfs.

In my original post, the tool mentioned is for uploading a filesystem. It's also worth mentioning that I need two separate tools to upload two separate filesystems.

@ivankravets

This comment has been minimized.

Copy link
Member Author

commented Feb 17, 2018

@alexwhittemore

This comment has been minimized.

Copy link

commented Mar 19, 2019

Is it safe to bet based on the lack of documentation that no such functionality has made it to the point of release yet? For example, I'm trying to add support for a custom SAMD board, using the Arduino framework. As far as I can tell, I'll have to fork platformio-pkg-framework-arduinosam and add a custom arduino "variant" for my board specifics, then also fork platform-atmelsam and add a "board.json" describing the board to PlatformIO. Then in platformio.ini I can add the repository URL of the custom platform.

Is all of that still necessary, as of now?

@ivankravets

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2019

@alexwhittemore you can put "variant" folder to ~/.platformio/packages/framework-atmelsam

As for the "board.json", please create "boards" folder in a project and put your "board.json" here.

@alexwhittemore

This comment has been minimized.

Copy link

commented Mar 20, 2019

If I do that, however, it'll get clobbered by mainline package updates, no? And even if the update mechanism doesn't clear out untracked changes, that method seems like it's got low portability for replicating environments across multiple developers. That vs, say, having a "packages/framework-atmelsam/..." directory inside the project that gets considered, but tracked under the project's git repo.

Maybe there's not a super duper clean way to accomplish this and that's why it's not included yet. But if board.json can be covered by existing mechanisms, maybe doing something similar for the framework side is reasonable. And either way, I'd LOVE to see official documentation on the best way to accomplish this as of the current most recent release, since it's pretty opaque as-is.

@ivankravets ivankravets added this to To do in PlatformIO 4.0 Mar 23, 2019

@ivankravets

This comment has been minimized.

Copy link
Member Author

commented Mar 23, 2019

@alexwhittemore do you have any ideas on how to better resolve this issue?

@alexwhittemore

This comment has been minimized.

Copy link

commented Mar 23, 2019

Not exactly, no, but I do have ideas for documentation.

My perfect situation would be to add a ‘boards/myboard.json’ and a ‘variants/myvariant’ dir, but there are a bunch of reasons that it’d be a bad hack at best. How would PIO know which framework it was for? Is the directory structure the same for frameworks besides Arduino? Etc.

I think the “correct” solution is to add documentation about how to do just this, for example, for the Arduino framework. For instance, searching for “add a board” led me on a long journey to finally figure out that, for example, “framework version” can be a full url to a git repo.

I’m happy to have a go at writing that up if there’s some kind of infrastructure for documentation PRs? It’ll probably require a bit of post processing given I’m far from a PIO expert.

@ivankravets ivankravets moved this from To do to In progress in PlatformIO 4.0 May 29, 2019

@ivankravets ivankravets moved this from In progress to To do in PlatformIO 4.0 May 29, 2019

@ivankravets ivankravets moved this from To do to In progress in PlatformIO 4.0 May 30, 2019

@ivankravets ivankravets moved this from In progress to To do in PlatformIO 4.0 May 30, 2019

@ivankravets ivankravets moved this from To do to In progress in PlatformIO 4.0 Jun 7, 2019

PlatformIO 4.0 automation moved this from In progress to Done Jun 7, 2019

@ivankravets

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.