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

Add support for musl-based Linux (e.g. Alpine) #1729

Closed
ehudkaldor opened this issue Mar 20, 2017 · 2 comments · Fixed by #1844
Closed

Add support for musl-based Linux (e.g. Alpine) #1729

ehudkaldor opened this issue Mar 20, 2017 · 2 comments · Fixed by #1844

Comments

@ehudkaldor
Copy link

I'm trying compile Pony on Alpine Linux (MUSL based) and failing. is there any guidance on how to do that?

@jemc
Copy link
Member

jemc commented Mar 20, 2017

@ehudkaldor - at the moment, I don't think it is possible.

Last time I tried to compile Pony on Alpine, there were definitely a few things that were broken that need to be fixed. I don't know that it's ever successfully been compiled with musl. If someone wants to step up and work on resolving the issues, this ticket can be a place to track that effort.

@killerswan
Copy link
Member

killerswan commented Apr 2, 2017

Because I happen to have the tabs open:

  • the latest apk for LLVM is 3.8.1, here,
  • libressl is here, and
  • pcre2 is here.

@killerswan killerswan changed the title cannot compile on musl-based Linux Add support for musl-based Linux (e.g. Alpine) Apr 2, 2017
dipinhora added a commit to dipinhora/ponyc that referenced this issue Apr 18, 2017
Changes related to getting pony compiling and running on Alpine
Linux Edge.

* Define `_GNU_SOURCE` so musl glibc compatibility is enabled.
* Makefile changes to detect Alpine Linux and link in `libexecinfo`
* Changes to stop using glibc specific `__GNUC_PREREQ` macro
* Changes to genexe linking to link in `libexecinfo` if on Alpine
  or FreeBSD (this is likely also needed but untested)
* Changes to move Linux cpu affinity setting outside of thread
  creation function and into same set affinity function as for
  other platforms. This also includes enabling asio thread affinity
  setting for non-linux platforms.
* Rename `SCHED_BATCH` to `PONY_SCHED_BATCH` to avoid conflict with
  musl.
* Set `this_scheduler` thread-local variable to `NULL` on
  `ponyint_sched_init` to avoid segfault in running codegen test
  suite.

Resolves ponylang#1729
dipinhora added a commit to dipinhora/ponyc that referenced this issue Apr 19, 2017
Changes related to getting pony compiling and running on Alpine
Linux Edge.

* Define `_GNU_SOURCE` so musl glibc compatibility is enabled.
* Makefile changes to detect Alpine Linux and link in `libexecinfo`.
* Makefile changes to define PONY_NO_ASSERT for libponyrt-pic.
* Changes to stop using glibc specific `__GNUC_PREREQ` macro.
* Changes to move Linux cpu affinity setting outside of thread
  creation function and into same set affinity function as for
  other platforms. This also includes enabling asio thread affinity
  setting for non-linux platforms.
* Rename `SCHED_BATCH` to `PONY_SCHED_BATCH` to avoid conflict with
  musl.
* Set `this_scheduler` thread-local variable to `NULL` on
  `ponyint_sched_init` to avoid segfault in running codegen test
  suite.
* Change `#if` for `pony_assert` to be `||` instead of `&&` to
  ensure `libponyrt` never has assertions enabled.

Resolves ponylang#1729
dipinhora added a commit to dipinhora/ponyc that referenced this issue Apr 19, 2017
Changes related to getting pony compiling and running on Alpine
Linux Edge.

* Define `_GNU_SOURCE` so musl glibc compatibility is enabled.
* Makefile changes to detect Alpine Linux and link in `libexecinfo`.
* Makefile changes to define PONY_NO_ASSERT for libponyrt-pic.
* Changes to stop using glibc specific `__GNUC_PREREQ` macro.
* Changes to move Linux cpu affinity setting outside of thread
  creation function and into same set affinity function as for
  other platforms. This also includes enabling asio thread affinity
  setting for non-linux platforms.
* Rename `SCHED_BATCH` to `PONY_SCHED_BATCH` to avoid conflict with
  musl.
* Set `this_scheduler` thread-local variable to `NULL` on
  `ponyint_sched_init` to avoid segfault in running codegen test
  suite.
* Change `#if` for `pony_assert` to use normal `assert`
  for builds that define `PONY_NO_ASSERT` (`libponyrt` and
  `libponyrt-pic` only as of this commit) instead of the custom
  `pony_assert_fail` that prints backtraces.

Resolves ponylang#1729
dipinhora added a commit to dipinhora/ponyc that referenced this issue Jul 20, 2017
Changes related to getting pony compiling and running on Alpine
Linux Edge.

* Define `_GNU_SOURCE` so musl glibc compatibility is enabled.
* Makefile changes to detect Alpine Linux and link in `libexecinfo`.
* Makefile changes to define PONY_NO_ASSERT for libponyrt-pic.
* Changes to stop using glibc specific `__GNUC_PREREQ` macro.
* Changes to move Linux cpu affinity setting outside of thread
  creation function and into same set affinity function as for
  other platforms. This also includes enabling asio thread affinity
  setting for non-linux platforms.
* Rename `SCHED_BATCH` to `PONY_SCHED_BATCH` to avoid conflict with
  musl.
* Set `this_scheduler` thread-local variable to `NULL` on
  `ponyint_sched_init` to avoid segfault in running codegen test
  suite.
* Change `#if` for `pony_assert` to use normal `assert`
  for builds that define `PONY_NO_ASSERT` (`libponyrt` and
  `libponyrt-pic` only as of this commit) instead of the custom
  `pony_assert_fail` that prints backtraces.

Resolves ponylang#1729
SeanTAllen pushed a commit that referenced this issue Jul 20, 2017
Changes related to getting pony compiling and running on Alpine
Linux Edge.

* Define `_GNU_SOURCE` so musl glibc compatibility is enabled.
* Makefile changes to detect Alpine Linux and link in `libexecinfo`.
* Makefile changes to define PONY_NO_ASSERT for libponyrt-pic.
* Changes to stop using glibc specific `__GNUC_PREREQ` macro.
* Changes to move Linux cpu affinity setting outside of thread
  creation function and into same set affinity function as for
  other platforms. This also includes enabling asio thread affinity
  setting for non-linux platforms.
* Rename `SCHED_BATCH` to `PONY_SCHED_BATCH` to avoid conflict with
  musl.
* Set `this_scheduler` thread-local variable to `NULL` on
  `ponyint_sched_init` to avoid segfault in running codegen test
  suite.
* Change `#if` for `pony_assert` to use normal `assert`
  for builds that define `PONY_NO_ASSERT` (`libponyrt` and
  `libponyrt-pic` only as of this commit) instead of the custom
  `pony_assert_fail` that prints backtraces.

Resolves #1729
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 a pull request may close this issue.

3 participants