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

Precompile: Improve handling of packages that are missing modules #2579

Conversation

IanButterworth
Copy link
Member

The error in #2560 is unhelpful because

  1. a more insightful message from stderr is suppressed
  2. the error aborts the entire precomp process

This PR fixes both of those

(test) pkg> precompile
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
  No Changes to `~/test/Project.toml`
  No Changes to `~/test/Manifest.toml`
Precompiling project...
  ✗ test
  0 dependencies successfully precompiled in 2 seconds

ERROR: The following 1 direct dependency failed to precompile:

test [08419116-8e91-4029-9e54-f56135b4ba74]

ArgumentError: Invalid header in cache file /Users/ian/.julia/compiled/v1.7/test/jl_stYIsR.
WARNING: --output requested, but no modules defined during run

(test) pkg> 

Fixes #2560

@@ -1100,6 +1100,7 @@ function precompile(ctx::Context; internal_call::Bool=false, strict::Bool=false,

function handle_interrupt(err)
notify(interrupted_or_done)
sleep(0.2) # yield for a period to let the print loop cease first
Copy link
Member Author

Choose a reason for hiding this comment

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

In my experience this just makes the interrupt printing more reliably tidy

@IanButterworth IanButterworth merged commit 5104536 into JuliaLang:master May 31, 2021
@IanButterworth IanButterworth deleted the ib/precompile_no_module_handling branch May 31, 2021 13:39
KristofferC pushed a commit that referenced this pull request Jun 10, 2021
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.

A project without module gives a very misleading error
3 participants