Skip to content

Adds support for building on Solaris-derived systems#23746

Merged
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
oxidecomputer:master
Apr 30, 2021
Merged

Adds support for building on Solaris-derived systems#23746
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
oxidecomputer:master

Conversation

@bnaecker
Copy link
Copy Markdown
Contributor

This commit adds a number of changes to platform-detection and
compile-time directives required to support building ClickHouse on
Solaris-derived systems, most notably illumos.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Adds support for building on Solaris-derived operating systems.

Detailed description / Documentation draft:
This commit adds support for building on Solaris-derived systems, most notably illumos. Most changes are non-functional, consisting of compile-time directives, inclusions, and defines in order to get the existing code to build. A few changes are to variable declarations or names, and are done to satisfy Solaris's include file structure and contents.

This commit adds a number of changes to platform-detection and
compile-time directives required to support building ClickHouse on
Solaris-derived systems, most notably illumos.
@robot-clickhouse robot-clickhouse added the pr-build Pull request with build/testing/packaging improvement label Apr 28, 2021
::rusage rusage {};
#if !defined(__APPLE__)
#if defined(OS_SUNOS)
::getrusage(RUSAGE_LWP, &rusage);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reference, LWP refers to a "light-weight process", and is functionally analogous to a thread on modern illumos systems.

@alexey-milovidov
Copy link
Copy Markdown
Member

A small typo:

2021-04-29 19:23:32 /ClickHouse/base/pcg-random/pcg_random.hpp:1646:18: error: use of undeclared identifier 'pgc_detail'; did you mean 'pcg_detail'?
2021-04-29 19:23:32 using ext_std8 = pgc_detail::extended<table_pow2, advance_pow2, BaseRNG,
2021-04-29 19:23:32                  ^~~~~~~~~~
2021-04-29 19:23:32                  pcg_detail

@bnaecker
Copy link
Copy Markdown
Contributor Author

Good catch, thank you.

@alexey-milovidov
Copy link
Copy Markdown
Member

@bnaecker I heard that Illumos has Linux compatibility layer and can run Linux binaries, https://www.youtube.com/watch?v=TrfD3pC0VSs is that true?

@bnaecker
Copy link
Copy Markdown
Contributor Author

@alexey-milovidov Yes, that's right! Zones are a general tool on illumos for isolating runtime environments and resources, and LX zones allow running a Linux kernel without a full VM. It works by translating the system calls, and is a convenient way to get Linux-only applications running. It does have some drawbacks though, which is minimal support for lots of the nice features of illumos itself related to debugging, ZFS, and service management.

@alexey-milovidov
Copy link
Copy Markdown
Member

@bnaecker Also we need a pull request that updates every affected submodule to commits with changes.

@bnaecker
Copy link
Copy Markdown
Contributor Author

@alexey-milovidov Thanks for the reminder. I'm still waiting on two PRs against ClickHouse extra repos, one to RocksDB and one to gRPC. Once those are integrated, I'll add another patch to .gitmodules pointing to commits including those changes.

Let me know if there's anything else I can do to move things along, and thanks!

@alexey-milovidov
Copy link
Copy Markdown
Member

Ok. I've missed the notifications somehow.

@bnaecker
Copy link
Copy Markdown
Contributor Author

No problem, I'll put together a patch to the submodules today. Thanks!

@bnaecker
Copy link
Copy Markdown
Contributor Author

@alexey-milovidov Oops, I forgot about this PR against BoringSSL as well!

@bnaecker
Copy link
Copy Markdown
Contributor Author

Also, I'm not sure anything needs to be updated in .gitmodules, but I'd like to check. Of the patches that I've put up, only the modules referring to gRPC and Poco point to a specific branch. The rest pull from HEAD, if I'm not mistaken. The branches recorded in .gitmodules for those are 1.33.2 and clickhouse, respectively, both of which contain the commits merging my PRs.

So it seems no PR against ClickHouse itself should be required. Of course, please let me know if that's incorrect! Thanks.

@bnaecker
Copy link
Copy Markdown
Contributor Author

@alexey-milovidov Ahh, disregard my earlier comment. I haven't worked with submodules much, and I see now that the changes in each have to be merged so that the superproject records a new commit ID as the submodule's commit. I'll work on that now, and put up a new PR with the required changes. Thanks!

@bnaecker
Copy link
Copy Markdown
Contributor Author

@alexey-milovidov While updating the submodules, I've also discovered that one of my earlier PRs was incorrect, missing an #endif somewhere. I've put up a new PR with the fix, and verified it builds correctly on Linux and illumos. Apologies for that mistake!

@eugene-vodyanko
Copy link
Copy Markdown

@bnaecker, have you had the practice of building ClickHouse for operating system Solaris 11.* based on SPARC processor?
Maybe, you have recommendations or instructions?

Thanks!

@bnaecker
Copy link
Copy Markdown
Contributor Author

@eugene-vodyanko No, I've not built ClickHouse for Solaris 11 or any SPARC system. This pull request was geared towards building ClickHouse on illumos systems, such as OmniOS. Based on this issue, it seems like ClickHouse plans to support x86, ARM, and PowerPC architectures, but I don't see anything that indicates SPARC support. Given the very different architecture, I'd be a bit surprised if ClickHouse could be successfully built on SPARC, but @alexey-milovidov will probably be able to provide more information.

@eugene-vodyanko
Copy link
Copy Markdown

@bnaecker, thank you very much for you answer.
Meanwhile, once we asked @alexey-milovidov about this question in the telegram chat.
And he answered that a professional could do it. Also he explained aspects with «big endian».

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants