Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Cannot test compile step using gcc on new stack heroku-16 #15

Open
danstiner opened this issue Jul 19, 2017 · 7 comments
Open

Cannot test compile step using gcc on new stack heroku-16 #15

danstiner opened this issue Jul 19, 2017 · 7 comments

Comments

@danstiner
Copy link

The new heroku-16 stack actually has a different set of packages installed at buildtime vs runtime. Things like gcc are missing at runtime when this buildpack goes to run tests, so a pack that actually does compilation in compile can fail when run in this test harness even if it may work fine when used as an actual buildpack.

Example error message from heroku run tests with a buildpack that compiles C code.

configure: error: no acceptable C compiler found in $PATH

The only fix I can think of is to run tests in the compile step, but that has downsides.

@jkutner
Copy link
Contributor

jkutner commented Jul 20, 2017

I can only recommend two suboptimal solutions:

  1. Run the testrunner buildpack in Docker (see README) with the required packages.
  2. Install the packages you need (such as gcc) on your test app using the heroku-buildpack-apt buildpack.

Let us know if either of these works for you.

@danstiner
Copy link
Author

danstiner commented Jul 21, 2017

Thanks for the quick reply. For my use case, running scripts manually on my local machine was sufficient. I partly opened this for awareness in case others hit this error.

Agreed there is not straightforward solution. Looks like the Docker approach will work because it is still based on cedar-14, if it gets updated to herkou-16 I would expect it to also break. The apt buildpack is a good idea, I'd be happy to try it if it would be useful feedback. Otherwise feel free to close, this issue will at provide some workarounds if anyone else hits the problem and searches for a solution.

@cbertozzi
Copy link

I also tryed the apt buildpack solution installing build-essential package, but at runtime when i try to execute gcc, system tells me that gcc: Command not found

maybe some security restrictions?
any clues?

@jkutner
Copy link
Contributor

jkutner commented Nov 15, 2017

@cbertozzi can you check that gcc is on the path? maybe with heroku run bash?

@cbertozzi
Copy link

cbertozzi commented Nov 15, 2017 via email

@cbertozzi
Copy link

cbertozzi commented Nov 23, 2017

after a debug session with Heroku guys we found a working solution.
First we need to manually install all dependencies found in build-essential, using heroku-buildpack-apt buildpack, and defining Aptfile in the follow way:

build-essential
binutils
cpp-5
libc6
libcc1-0
libgcc-5-dev
libgcc1
libstdc++6
zlib1g
gcc
gcc-5
gcc-5-base
libmpfr4
libmpfr-dev
libmpc3
libgmp3-dev
libgmp10
libgmp-dev
libmpc-dev
flex
bison
libisl15
libisl-dev
make

and then append --sysroot=/app/.apt to every gcc invocation to let compiler search for libraries in the right place.

@tt
Copy link
Member

tt commented Nov 23, 2017

Looks like the Docker approach will work because it is still based on cedar-14, if it gets updated to herkou-16 I would expect it to also break.

We publish two variants of the Heroku-16 image:

  • heroku/heroku:16
  • heroku/heroku:16-build

The latter is what our build environment uses.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants