tcdi / postgrestd

The most peculiar std you have ever seen
Other
37 stars 4 forks source link

Compile both `aarch64-postgres-linux-gnu` and `x86_64-postgres-linux-gnu` in `run` script #18

Closed thomcc closed 1 year ago

thomcc commented 1 year ago

This is probably not ideal -- For this to succeed, you need to set something like

# if on x86_64
CARGO_TARGET_AARCH64_POSTGRES_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
    ./run <cmd>

# if on aarch64
CARGO_TARGET_X86_64_POSTGRES_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
    ./run <cmd>

Because cargo can't link us for the non-host architecture (even if we used a linker capable of cross compilation it needs to know where the cross glibc is).

I'm going to make this a bit more automatic later on this weekend (so that it doesn't try to cross compile if it clearly won't work), but... it does get rather complex for a shell script. Would really love to do it in something better.

Do we care about users aside from plrust at all (aside from local testing)? Some of this would be easier to manage from inside there.

thomcc commented 1 year ago

Converted to draft becuase I'll be changing it a bit more.

workingjubilee commented 1 year ago

Do we care about users aside from plrust at all (aside from local testing)? Some of this would be easier to manage from inside there.

Essentially no.

thomcc commented 1 year ago

Converted to draft becuase I'll be changing it a bit more.

This will probably have to happen later.