Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

build script on clean install has compiler detection error #7260

Closed
spoonincode opened this issue May 3, 2019 · 6 comments
Closed

build script on clean install has compiler detection error #7260

spoonincode opened this issue May 3, 2019 · 6 comments
Assignees
Labels
bug build Issues related to building

Comments

@spoonincode
Copy link
Contributor

When running the build script with no options on a fresh Ubuntu 18.04 install it builds the clang8 compiler. That is not expected without the -P option. The reason for this is due to a couple errors in the build script and ordering of detection.

The script has a couple logic defects that should probably be fixed like so:

--- a/scripts/eosio_build.sh
+++ b/scripts/eosio_build.sh
@@ -253,8 +253,8 @@ if [ $PIN_COMPILER ]; then
    BUILD_CLANG8=true
    CPP_COMP=${OPT_LOCATION}/clang8/bin/clang++
    CC_COMP=${OPT_LOCATION}/clang8/bin/clang
-elif $NO_CPP17; then
-   if [ $NONINTERACTIVE -eq 0 ]; then
+elif [ $NO_CPP17 ]; then
+   if [ $NONINTERACTIVE -eq 1 ]; then
       BUILD_CLANG8=true
       CPP_COMP=${OPT_LOCATION}/clang8/bin/clang++
       CC_COMP=${OPT_LOCATION}/clang8/bin/clang

But this doesn't fix the underlying problem: this compiler check happens before a compiler is possibly installed by the eosio_build_ubuntu.sh (or other platform) script. So by making this change above it will prompt users to install pinned compiler when a platform compiler would pass muster any other time.

But there's more: the eosio_build_ubuntu.sh script will end up installing gcc still. This means the next time the user runs the script with no options (as they probably would, since that's what they did the first time), the script will try doing a non-pinned build. And of course that won't work -- giving bizarre errors -- because you'd need to give a -f to switch between pinned vs nonpinned.

@spoonincode spoonincode added the bug label May 3, 2019
@heifner heifner self-assigned this May 3, 2019
@NorseGaud NorseGaud self-assigned this May 4, 2019
@spoonincode
Copy link
Contributor Author

This error also seems to prevent eosio_build.sh from working on 16.04 when no arguments are passed

@NorseGaud
Copy link
Contributor

I noticed the same with my tests in #7263... Strange... I'm collecting failure logs for each distro so we can swarm on what's causing it.

@heifner heifner removed their assignment May 6, 2019
@spoonincode
Copy link
Contributor Author

spoonincode commented May 6, 2019

#7263 still has the faulty if statement I documented in this defect, that's why it too has problems

edit: actually I guess it's technically a different if statement, but point being it's the same kind of error

@NorseGaud
Copy link
Contributor

NorseGaud commented May 6, 2019

Regarding #7263: There is a bit of a chicken and egg problem here. You can't compile cmake without clang/gcc-c++ installed, so you can't compile clang8. That's why the user is prompted that their version will not work and -y will answer yes to installing our clang8.

My script handles this by warning the user they've already installed eosio before they can proceed (and suggests using the new uninstall script I made). Unless they just downloaded a newer version, there shouldn't be a reason someone would run it twice. Also, I'm using a new path structure with the version pulled from the CMakeLists file.

@NorseGaud
Copy link
Contributor

@spoonincode Still an issue?

@spoonincode
Copy link
Contributor Author

nah I think we should close this one

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug build Issues related to building
Projects
None yet
Development

No branches or pull requests

4 participants