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

Interpolate PkgId expression, working around #48 #49

Merged
merged 1 commit into from
Jul 12, 2018
Merged

Interpolate PkgId expression, working around #48 #49

merged 1 commit into from
Jul 12, 2018

Conversation

jmert
Copy link
Contributor

@jmert jmert commented Jul 12, 2018

This is the small patch I [semi-]guess-and-checked my way to resolving a similar issue as #48, as mentioned in this comment.

@jmert
Copy link
Contributor Author

jmert commented Jul 12, 2018

To be specific, my test case looked more like this.

ProjectSpecific.jl:

__precompile__()

module ProjectSpecific

using GenericResearch
import Requires: @require
import Reexport: @reexport

function __init__()
    @require PyPlot="d330b81b-6aea-500a-939a-2ce795aea3ee" begin
        include("plot_map.jl")
        @reexport using .Plotting
    end
end

end

with plot_map.jl having the contents:

module Plotting

using GenericResearch
import PyPlot
import PyCall

const healpy = PyCall.PyNULL()

function __init__()
    copy!(healpy, PyCall.pyimport("healpy"))
end

end

Version info:

julia> versioninfo()
Julia Version 0.7.0-beta.270
Commit 8ab41d6d1f* (2018-07-12 00:57 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

(ProjectSpecific.jl) pkg> status
    Status `Project.toml`
  [438e738f] + PyCall v1.17.1
  [d330b81b] + PyPlot v2.6.0
  [189a3867] + Reexport v0.1.0
  [ae029012] + Requires v0.5.1
    Status `Manifest.toml`
  [9e28174c] + BinDeps v0.8.8
  [3da002f7] + ColorTypes v0.7.2
  [5ae59095] + Colors v0.9.0
  [34da2185] + Compat v0.69.0
  [8f4d0f93] + Conda v0.8.1
  [53c48c17] + FixedPointNumbers v0.5.1
  [682c06a0] + JSON v0.18.0
  [b964fa9f] + LaTeXStrings v1.0.0
  [1914dd2f] + MacroTools v0.4.2
  [30578b45] + URIParser v0.3.1
  [81def892] + VersionParsing v1.1.1
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode

@timholy
Copy link
Member

timholy commented Jul 12, 2018

Big 👍 for doing this. Bonus points for adding a test that demonstrates this. You could probably crib it from @davidanthoff's test case? You might just need a writepkg2 or something.

"A bug fix is for today. A test is forever." If you add the test then future generations can't do stuff (even accidentally) that breaks it.

@jmert
Copy link
Contributor Author

jmert commented Jul 12, 2018

Sure, I'll look at turning this in to a test case this afternoon. (Unfortunately, I'm now on campus and have to sadly return to my "MATrix-LABoratory-which-shall-not-be-named"-based research 😭)

@timholy
Copy link
Member

timholy commented Jul 12, 2018

Been there myself. Once you start writing code in Julia, it's simply amazing how painful it becomes to write code in most other languages.

@MikeInnes
Copy link
Collaborator

It looks like this is probably a subtle base issue around storing the PkgId object directly in a precompiled file (though I'm just guessing). If you can come up with a test case it'd be awesome, but if it's too tricky we can merge without. Would also appreciate a confirmation that this fixes the issue on someone else's setup.

@timholy
Copy link
Member

timholy commented Jul 12, 2018

No, it's totally straightforward: it's fixing the same issue I described under "One change you definitely want to keep is hard-coding the PkgId that gets passed to listenpkg" in #46. It just turns out it's more than just listenpkg 😄.

For a test, the bugs that have been reported can easily be turned into test cases. It just comes down to having a module that has another precompiled dependency; that wasn't something I inserted in my new tests.

@MikeInnes
Copy link
Collaborator

Ah, I had misunderstood that the first time I read it – but I see now that this fixes the call to require as well. That's pretty weird behaviour but I guess it's related to the serialiser and distributed code.

I'll merge this for now as we need to get the fix out for package authors; we can add a test later. Thanks a lot @timholy and @jmert!

@MikeInnes MikeInnes merged commit fb4e8ee into JuliaPackaging:master Jul 12, 2018
@jmert jmert mentioned this pull request Jul 12, 2018
@jmert jmert deleted the fix48 branch July 12, 2018 18:57
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.

3 participants