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

toolchain-atmelavr source code and build scripts? #324

Open
mid-kid opened this issue Nov 30, 2023 · 12 comments
Open

toolchain-atmelavr source code and build scripts? #324

mid-kid opened this issue Nov 30, 2023 · 12 comments

Comments

@mid-kid
Copy link

mid-kid commented Nov 30, 2023

Hi, I'm trying to figure out a few details about the toolchain-atmelavr package:

  • Which specific version of the code is used? Is it patched?
  • How is it built? With what kind of options?
  • Where are the current binaries obtained from, if anywhere?
@valeros
Copy link
Member

valeros commented Dec 1, 2023

Hi @mid-kid,

Where are the current binaries obtained from, if anywhere?

We use binaries provided by the Arduino IDE, for example: https://github.com/arduino/Arduino/blob/master/hardware/package_index_bundled.json#L74-L116

How is it built? With what kind of options?

You can find the used option if you run avr-gcc -v, for example:

Target: avr
Configured with: ../gcc/configure --enable-fixed-point --enable-languages=c,c++ --prefix=/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir --disable-nls --disable-libssp --disable-libada --disable-shared --with-avrlibc=yes --with-dwarf2 --disable-doc --target=avr --host=i686-w64-mingw32

Which specific version of the code is used? Is it patched?

It's GCC 7.3.0 with some additional patches, you can find sources here https://github.com/arduino/toolchain-avr

@mid-kid
Copy link
Author

mid-kid commented Dec 4, 2023

Thanks! That answers most of my Qs.

Is that the json file being used as a definition, or are the package definitions for platformio hosted elsewhere?

@valeros
Copy link
Member

valeros commented Dec 4, 2023

Package definitions are specified in this file https://github.com/platformio/platform-atmelavr/blob/develop/platform.json, the packages are hosted on the PlatformIO Package Registry and delivered through our CDN network.

@mid-kid
Copy link
Author

mid-kid commented Dec 5, 2023

I see the toolchain-atmelavr entry in there but nothing that'd tell it where to download it from or checksum information so I'm a bit confused.

@ivankravets
Copy link
Member

PlatformIO Core handles all these things automatically. When you build a project for the first time, PlatformIO Core pulls dependencies from the PlatformIO Registry and validates checksum for each downloaded package. See https://github.com/platformio/platformio-core/blob/develop/platformio/package/download.py#L122

@mid-kid
Copy link
Author

mid-kid commented Dec 9, 2023

Yeah, I'm just trying to understand the "repository" structure and how it decides to download what from where. Mostly out of personal interest, but also because I'm wary of package managers downloading random binaries from the internet.
Thanks for all the answers thus far.

@ivankravets
Copy link
Member

PlatformIO Core is an OSS project. You learn more about PlatformIO Package Manager from its sources https://github.com/platformio/platformio-core/tree/develop/platformio/package/manager

The core logic is based on get_systype(). Having information about host architecture, PlatormIO Core goes to the PlatformIO Registry and looks for the best package corresponding to the https://semver.org/

@mid-kid
Copy link
Author

mid-kid commented Dec 10, 2023

I see, it's querying https://api.registry.platformio.org/v3/packages/platformio/tool/toolchain-atmelavr for all the information, including download URL (from dl.registry.platformio.org) and checksum.

Is the data obtained from api.registry.platformio.org hosted in a git somewhere, or is it entered into a live database? Is the backend published anywhere?

@thirstyice
Copy link

Hi, I'm also having trouble understanding how this works.
Where is the source for the toolchain-atmelavr package? I haven't been able to find it anywhere, even though the license is listed as GPL-2.0-or-later

@valeros
Copy link
Member

valeros commented May 14, 2024

@thirstyice

Where is the source for the toolchain-atmelavr package? I haven't been able to find it anywhere, even though the license is listed as GPL-2.0-or-later

It's generic GCC 7.3.0 with some additional patches, you can find sources here https://github.com/arduino/toolchain-avr

@thirstyice
Copy link

How are they packaged for platformio?

@valeros
Copy link
Member

valeros commented May 15, 2024

How are they packaged for platformio?

We use compiled packages provided by Arduino IDE from their manifest.

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

No branches or pull requests

4 participants