Skip to content

Allow lllc to be installed via Make#3398

Merged
chriseth merged 2 commits intoargotorg:developfrom
ConsenSysMesh:install-lllc
Feb 13, 2018
Merged

Allow lllc to be installed via Make#3398
chriseth merged 2 commits intoargotorg:developfrom
ConsenSysMesh:install-lllc

Conversation

@Matthalp-zz
Copy link
Contributor

@Matthalp-zz Matthalp-zz commented Jan 16, 2018

Fixes #2785.

# This is not supported on macOS, see
# https://developer.apple.com/library/content/qa/qa1118/_index.html.
set_target_properties(
solc PROPERTIES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably read lllc

@chriseth
Copy link
Contributor

In general, I welcome this change. We only have to check whether it adds another executable to the debian / ubuntu builds. lllc should be its own package and not a binary that is part of the solc package.

@Matthalp-zz
Copy link
Contributor Author

Sounds good. Let me know if there is anything I need to do to help.

@chriseth
Copy link
Contributor

I'm pretty sure it will just install lllc as well. If you know debian/ubuntu packaging, you can take a look at scripts/release_ppa.sh.

# This is not supported on macOS, see
# https://developer.apple.com/library/content/qa/qa1118/_index.html.
set_target_properties(
solc PROPERTIES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this shouldn't read lllc?

@Matthalp-zz
Copy link
Contributor Author

@axic good catch -- addressed.

@Matthalp-zz
Copy link
Contributor Author

I don't know much in regard to packaging, but if you feel like more has to be done here in that regard I can take a look. Just let me know.

target_link_libraries(lllc PRIVATE lll)

include(GNUInstallDirs)
install(TARGETS lllc DESTINATION "${CMAKE_INSTALL_BINDIR}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove "". They actually can corrupt paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chfast I followed the convention in solc/CMakeLists.txt:

install(TARGETS solc DESTINATION "${CMAKE_INSTALL_BINDIR}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was doing the same, but it turned out it does not anything. And sometimes is harmful.

@Matthalp-zz
Copy link
Contributor Author

@chfast I have removed the quotes in lllc/CMakeLists.txt, but did not address the quotes that remain in the corresponding part of the solc/CMakeLists.txt since that is out of the scope of the changes being made in this PR.

Copy link
Contributor

@chriseth chriseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this can be merged, 'scripts/release_ppa.sh` has to be fixed so that lllc is not installed as part of the solc ubuntu package.

@chriseth
Copy link
Contributor

As a compromise, we could probably change this so that make install does not install lllc, but something like make install lllc installs it. Not sure if that is possible.

@chfast
Copy link
Contributor

chfast commented Jan 17, 2018

There are 2 solutions for this in CMake:

Don't build lllc by default.

  1. make (does not build lllc)
  2. make install (would install solc without lllc because not built)
  3. make lllc (will build lllc)
  4. make install (would install solc with lllc because built)

I think this is rather confusing, because make install behavior changes depending on what you have currently built. If you want build lllc but not install it you have to remember to remove it before make install.

Use install(COMPONENT)

  1. Specify different "components" for solc and lllc, e.g. "solidity" and "extra-tools".
  2. To install single component, you have to do cmake -DCOMPONENT=comp_one -P {your_build_dir}/cmake_install.cmake. Not very beautiful, but works.

We can also have a combination of both.

@Matthalp-zz
Copy link
Contributor Author

Matthalp-zz commented Jan 17, 2018

Can I propose a third option where there is a CMAKE option to specify whether lllc should be included in make install? I went ahead and updated the files to show the changes that are required to support this.

cmake -DLLLC_INSTALL=ON ..

@chfast
Copy link
Contributor

chfast commented Jan 17, 2018

cmake -DLLLC_INSTALL=ON ..

Yes, this is good idea. However I'd call it INSTALL_LLLC.

@Matthalp-zz
Copy link
Contributor Author

I'm fine with whatever name you and @chriseth agree on.

@chriseth
Copy link
Contributor

@matthalp a cmake flag is a good idea! I think we can actually default it to install lllc and then add the setting in the scripts/ppa_relaese.sh:


override_dh_auto_configure:
        dh_auto_configure -- -DINSTALL_LLLC=Off

But someone would have to test that :)

@axic
Copy link
Contributor

axic commented Jan 24, 2018

@matthalp can you make the changes to the release scripts to turn off installation (as mentioned by @chriseth)?

@Matthalp-zz
Copy link
Contributor Author

The change is easy, but I still have to sit down and test it locally. I'll try to do that by the end of the weekend.

@xemuliam
Copy link

xemuliam commented Feb 8, 2018

Interesting thing: most of Solidity manuals say "if you have installed solc you've already had lllc also".
However lllc is absent in Ethereum PPA and it can't be installed via source code compilation without manual intervention.
BTW both of them solc and lllc take a part of compilation and making. Onnly one difference is installation: it works only for solc.
Why it is important? It is only yet another one compiler for contracts. What's wrong with addition of it to standard make install?

@Matthalp-zz
Copy link
Contributor Author

@axic @chriseth Where do you stand based on the comment from @xemuliam? Should I exclude lllc from being installed as part of the Debian package or not?

@chriseth
Copy link
Contributor

Yes, lllc should have its own debian package.

CMakeLists.txt Outdated

option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
option(LLLC_LINK_STATIC "Link lllc executable statically on supported platforms" OFF)
option(INSTALL_LLLC "Include lllc executable in installation" ON)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this off by default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having read up the earlier comments, the benefits are:

  • it definitely won't alter the ppa process
  • it will not give the impression that lllc is a fully maintained, supported and integral part of solc (as it is just something allowed to exists here)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine either way. Most people don't build from source anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just get this merged today so we can create a release tomorrow.

@axic
Copy link
Contributor

axic commented Feb 13, 2018

@chriseth approve then?

override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_auto_configure:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axic If INSTALL_LLLC is off by default then this can be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but kept it there for safety reasons. We may switch it on or who knows :)

@chriseth chriseth merged commit 1d21f30 into argotorg:develop Feb 13, 2018
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

Successfully merging this pull request may close these issues.

6 participants