Issue
I need to know the locations of development header files during the build so that my application dependencies can build against them.
Resolution
The stack images differ between build and runtime on Heroku. For inspecting paths on a dyno heroku run bash
will only cover things that are available as part of the runtime stack image.
To see which files are available during the build, you use one of the Docker images that we publish. For example to locate the MagickWand.h
header file that comes with the libmagickwand-dev
package on the heroku-22
stack:
$ docker run -it heroku/heroku:22-build bash
Unable to find image 'heroku/heroku:22-build' locally
22-build: Pulling from heroku/heroku
8ee29e426c26: Pull complete
6e83b260b73b: Pull complete
e26b65fd1143: Pull complete
40dca07f8222: Pull complete
b420ae9e10b3: Pull complete
da73fdbc63c8: Pull complete
06627042f798: Pull complete
91591ee9e53a: Pull complete
16bb228b9f74: Pull complete
Digest: sha256:b83a968b6f1cef62022cbb73c143317fff91a6d28dd7b3463076d403215ef17d
Status: Downloaded newer image for heroku/heroku:22-build
root@23b2401cadce:/# find / -iname MagickWand.h
/usr/include/ImageMagick-6/wand/MagickWand.h
root@23b2401cadce:/#
This will download and run the Docker image in a single command and then open a bash session in a copy of the build environment. The path in question here is /usr/include/ImageMagick-6/wand/MagickWand.h
.
For the heroku-20
stack you can replace 22
with 20
in the commands above. You can check your current stack by running
heroku stacks -a your_app_name_here