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

Compiled mode: Run tests with custom system image #80

Merged
merged 2 commits into from
Jan 11, 2022

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Dec 2, 2020

Initial stab at #79. Uses PackageCompiler to generate a custom systemimage that includes the package we're interested in (albeit without any precompilation statements, but I don't think that matters). It then uses that system image to run tests, but in a slightly different container (Arch Linux based) and with a different depot.

TODO:

  • Print some statistics on the generated image
  • Change the user / home folder.

@maleadt maleadt force-pushed the tb/packagecompiler branch from ea5e43c to 7e7ca9d Compare December 2, 2020 13:48
@maleadt maleadt linked an issue Dec 2, 2020 that may be closed by this pull request
@maleadt maleadt force-pushed the tb/packagecompiler branch from 1055cff to b0e99b6 Compare December 3, 2020 10:24
@maleadt maleadt marked this pull request as ready for review December 3, 2020 11:44
@maleadt
Copy link
Member Author

maleadt commented Dec 3, 2020

And some results: https://github.com/maleadt/packagecompiler_report/blob/08cc1a7a4aa7d4a8ae12d2b03d11369716c08bd7/REPORT.md

Summarized:

4680 packages tested on Julia 1.5.3
1656 failed tests, or were not considered
2435 passed tests in both cases (with and without PackageCompiler)
582 packages failed only after being compiled in the system image

Not too bad, I guess?

cc @KristofferC

@ViralBShah
Copy link
Contributor

@aviks @StefanKarpinski

@ViralBShah
Copy link
Contributor

Most of the binary_dependency issues are just that - old packages that do not use Yggdrasil provided binaries, or packages that need commercial binaries.

@KristofferC
Copy link
Contributor

A lot of them are also for packages using some local file. JuliaLang/julia#38696 could be a way to help with that.

@maleadt maleadt force-pushed the tb/packagecompiler branch from 2a1df75 to 9e4f648 Compare December 4, 2020 12:26
@ViralBShah
Copy link
Contributor

ViralBShah commented Dec 4, 2020

@maleadt Do you move the compiled system image to a different path and perhaps even different user account before running? A lot of the images fail when they are run in a different place.

In fact it would be nice to run in-place and then a different place and see which ones fail.

@maleadt
Copy link
Member Author

maleadt commented Dec 4, 2020

Do you move the compiled system image to a different path and perhaps even different user account before running?

The system image is built on Ubuntu, with the depot in ~/.julia and Julia in /opt/julia. Evaluation happens in a fresh Arch Linux-based container (so system libraries are different), using ~/.another_julia as depot and Julia in /usr/local/julia exactly to flush out these path issues.

I don't put the system image itself in another path, but that doesn't matter (no package is going to contain hard-coded references to the active system image).

I currently don't use a different user account, maybe it would be valuable to add that too in case there's hard-coded references to the users home folder -- but we already catch many instances of that because packages usually refer to existing files there (and by using a fresh containers there are no files at those paths).

@ViralBShah
Copy link
Contributor

I have heard complaints about stuff not working when the system image is moved to a different path, because packages sometimes hardcode paths at image building time. So when those absolute paths are not present on a different user's computer, things break.

@maleadt
Copy link
Member Author

maleadt commented Dec 4, 2020

because packages sometimes hardcode paths at image building time

Paths to the system image itself? How would that happen?
Also, the newly-created system image doesn't exist when it's being generated, so how could that path end up hard-coded?

@ViralBShah
Copy link
Contributor

Can we note somewhere the size of the generated system image?

@maleadt maleadt force-pushed the tb/packagecompiler branch from 7eb3bd6 to 5c96587 Compare December 4, 2020 17:12
@maleadt maleadt force-pushed the tb/packagecompiler branch 2 times, most recently from de069e8 to 2ce4305 Compare January 11, 2021 17:29
@maleadt maleadt force-pushed the tb/packagecompiler branch from 2ce4305 to 1822662 Compare April 15, 2021 10:48
@maleadt maleadt force-pushed the tb/packagecompiler branch from 1822662 to 4fa1cb7 Compare April 15, 2021 11:50
@ViralBShah
Copy link
Contributor

Would be nice to get this merged so we can test if packages can reliably be compiled into system images.

@maleadt
Copy link
Member Author

maleadt commented Jan 7, 2022

There isn't a real UI though, and it's not really suited for Nanosoldier (which compares multiple versions of Julia). Maybe a special mode?

@DilumAluthge
Copy link
Member

Yeah, the comparison we really want here is, for the same version of Julia, to compare regular package tests to the "compiled mode", and list out packages that pass on the regular package tests but fail on the "compiled mode".

@maleadt maleadt force-pushed the tb/packagecompiler branch from 4fa1cb7 to 57231ec Compare January 11, 2022 09:38
@maleadt
Copy link
Member Author

maleadt commented Jan 11, 2022

OK, this has been rebased and updated to work on Sandbox.jl now. I'll have a look at integrating with Nanosoldier.

@maleadt maleadt merged commit 19989de into master Jan 11, 2022
@maleadt maleadt deleted the tb/packagecompiler branch January 11, 2022 14:41
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.

Feature Request: Add a pass to test PackageCompiler on each package
4 participants