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

Create a standalone libponyc on Linux #3716

Merged
merged 1 commit into from
Feb 23, 2021
Merged

Create a standalone libponyc on Linux #3716

merged 1 commit into from
Feb 23, 2021

Conversation

SeanTAllen
Copy link
Member

It's possible to use libponyc from projects other than ponyc. Using the
library gives you access to all the various compiler functionality. However,
it is hard to use the library because, you need to link in the correct libstdc++,
libblake, and LLVM. Figuring out what is the correct version of each is very
difficult.

With this change, a new library libponyc-standalone.a will be created as
part of the build process.

Applications like the "in pony documentation generator" that I am on will
be able to link to libponyc-standalone and pick up all it's required dependencies.

Windows, BSD, and macOS libraries are not created at this time but can be added
as needed in the future.

@SeanTAllen SeanTAllen added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 20, 2021
@SeanTAllen SeanTAllen requested review from chalcolith and a team February 20, 2021 13:15
@ponylang-main
Copy link
Contributor

Hi @SeanTAllen,

The changelog - added label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 3716.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@SeanTAllen SeanTAllen added the do not merge This PR should not be merged at this time label Feb 20, 2021
@SeanTAllen
Copy link
Member Author

@kulibali this creates the library but it ends up with linker errors.

@SeanTAllen
Copy link
Member Author

If I use an ar script to include the same libraries, it seems to work.

@SeanTAllen
Copy link
Member Author

There's a definite difference in the size of the libraries created:

-rw-r--r-- 1 root root 96049610 Feb 20 08:36 libponyc-full.a
-rw-r--r-- 1 root root 88715102 Feb 20 08:27 libponyc-standalone.a

So standalone has some linker errors for things missing, and full doesn't seem like standalone is missing something.

@SeanTAllen
Copy link
Member Author

Ok so it isnt finding the .a correctly for stdlibc++.

@SeanTAllen SeanTAllen force-pushed the fat-libponyc branch 2 times, most recently from 190fb6f to a78b682 Compare February 20, 2021 19:20
@SeanTAllen SeanTAllen removed the do not merge This PR should not be merged at this time label Feb 20, 2021
@SeanTAllen SeanTAllen force-pushed the fat-libponyc branch 3 times, most recently from 27825dd to f0680cf Compare February 20, 2021 20:46
@jemc
Copy link
Member

jemc commented Feb 23, 2021

Should we have a CI run that tests this new CMake target?

@SeanTAllen
Copy link
Member Author

Eventually, in some form, yes

It's possible to use libponyc from projects other than ponyc. Using the
library gives you access to all the various compiler functionality. However,
it is hard to use the library because, you need to link in the correct libstdc++,
libblake, and LLVM. Figuring out what is the correct version of each is very
difficult.

With this change, a new library `libponyc-standalone.a` will be created as
part of the build process.

Applications like the "in pony documentation generator" that I am on will
be able to link to libponyc-standalone and pick up all it's required dependencies.

Windows, BSD, and macOS libraries are not created at this time but can be added
as needed in the future.
@SeanTAllen
Copy link
Member Author

@kulibali I'm going to merge this later as I have other ponydoc related work to bring over the top of this. Feel free to comment and things can be fixed after the merge.

@jemc at the moment, ponydoc is the only user of this and will pick up breakage with nightly CI. When we get further along, I'll work out what is best for testing this.

@SeanTAllen SeanTAllen merged commit 3164953 into main Feb 23, 2021
@SeanTAllen SeanTAllen deleted the fat-libponyc branch February 23, 2021 23:08
github-actions bot pushed a commit that referenced this pull request Feb 23, 2021
github-actions bot pushed a commit that referenced this pull request Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - added Automatically add "Added" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants