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

clickhouse 1.1.54074 (new formula) #7222

Closed
wants to merge 1 commit into from
Closed

clickhouse 1.1.54074 (new formula) #7222

wants to merge 1 commit into from

Conversation

hatarist
Copy link

  • [v] Have you followed the guidelines for contributing?
  • [v] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [v] Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [v] Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

Here's an OS X build guide: https://github.com/yandex/ClickHouse/blob/master/doc/build_osx.md
In short, we have to recompile boost using gcc-6, hence the HOMEBREW_CC/HOMEBREW_BUILD_FROM_SOURCE overriding before depends_on "boost".

ENV["HOMEBREW_CC"] = "gcc-6"
ENV["HOMEBREW_LD"] = "gcc-6"
ENV["HOMEBREW_CXX"] = "g++-6"
ENV["HOMEBREW_BUILD_FROM_SOURCE"] = "1"
Copy link
Member

Choose a reason for hiding this comment

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

We can't do this. This and Boost need to be build using Clang.

depends_on "unixodbc" => :build
depends_on "glib" => :build
depends_on "libtool" => :build
depends_on "gettext" => :build
Copy link
Member

Choose a reason for hiding this comment

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

Are none of these linked to at runtime?

ENV["DISABLE_MONGODB"] = "1"

# Hardcode the version assignment since there's no git repository
inreplace "libs/libcommon/src/get_revision_lib.sh", /git.*\n.*/, "echo " + version.to_s[-5..-1]
Copy link
Member

Choose a reason for hiding this comment

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

Use a Git checkout instead of patching.

s.gsub! "<!-- <max_open_files>262144</max_open_files> -->", "<max_open_files>262144</max_open_files>"
end

# Copy configuration files
Copy link
Member

Choose a reason for hiding this comment

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

Don't need this comment.


inreplace "#{buildpath}/dbms/src/Server/config.xml" do |s|
s.gsub! "/opt/clickhouse/", "#{var}/clickhouse/"
s.gsub! "<!-- <max_open_files>262144</max_open_files> -->", "<max_open_files>262144</max_open_files>"
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this the default?

inreplace "libs/libcommon/src/get_revision_lib.sh", /git.*\n.*/, "echo " + version.to_s[-5..-1]

mkdir "build"
cd "build" do
Copy link
Member

Choose a reason for hiding this comment

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

mkdir "build" do

cd "build" do
system "cmake", ".."
system "make"
bin.install "#{buildpath}/build/dbms/src/Server/clickhouse" => "clickhouse-server"
Copy link
Member

Choose a reason for hiding this comment

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

Is there no make install we can use? If not, please request one from upstream.

If you're going to run the server, make sure to increase `maxfiles` limit:
https://github.com/yandex/ClickHouse/blob/master/MacOS.md
EOS
end
Copy link
Member

Choose a reason for hiding this comment

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

Don't need any of these caveats as they aren't Homebrew specific or different to normal.

end

test do
system "#{bin}/clickhouse-client", "--help"
Copy link
Member

Choose a reason for hiding this comment

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

Can this test be modified to do something more substantial than e.g. --version or --help? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

Thanks a lot for taking your time to review!

@woodruffw woodruffw added the needs response Needs a response from the issue/PR author label Dec 1, 2016
@woodruffw
Copy link
Member

Any update here @hatarist?

@hatarist
Copy link
Author

hatarist commented Dec 5, 2016

I'm very sorry, I have little to no experience with cmake/make and it seems that the project has a lot of issues regarding build-scripts. (see clickhouse issue #220 (ru->en translation))
In short, people are blaming the poor code quality of the build-scripts. Cons are: it looks for the static libraries, it doesn't use FindOpenSSL/FindBoost, it doesn't look for termcap/libz libraries (as it's used in the project), it doesn't use cmake -D options and uses environment variables instead.

I also have no idea what to do with

This and Boost need to be build using Clang.

:(

Sorry again. I guess this pull request should be closed until most of these things could be fixed?

@BrewTestBot BrewTestBot removed the needs response Needs a response from the issue/PR author label Dec 5, 2016
@woodruffw
Copy link
Member

Don't worry about it! Thanks for making an effort to build this despite its build system difficulties. I'll close for now, but future PR(s) for this formula are always welcome.

Thanks again!

@woodruffw woodruffw closed this Dec 5, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants