basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Erlang 20 compilation 'export all' failure #241

Closed senturk closed 2 years ago

senturk commented 6 years ago

There are several ‘export all’ compile calls, but cuttlefish_unit.erl somehow crashes while compilation.

bowlofeggs commented 6 years ago

This does appear to get the package to build, but the tests still fail:

/usr/bin/rebar eunit skip_deps=true                                                                                                   
==> cuttlefish-2.0.11 (eunit)
Compiled src/cuttlefish_vmargs.erl
src/conf_parse.erl:65: export_all flag enabled - all functions will be exported
Compiling src/conf_parse.erl failed:
ERROR: eunit failed while processing /home/bowlofeggs/fedora-scm/erlang-cuttlefish/cuttlefish-2.0.11: rebar_abort
bowlofeggs commented 6 years ago

Just one more line will fix it:

From 8e1a84171ad18b98742d68dbf50170fc773e1c6d Mon Sep 17 00:00:00 2001
From: Randy Barlow <randy@electronsweatshop.com>
Date: Wed, 13 Jun 2018 09:44:14 -0400
Subject: [PATCH] Do not warn on export all.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---
 src/conf_parse.peg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf_parse.peg b/src/conf_parse.peg
index f23d2ec..aa94a1a 100644
--- a/src/conf_parse.peg
+++ b/src/conf_parse.peg
@@ -128,6 +128,7 @@ ws <- [ \t] `ws`;
 -ifdef(TEST).
 -include_lib("eunit/include/eunit.hrl").
 -compile(export_all).
+-compile(nowarn_export_all).
 -endif.

 %% @doc Only let through lines that are not comments or whitespace.
-- 
2.18.0.rc1
ghost commented 6 years ago

@senturk / @bowlofeggs - do you guys want invites to discuss on Slack ?

bowlofeggs commented 6 years ago

@bryanhuntesl I don't use slack, but I'm happy to discuss here, Freenode, XMPP, or e-mail if you like. I pulled this patch in to Fedora so I could get cuttlefish to build against OTP/20:

https://src.fedoraproject.org/rpms/erlang-cuttlefish/c/1432115c2405a2632d0cff19dce5439b083212ec?branch=master

You probably would only see the build failure if you had the build system configured to treat warnings as errors (Fedora does this).

martincox commented 2 years ago

Fixed a few years ago with otp20 compat.