erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

Stray file Makefile.am in rebar3 release #368

Open leoliu opened 5 years ago

leoliu commented 5 years ago

I now use Yaws as a rebar3 dep and after building a release the yaws-2.0.6 directory looks like this:

├── ebin
├── include
└── priv

all these subdirectories have a file Makefile.am which is unusual.

The issue can be reproduced with branch master or rebar3-support.

vinoski commented 5 years ago

Running rebar3 release doesn't work for me — I assume because of the lack of a relx section in rebar.config — but running rebar3 compile partly duplicates this problem, as after it finishes I see a couple Makefile.am files under the _build directory. I don't see any way to avoid having rebar3 copy those files, but a post hook like the one below added to rebar.config can remove them:

{post_hooks, [{"(linux|solaris|freebsd|darwin)", compile,
               "find $REBAR_BUILD_DIR -name Makefile.am -exec rm -f {} \\;"}]}.
leoliu commented 5 years ago

I just noticed these files are in the repo i.e. version-controlled. So maybe ignore this issue for now. It's harmless anyway.

vinoski commented 5 years ago

Fair enough, but for now I've pushed a commit to run find over the build area after compilation as mentioned earlier in this issue.

leoliu commented 5 years ago

That could work. But...

is it safe to run it inside _build? It will make uncommitted/untracked changes to deps. Ideally it should only be run inside the rel directory or, even better, yaws-VERSION directory in the rel directory.

vinoski commented 5 years ago

I convinced myself a bit ago that the find addition wasn't really helpful, so I just pushed another change to remove it.