postgrest-docs
postgrest-docs copied to clipboard
Purported memory leak on alpine linux - still valid in 2021?
https://postgrest.org/en/stable/development.html?highlight=alpine#build-from-source
Do we know if this is still an issue? Is it referenced anywhere in another issue tracker?
I'd be happy to try building it myself on alpine and run any tests you'd like.
I'd be happy to try building it myself on alpine and run any tests you'd like.
@LAC-Tech That'd be great!
It's been a while since we tested on alpine(check https://github.com/PostgREST/postgrest/issues/867). If you don't detect any issue after some load testing, we'll be happy to remove that warning.
If this is about creating a small docker image in the end - note that our current nightly releases are all built as a single executable docker image. The next stable release will also be build like this. Chances are low that any alpine build could be smaller.
In any case, it'd be good to know!
I'm just an alpine user, not really looking to make a docker image. To me though it's generally a good sign if a build works on edge cases like OpenBSD, musl systems, etc.
Unfortunately I'm having real difficulty with "stack" which the docs recommend to build postgrest from source.
LAPTOP-162NUQO7:~/postgrest$ stack build --install-ghc --copy-bins --local-bin-path /usr/local/bin
No setup information found for ghc-8.8.4 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux64-ncurses6'.
Supported versions: ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2
So then I tried:
LAPTOP-162NUQO7:~/postgrest$ stack --compiler ghc-8.2.2 setup
Preparing to install GHC (ncurses6) to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-ncurses6-8.2.2.
utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist: exec: line 3: utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: not found
make[1]: *** [ghc.mk:991: install_packages] Error 127
make: *** [Makefile:51: install] Error 2
Received ExitFailure 2 when running
Raw command: /usr/bin/make install
Run from: /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/ghc-8.2.2/
Error: Error encountered while installing GHC with
make install
run in /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/ghc-8.2.2/
The following directories may now contain files, but won't be used by stack:
- /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/
- /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2/
For more information consider rerunning with --verbose flag
Installing GHC ...
LAPTOP-162NUQO7:~/postgrest$ make
make: *** No targets specified and no makefile found. Stop.
With verbose mode I eventually get this
2021-04-29 10:12:38.925949: [error] utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist: exec: line 3: utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: not found
2021-04-29 10:12:38.926389: [error] make[1]: *** [ghc.mk:991: install_packages] Error 127
2021-04-29 10:12:38.927826: [error] make: *** [Makefile:51: install] Error 2
2021-04-29 10:12:38.928280: [error] Received ExitFailure 2 when running
Raw command: /usr/bin/make install
Run from: /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/ghc-8.2.2/
2021-04-29 10:12:38.928571: [error]
Error: Error encountered while installing GHC with
make install
run in /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/ghc-8.2.2/
The following directories may now contain files, but won't be used by stack:
- /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2.temp/
- /home/lewis/.stack/programs/x86_64-linux/ghc-ncurses6-8.2.2/
For more information consider rerunning with --verbose flag
Installing GHC ...
Any tips would be appreciated - I feel like Stack is assuming some libraries I don't have, but I find it hard to grok.
utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: not found
Hm, seems it's looking for cabal
.
Could you try building with plain cabal
? Here's how I do it for ubuntu on ARM: https://github.com/steve-chavez/postgrest/blob/travis-arm/.travis.yml#L82-L108
Both https://postgrest.org/en/stable/install.html#building-from-source and https://github.com/PostgREST/postgrest/issues/867 don't provide proper evidence of a memory leak. Did you file a GHC ticket? Which GHC version? So far to me this seems anecdotal and no one can really figure out the cause.
So far to me this seems anecdotal and no one can really figure out the cause.
True, I've never reproduced that either.
How about if we just remove the Alpine warning?(still showing here https://postgrest.org/en/stable/install.html?highlight=%22Alpine%22#building-from-source)
(The need for a minimal image is already solved by Nix as mentioned above, but I don't see why we should discourage Alpine if users want it)