up icon indicating copy to clipboard operation
up copied to clipboard

GLIBC_2.32 not found / CGO_ENABLED=0

Open kaihendry opened this issue 4 years ago • 4 comments

Prerequisites

  • [X] I am running the latest version. (up upgrade)
  • [X] I searched to see if the issue already exists.
  • [X] I inspected the verbose debug output with the -v, --verbose flag.
  • [X] Are you an Up Pro subscriber?

Description

On Arch glibc is not compatible with AWS's. So the workaround is to use CGO_ENABLED=0

However CGO_ENABLED=0 often means poor support with sqlite drivers or example. CGO_ENABLED=0 versions of sqlite drivers exist but they are significantly slower for example.

Perhaps it's having some sort of cross compile option as suggest here https://twitter.com/benbjohnson/status/1370955506471165956 ?

Steps to Reproduce

Try deploy https://github.com/kaihendry/dfts

kaihendry avatar Mar 14 '21 05:03 kaihendry

Hmm I'm not sure I'd want a dependency on Docker, it could get really complicated quick. I think that sort of thing is probably best left to CI like GH Actions where you're building in the target environment already, but something to think about for sure

tj avatar Mar 14 '21 11:03 tj

I'm told this what I need to do: https://gist.github.com/egonelbre/01bbf7ca97d6b5588438da36a2578e7b

I do really want a smooth way to deploy locally without CI.

kaihendry avatar Mar 14 '21 14:03 kaihendry

I have no previous experience with apex/up, but as far as I'm able to deduce it seems that hooks.build is a way to override with arbitrary build command? So it should be possible to pretty much use the same invocation -- maybe modify it to output "server" as the binary. Although, I'm not sure in which computer/server context will run.

The only concern is invoking subcommands such as $(pwd) and $(go env GOPATH) within the command. Maybe it can invoke a separate script? Based on https://github.com/apex/up/blob/9770c5062e3a39563d183f84ce51cec52bf683ec/up.go#L67, I'm guessing it will work?

egonelbre avatar Mar 14 '21 15:03 egonelbre

@egonelbre yep it runs as a shell command, so you should be fine to use stuff like that

@kaihendry yeah I definitely hear you, but the number of variables explodes once you start introducing platform specifics. Using Docker manually locally and putting Up inside would more or less have the same UX as Up trying to use Docker, so I'm not sure there would be much of a benefit, since Up would have to support all the various OSes and shared libraries etc

tj avatar Mar 15 '21 15:03 tj