HashNuke / heroku-buildpack-elixir

Heroku Buildpack for Elixir with nitro boost
MIT License
810 stars 308 forks source link

GIT_DISCOVERY_ACROSS_FILESYSTEM not set #144

Open syui opened 5 years ago

syui commented 5 years ago

src : https://git.pleroma.social/pleroma/pleroma

remote:        * Stack heroku-18
remote:        * Erlang 21.2
remote:        * Elixir 1.7
$ cat elixir_buildpack.config
erlang_version=21.2
elixir_version=1.7
always_rebuild=false
runtime_path=/app

$ git push heroku master
remote: -----> Fetching app dependencies with mix
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

$GIT_DIR is empty, $git_dir_value is also empty.

There is no .git directory in $build_path.

lib/app_funcs.sh

# https://github.com/HashNuke/heroku-buildpack-elixir/blob/master/lib/app_funcs.sh#L71
function app_dependencies() {
  # Unset this var so that if the parent dir is a git repo, it isn't detected
  # And all git operations are performed on the respective repos
  local git_dir_value=$GIT_DIR
  unset GIT_DIR

  cd $build_path
  output_section "Fetching app dependencies with mix"
  mix deps.get --only $MIX_ENV || exit 1

  export GIT_DIR=$git_dir_value
  cd - > /dev/null
}
syui commented 5 years ago

It seems that the mix command is not working.

$ pwd
/tmp/build_xxxxxxxxxxxxx
$ which mix
/tmp/build_xxxxxxxxxxxxx/.platform_tools/elixir/bin/mix
$ mix deps.get --only $MIX_ENV || exit 1
fatal: not a git repository (or any of the parent directories): .git
syui commented 5 years ago

Can not execute mix on ${build_path} .

syui commented 5 years ago

It can be run with ${build_pack_path} .

HashNuke commented 5 years ago

@syui Is everything alright with your build now or are you still stuck with this issue?

syui commented 5 years ago

There is still the same problem.

Can not execute mix from $ {build_path}.

It moves when it does in this way.

https://github.com/syui/heroku-buildpack-elixir/blob/master/lib/app_funcs.sh

lvm commented 5 years ago

I tried using @syui fork and was able to sort this issue, a PR for this would be fantastic

syui commented 5 years ago

Certainly the problem can be solved, But I don't really know a lot about that.

HashNuke commented 5 years ago

If any of you can contribute a PR and test it out, I would be happy to merge it in.

lvm commented 5 years ago

I'd be glad but to be honest, I got this issue when trying to deploy Pleroma on Heroku (same as @syui) and then found @syui's fork. At best, I can only assert this fix worked for me.