pine64 / ArduinoCore-bouffalo

BL602 Arduino Core for Arduino IDE
GNU Lesser General Public License v2.1
68 stars 13 forks source link

Wrong permissions for the downloaded toolchain #1

Open adrienluitot opened 3 years ago

adrienluitot commented 3 years ago

The binaries of the toolchain for Linux (riscv64-unknown-elf-linux-0.0.1.zip) have bad permissions and require some modifications from the user. They don't have the executable bit.

These binaries are located in:

Thanks to @9names for pointing me these paths.

As the purpose is, I think, to simplify things, it might be better to change the permissions in the downloaded archive.

I don't know if MacOS is also impacted, and I suppose that Windows isn't.

gamelaster commented 3 years ago

Will take look, thanks

pfeerick commented 3 years ago

I'll be looking into this this week, in https://github.com/pfeerick/ArduinoCore-bouffalo-packages/issues/1

I think the underlying issue is the choice of archive... a zip was used instead of a tar, which would preserve file permissions. Not a issue for windows, but it is for linux and mac.

adrienluitot commented 3 years ago

This could be good indeed, though if a zip file is needed, I think that if the archive is made on linux, it keeps the permissions.

pfeerick commented 3 years ago

Yes, whilst the zip format itself doesn't support file permissions, it seems with the right flags at time of zip, and of unzip, infozip will preserve them in another field... the question would then be does the IDE support that... only one sure fire way to find out!!!

On Mon, 8 Feb 2021, 5:51 pm Adrien Luitot, notifications@github.com wrote:

This could be good indeed, though if a zip file is needed, I think that if the archive is made on linux, it keeps the permissions.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pine64/ArduinoCore-bouffalo/issues/1#issuecomment-774946434, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ66KPEKMPD64NDPWZVVJLS56JXXANCNFSM4W5PQMVQ .

gamelaster commented 3 years ago

@pfeerick the reason why is everything hosted on PINE64 Cluster is because many times Github CDN is terribly slow and I wait ages until it downloads something. Anyway, I think we can have multiple "mirrors". I'm open to merge your work @pfeerick here.

adrienluitot commented 3 years ago

I've made some tests few days ago, and without special flags the permissions seemed to be kept after a zip and an unzip, but I don't know if there are default parameters on my distro. :shrug:

For the hosting, maybe the Pine64 cluster could regularly pull the files from the Github repo ? So we would have the speed of Pine64, and the last updates of Github.

pfeerick commented 3 years ago

@gamelaster I'm not complaining about the files being on the pine64 cluster, more that they are a black box at the moment, with no idea as to the source of the files, or how the packages were put together ;) For example, where do the toolchains come from? Because knowting that, the next question is, is it possible to get an arm64 toolchain happening as well? i.e. lets get a little pinebook pro love happening as well ;)

Hence why I'd ideally like to automate generation of the various packages via a github action if practical, and which also means the upload / generation of the files is all done on the github side, and then simply mirrored to the pine64 cluster if that's faster / more reliable at times. Plus it makes the builds reproducible. The packages repo I've got might just turn into a bunch of scripts, which generate a release, which all the binaries... don't quite know how it will play out just yet.

The other aspect to this is once I know enough about the full layout, I can look at getting a PlatformIO platform package going also...

danielbarry commented 3 years ago

Just to add that this problem still exists in Linux, it is needed to run:

cd ~/.arduino15/packages/bouffalo/tools/riscv64-unknown-elf/0.0.1/bin
chmod +x *
cd ~/.arduino15/packages/bouffalo/tools/riscv64-unknown-elf/0.0.1/libexec/gcc/riscv64-unknown-elf/8.3.0
chmod +x *
gamelaster commented 3 years ago

@pfeerick well, you made really good points, having a mirror is good. I will think about this.

MartijnBraam commented 2 years ago

Somehow still an issue