hie-bios icon indicating copy to clipboard operation
hie-bios copied to clipboard

Add support for bios multi-cradles

Open iteratee opened this issue 1 year ago • 1 comments

We currently don't have a way to ask a bios cradle if it supports multiple components. So we just trust that if the GHC version is new enough and multiple component loading is requested, that the bios program supports it.

iteratee avatar Jul 02 '24 20:07 iteratee

Hi, thank you for your PR!

I am worried that passing multiple filepaths to the bios command might break existing bios scripts, since they may assume it contains only exactly one filepath. We could pass in the extra filepaths in a separate environment variable HIE_BIOS_EXTRA_ARGS , then bios scripts cannot break accidentally. What do you think?

fendor avatar Jul 03 '24 08:07 fendor

Hi, thank you for your PR!

I am worried that passing multiple filepaths to the bios command might break existing bios scripts, since they may assume it contains only exactly one filepath. We could pass in the extra filepaths in a separate environment variable HIE_BIOS_EXTRA_ARGS , then bios scripts cannot break accidentally. What do you think?

I'm very sorry that I forgot about this.

I've been using my own patched version of hie-bios since I posted this last year.

I went with HIE_BIOS_MULTI_ARG

The files are separated by '\x1f', the record separator character. Null won't work because environment variables are null terminated. It's possible to put a record separator in a file name, but I can accept that limitation.

Let me know what you think.

Kyle.

iteratee avatar May 17 '25 00:05 iteratee

The files are separated by '\x1f', the record separator character. Null won't work because environment variables are null terminated. It's possible to put a record separator in a file name, but I can accept that limitation.

What we usually do is to generate a temporary file, pass this file as the value of the environment variable, and write the filepaths to this temporary file instead of the environment variable directly. It should be reasonably simple to do that, I think and should even lift the last restriction, right?

fendor avatar May 19 '25 16:05 fendor

The files are separated by '\x1f', the record separator character. Null won't work because environment variables are null terminated. It's possible to put a record separator in a file name, but I can accept that limitation.

What we usually do is to generate a temporary file, pass this file as the value of the environment variable, and write the filepaths to this temporary file instead of the environment variable directly. It should be reasonably simple to do that, I think and should even lift the last restriction, right?

Yes, that should be reasonably simple, and then we can null separate the files. I'll see what I can do.

iteratee avatar May 19 '25 17:05 iteratee

I got that working, and pushed up the result if you want to take a look.

iteratee avatar May 20 '25 01:05 iteratee