arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Use something (anything but bash) for bash json parsing

Open chcosta opened this issue 6 years ago • 5 comments

We have places in Arcade where we have to parse Json before an sdk is acquired. Powershell makes this easy on Windows. On Bash, the parsing is fragile and error prone. We should consider adopting a dependency on a more robust parsing tool in Arcade.

Something like jq

From https://github.com/chcosta/arcade/commit/737e29378f2a8596f6ceec1f378beea2a7b0ba0b#r33161980

chcosta avatar Apr 12 '19 20:04 chcosta

We could probably use python for json parsing we need. All helix machines are guaranteed to have it because helix requires it, and most linuxes have it. I don't think the same is true of jq.

alexperovich avatar Apr 12 '19 20:04 alexperovich

All helix machines are guaranteed to have it because helix requires it, and most linuxes have it.

The fact that it is on helix machines is irrelevant. We would need to make this work for all OSS contributors on all platforms that CoreCLR supports and actually more. I don't think reading a version from a text file warrants making it more difficult to port CoreCLR on a new platform.

tmat avatar Apr 12 '19 20:04 tmat

Porting coreclr to a new platform will require python, because all the builds run through helix. Even worse really, the azure devops agent is written in C# and runs on .NET Core, so a new platform would require a complex bootstrapping thing or cross-compilation.

Every linux operating system we have brought up for helix has had python. They didn't all agree on the version, but JSON parsing is easy to do in a version tolerant way. I haven't seen jq on any linuxes I have worked on, it always required an install.

alexperovich avatar Apr 12 '19 21:04 alexperovich

Porting coreclr to a new platform will require python, because all the builds run through helix.

Well, yes, eventually it will. But not when you're starting and want just to run build locally.

I'm fine with Python if we have solid data on its availability without installation on all Linux distros we support. I'd still prefer not to have the dependency at all though.

tmat avatar Apr 12 '19 21:04 tmat

Moving out beyond P7

markwilkie avatar May 09 '19 20:05 markwilkie