-
Notifications
You must be signed in to change notification settings - Fork 62
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
Feature Request: include package.json
#9
Comments
You can make your own PlatformIO compatible package using the |
I know the Platformio feature to do packages. With adding the package json there would be no need for. For the ESP32-C3 there is no official Platformio package. By adding the JSON the platformio registry is not littered with many user packages with same content. |
@Jason2866 oh it's kind of python's |
Yes probably, since platformio is written in Python. Looked a bit in code and found sys.platform and get_systype() for OS and variant |
@antmak It would help a lot if you add a Platformio compatible package.json. |
@Lapshin Just noticed the newest release still does not contain a package json :-( @me-no-dev @igrr By adding to the packages the could be used directly from platformio for testing as long the are not uploaded and provided via the Platformio Registry. Furthermore it would save work, since no repacking is necessary for the package upload process to Platformio registry. |
@Jason2866 , sorry, I haven't heard about Could you please provide some links to documentation that describes what |
@Lapshin Thx for reacting. The package.json is in the root of the package. {
"name": "toolchain-xtensa-esp32",
"version": "12.2.0+20230208",
"description": "GCC Toolchain for Espressif ESP32 Xtensa MCUs",
"keywords": [
"build tools",
"compiler",
"assembler",
"linker",
"preprocessor",
"espressif",
"esp32"
],
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/espressif/crosstool-NG"
},
"system": "linux_x86_64"
} Mandantory is the correct matching entry of "system" Code which parses the *.json An example to generate the |
@Jason2866 , please provide more info on the I'm asking because it is not in an expected host triplet format... |
@Jason2866 , if I understood correctly, you have to download all archives to extract and parse A question has just crossed my mind. It may not align with the platformio perspective, but I lack knowledge in this area. Wouldn't it be more efficient to parse all relevant information directly from https://github.com/espressif/esp-idf/blob/master/tools/tools.json? All the required information is available in one place. |
@Lapshin i've written a script a while ago to download and repack the toolchains for PIO use. Here is the code that determines what value if(str_contains($asset->name, "linux-arm64") || str_contains($asset->name, "aarch64-linux-gnu")){
$asset_data["system"] = "linux_aarch64";
} else if(str_contains($asset->name, "linux-armel") || str_contains($asset->name, "arm-linux-gnueabi")){
$asset_data["system"] = array("linux_armv6l", "linux_armv7l", "linux_armv8l");
} else if(str_contains($asset->name, "win32") || str_contains($asset->name, "i686-w64-mingw32")){
$asset_data["system"] = "windows_x86";
} else if(str_contains($asset->name, "win64") || str_contains($asset->name, "x86_64-w64-mingw32")){
$asset_data["system"] = "windows_amd64";
} else if(str_contains($asset->name, "macos")){
$asset_data["system"] = str_contains($asset->name, "arm64")?"darwin_arm64":"darwin_x86_64";//array("darwin_x86_64", "darwin_arm64");
} else if(str_contains($asset->name, "x86_64-apple-darwin")){
$asset_data["system"] = "darwin_x86_64";
} else if(str_contains($asset->name, "aarch64-apple-darwin")){
$asset_data["system"] = "darwin_arm64";
} else if(str_contains($asset->name, "linux-amd64") || str_contains($asset->name, "x86_64-linux-gn")){
$asset_data["system"] = "linux_x86_64";
} else if(str_contains($asset->name, "linux-i686") || str_contains($asset->name, "i686-linux-gnu")){
$asset_data["system"] = "linux_i686";
} |
@me-no-dev Thx for helping here :-)
That's not how Platformio works. If "stuff" is uploaded in Platformio Registry, Platformio provides the matching package for the Platform. The package.json is used locally when downloaded to verify that a package matches the requirements. If there is no package.json or it does not "fit" the package is withdrawn. In short, without a valid package.json included in a package it can not be installed. |
@Jason2866 Does it mean that And all PIO-specific stuff will live there and will be updated when format/scheme changes. |
@gerekon Yes, the package.json needs to be into the archive. I wouldn't have asked here to add if there is an other way. Since the package.json does not have strict reglementations about it contents, i see no problems if other IDE needs additional infos. |
Keeping info for multiple IDEs in one file will need some kind of coordination, at least we will have to place data for every IDE into separate structs (with own key name) to avoid keys names collisions. See below {
"PIO": {
# PIO data go here
},
"CLion": { # just for example
# CLion data go here
}
} Since PlatformIO does not support this structuring it makes no sense to go this way IMHO.
I am talking about supporting this in the script kept in separate repo which will handle all specifics of that platform and can be updated accordingly. There can be GH workflow jobs which will be triggered upon every Espressif toolchain release and produce archives for standalone usage with PlatformIO. So adding the 3rd version of the archives will make release a bit messy. |
I see no problem for Platformio for this structure {
"PIO": {
"name": "toolchain-xtensa-esp32",
"version": "12.2.0+20230208",
"description": "GCC Toolchain for Espressif ESP32 Xtensa MCUs",
"keywords": [
"build tools",
"compiler",
"assembler",
"linker",
"preprocessor",
"espressif",
"esp32"
],
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/espressif/crosstool-NG"
},
"system": "linux_x86_64"
},
"CLion": { # just for example
# CLion data go here
}
} Since Platformio is searching for the entrys. Duplication is what i want to avoid. Exactly this is actually needed when using the new toolchains. Copy them add the package.json and upload "somewhere"
A solution which is fine too. Imho not needed, because i think issues with conflicting entrys in package.json will not happen. EDIT: Would be very happy to see a solution, every way is fine. |
@Jason2866 , I wonder why you guys want to have Just run
I mean, package.json is useless from my point of view at all |
@Lapshin Dont ask me this, i am not a Platformio maintainer. It is done this way. No user choice to do different. I agree 100% Not happy how it is done. |
I think package.json makes sense at all. Platformio does not only install toolchains. All kind of tools, frameworks and what else is needed to get a Multi Embed Platform IDE running. |
If another IDE will use entries with the same name it will lead to problems. To tell the truth I am not fun of introducing dependency on 3rd party (higher level) tool into to the release archive. Looks like asking screwdriver's manufacturer to supply a special adapter for it to fit into custom toolbox :-). If I were PIO maintainer I'd provide such script for the developers who wants to use their IDE with not-registered tools. Ok. To avoid keeping separate repo I think we can add a job to GH which will produce archive for PIO with that file and users will be able to run it manually and download the results. So no need to keep a lot of archives. |
Sorry, but I don't fully understand the use case and motivation of having I just executed
From this point of view, I have the following questions:
If you want to use custom packages (not from the pio-registry), of course, it requires some extra action from the user. I don't see any advantage in providing a package.json for every toolchain distro because users must choose the correct one. All related info could be obtained from the toolchain filename (system architecture + toolchain version). With this context, I see a better solution to have a small python script to generate the right BTW, you also may ask Platformio guys to implement automatic Or to ask PlatformIO to support new esp toolchains after they released (1-2 times a year). |
@Lapshin Platformio does not upload new toolchains to the Platformio registry anymore. There is no afaik partnership contract anymore between espressif and Platformio. |
@Jason2866 I understand your concerns. We are not against this. Above I wrote my concerns about having |
@Jason2866 , please check the latest release. Is it good now or some changes are required? |
@Lapshin Thank you. It does work :-) |
for using the builded toolchain with PlatformIO a valid
package.json
is neccessary.The builded toolchains from earlephilhower for Arduino ESP8266 do already build and include this file
see esp-quick-toolchain commit
For ESP32 see espressif/arduino-esp32#4714 (comment)
The text was updated successfully, but these errors were encountered: