Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on macOS: 'in6addr_any' follows non-static declaration #157

Closed
rwillians opened this issue Aug 4, 2020 · 14 comments
Closed

Comments

@rwillians
Copy link

rwillians commented Aug 4, 2020

Edit:

Possible solutions:


I'm trying to install it on macOS Catalina 10.15.6 (19G73) but I'm getting an error related to inet_drv:

# CMD OUTPUT

asdf_23.0.3 is not a kerl-managed Erlang/OTP installation
The asdf_23.0.3 build has been deleted
Extracting source code
Building Erlang/OTP 23.0.3 (asdf_23.0.3), please wait...
/Users/rwillians/.asdf/plugins/erlang/kerl: line 661: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild: No such file or directory
APPLICATIONS DISABLED (See: /Users/rwillians/.asdf/plugins/erlang/kerl-home/builds/asdf_23.0.3/otp_build_23.0.3.log)
 * jinterface     : Java compiler disabled by user

Build failed.
extern const struct in6_addr in6addr_loopback;
                             ^
 CC	obj/x86_64-apple-darwin19.6.0/opt/smp/prim_buffer_nif.o
2 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/inet_drv.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/rwillians/.asdf/plugins/erlang/kerl-home/builds/asdf_23.0.3/otp_build_23.0.3.log for full details.
# LOG FRAGMENT

drivers/common/inet_drv.c:1484:30: error: static declaration of 'in6addr_any' follows non-static declaration
static const struct in6_addr in6addr_any = { { IN6ADDR_ANY_INIT } };
                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/netinet6/in6.h:211:30: note: previous declaration is here
extern const struct in6_addr in6addr_any;
                             ^
drivers/common/inet_drv.c:1493:30: error: static declaration of 'in6addr_loopback' follows non-static declaration
static const struct in6_addr in6addr_loopback =
                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/netinet6/in6.h:212:30: note: previous declaration is here
extern const struct in6_addr in6addr_loopback;
                             ^
 CC	obj/x86_64-apple-darwin19.6.0/opt/smp/prim_buffer_nif.o
2 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/inet_drv.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Full log: otp_build_23.0.3.log

I have tried with all the following versions and had the same error:

  • 23.0.3
  • 23.0.1
  • 22.3.4.5
  • 22.2.8
  • 22.1.8.1
  • 22.0.1

Here's the deps I've installed and the flags I set:

brew install autoconf wxmac openssl fop coreutils automake libyaml readline libxslt libtool unixodbc unzip curl

export CFLAGS="-O2 -g -fno-stack-check"
export KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=$(brew --prefix openssl)"

asdf install erlang <version>

I searched around and I found a ref to this error in an old thread where it says the possible solution is to rebuild erlang from scratch: http://erlang.org/pipermail/erlang-questions/2012-September/069262.html

I've tried installing from git (asdf install erlang ref:OTP-22.3.4.5) but got the same error 😭

Has anyone managed to workaround this?

PS: around late November of last year I was able to install 22.1.8 with no hassle at all

@zubairshokh
Copy link

Had the same issue fixed it by

  1. git config --global http.postBuffer 157286400
  2. remove the tar file from ~/.asdf/plugins/erlang/kerl-home/archives/
  3. and then restart the process asdf install erlang 23.0.3

@Stratus3D
Copy link
Member

Strange, I've not seen this error before. I'm not really sure what is wrong, but are you certain you installed all the dependencies correctly on OSX?

@Stratus3D
Copy link
Member

It may be worth opening an issue on the kerl issue tracker (asdf-erlang relies on kerl for builds) https://github.com/kerl/kerl/

@rwillians
Copy link
Author

@zubairshokh I tried that but didn't work for me 😭

@Stratus3D hm I'm pretty sure I did, I even installed more stuff that I had the last time I was able to build 22.1.8. I've also tried with javac but got same outcome.

At this point I just gave up and installed the latest version I could find on homebrew -- which, lucky me, is 22.1.8 -- so at least I can get back to work.

Thanks anyways, I'll open the issue on kerl as well.

I guess I can keep this issue open for a few more days in case someone here has any information regarding this error and hopefully an easy workaround.

@Stratus3D
Copy link
Member

Oddly it works on my machine (OSX 10.15.5, I'll try upgrading tomorrow).

asdf_23.0.3 is not a kerl-managed Erlang/OTP installation
The asdf_23.0.3 build has been deleted
Extracting source code
Building Erlang/OTP 23.0.3 (asdf_23.0.3), please wait...
DOCUMENTATION INFORMATION (See: /Users/<redacted>/.asdf/plugins/erlang/kerl-home/builds/asdf_23.0.3/otp_build_23.0.3.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Erlang/OTP 23.0.3 (asdf_23.0.3) has been successfully built
Installing Erlang/OTP 23.0.3 (asdf_23.0.3) in /Users/<redacted>/.asdf/installs/erlang/23.0.3...
You can activate this installation running the following command:
. /Users/<redacted>/.asdf/installs/erlang/23.0.3/activate
Later on, you can leave the installation typing:
kerl_deactivate
Cleaning up compilation products for 
Cleaned up compilation products for  under /Users/<redacted>/.asdf/plugins/erlang/kerl-home/builds
ln: ./erl_call: File exists

Erlang 23.0.3 has been installed. Activate globally with:

    asdf global erlang 23.0.3

Activate locally in the current folder with:

    asdf local erlang 23.0.3

@nbibler
Copy link

nbibler commented Aug 5, 2020

Maybe the "solution" in Ruby's puma somehow relates to this problem? See puma/puma#2304. See this comment for the implicit declaration changes in Apple's gcc.

@jswanner
Copy link

jswanner commented Aug 5, 2020

I was running into the same problem as @rwillians, following @nbibler's comment, I was able to install Erlang/OTP 23.0.3 successfully using export CFLAGS="-02 -Wno-error=implicit-function-declaration".

@rwillians
Copy link
Author

rwillians commented Aug 5, 2020

TL;DR:

Installing xcode was most likely the solution for me.


Hey guys

Good news: I was able to install it now.
Bad news: my environment isn't exactly the same as how it was when I reported the error, therefore it's harder to assert which exact change did the trick.

The main changes that I can remember are:

  • Uninstalled and reinstalled most of the dependencies;
  • Some packages upgrades showed up earlier today on homebrew so I upgraded them;
  • I set gcc@10 from homebrew as default, instead of apple's gcc 4.

First, after @jswanner said that @nbibler suggestion worked for him, I tried it:

export CFLAGS="-02 -Wno-error=implicit-function-declaration"
export KERL_BUILD_DOCS="no"
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"

asdf install erlang 23.0.3

That actually worked for the problem which I opened this issue for -- I no longer see that non-static declaration error --, but I got another error related to xcodebuid.

Then I tried using javac (I was half sure it wouldn't work but I really wanted to avoid installing xcode):

export CFLAGS="-02 -Wno-error=implicit-function-declaration"
export KERL_BUILD_DOCS="no"
export KERL_CONFIGURE_OPTIONS="--with-ssl=$(brew --prefix openssl)"

asdf install erlang 23.0.3

Well it didn't work, same xcodebuild thing.

So I finally took the defeat and installed xcode -- I had command line tools installed tho, which was enough for me the last time I installed erlang about 8 months ago -- and then I tried it again:

export KERL_BUILD_DOCS="no"
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"

asdf install erlang 23.0.3

And it worked.

--

Unfortunately I don't have the time to reset my environment and try it all over again using only the bare minimal dependencies to properly build erlang, but my best guess here is that xcode is now (not sure since how long) a required dep.

@thdaraujo
Copy link

FYI I was able to install it with these two flags:

$ export CFLAGS="-O2 -g -fno-stack-check -Wno-error=implicit-function-declaration"
$ asdf install erlang 23.0.3

@rwillians
Copy link
Author

@thdaraujo do you have Xcode installed?

@thdaraujo
Copy link

thdaraujo commented Sep 2, 2020

@thdaraujo do you have Xcode installed?

no, just the xcode command line tools @rwillians

@bluzky
Copy link

bluzky commented Sep 21, 2020

FYI I was able to install it with these two flags:

$ export CFLAGS="-O2 -g -fno-stack-check -Wno-error=implicit-function-declaration"
$ asdf install erlang 23.0.3

This works for me, thank you

@ospaarmann
Copy link

This did the trick for me (via #116 (comment))

asdf-erlang has been updated to use kerl version 1.8.6. Can you try updating asdf-erlang and see if that fixes the problem? asdf plugin-update erlang should do the trick.

  • Delete archive of failed build from ~/.asdf/plugins/erlang/kerl-home/archives (not sure if this is necessary though)
  • asdf plugin-update erlang
  • asdf install erlang 22.3.4.12

@aAnhVu
Copy link

aAnhVu commented Apr 5, 2021

FYI I was able to install it with these two flags:

$ export CFLAGS="-O2 -g -fno-stack-check -Wno-error=implicit-function-declaration"
$ asdf install erlang 23.0.3

This works for me, thank u !

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

No branches or pull requests

9 participants