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

1.11 regression: source file does not contain a module declaration #56050

Closed
aplavin opened this issue Oct 8, 2024 · 7 comments
Closed

1.11 regression: source file does not contain a module declaration #56050

aplavin opened this issue Oct 8, 2024 · 7 comments
Labels
bug Indicates an unexpected problem or unintended behavior regression 1.11 Regression in the 1.11 release

Comments

@aplavin
Copy link
Contributor

aplavin commented Oct 8, 2024

MWE:

(@v1.11) pkg> activate --temp
(jl_YdCmZR) pkg> add VOTables@0.1.16
julia> using VOTables
Precompiling VOTables...
Info Given VOTables was explicitly requested, output will be shown live 
ERROR: LoadError: Package VOTables [3abbdab7-df67-4801-8590-8effec53f469] source file /Users/aplavin/.julia/packages/VOTables/H54Mn/src/VOTables.jl does not contain a module declaration.

I do

@doc Base.read(joinpath(dirname(@__DIR__), "README.md"), String) module VOTables

in the package file (didn't know README would be shown anyway!), likely that causes the issue with module detection.
I'll probably remove this line in the next VOTables version, but it seems a bug in Julia anyways.

Everything worked on 1.10, so this is 1.11 regression (thanks @fatteneder for fixing the title!).

@fatteneder fatteneder changed the title 1.10 regression: source file does not contain a module declaration 1.11 regression: source file does not contain a module declaration Oct 8, 2024
@fatteneder
Copy link
Member

fatteneder commented Oct 8, 2024

Probably caused by #51635.

@IanButterworth
Copy link
Member

The fix is marked for backport but didn't make it into 1.11.0 #55824

Can you confirm that it doesn't happen on master/nightly?

@giordano
Copy link
Contributor

giordano commented Oct 8, 2024

Can you confirm that it doesn't happen on master/nightly?

It happens for my on d4987a3

@IanButterworth IanButterworth added regression 1.11 Regression in the 1.11 release bug Indicates an unexpected problem or unintended behavior labels Oct 8, 2024
@IanButterworth
Copy link
Member

I see a different error on master

(@v1.12) pkg> add [email protected]
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed ConstructionBase ─ v1.5.8
   Installed DataPipes ──────── v0.3.18
   Installed Dictionaries ───── v0.4.2
   Installed EzXML ──────────── v1.2.0
   Installed AstroAngles ────── v0.2.0
   Installed Accessors ──────── v0.1.38
   Installed StringViews ────── v1.3.3
   Installed DateFormats ────── v0.1.19
   Installed InverseFunctions ─ v0.1.17
   Installed Indexing ───────── v1.1.1
   Installed UnsafeArrays ───── v1.0.6
   Installed AccessorsExtra ─── v0.1.81
   Installed MetadataArrays ─── v0.1.1
   Installed VOTables ───────── v0.1.16
    Updating `~/.julia/environments/v1.12/Project.toml`
  [3abbdab7] + VOTables v0.1.16
    Updating `~/.julia/environments/v1.12/Manifest.toml`
  [7d9f7c33] + Accessors v0.1.38
  [33016aad] + AccessorsExtra v0.1.81
  [5c4adb95] + AstroAngles v0.2.0
  [a33af91c] + CompositionsBase v0.1.2
  [187b0558] + ConstructionBase v1.5.8
  [9a962f9c] + DataAPI v1.16.0
  [02685ad9] + DataPipes v0.3.18
  [e2d170a0] + DataValueInterfaces v1.0.0
  [44557152] + DateFormats v0.1.19
  [85a47980] + Dictionaries v0.4.2
  [8f5d6c58] + EzXML v1.2.0
  [313cdc1a] + Indexing v1.1.1
  [3587e190] + InverseFunctions v0.1.17
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [1914dd2f] + MacroTools v0.5.13
  [49441bc9] + MetadataArrays v0.1.1
  [354b36f9] + StringViews v1.3.3
  [09ab397b] + StructArrays v0.6.18
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.12.0
  [c4a57d5a] + UnsafeArrays v1.0.6
  [3abbdab7] + VOTables v0.1.16
  [a63ad114] + Mmap v1.11.0
  ✗ VOTables
Precompiling packages finished.
  132 dependencies successfully precompiled in 51 seconds. 35 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

VOTables

Failed to precompile VOTables [3abbdab7-df67-4801-8590-8effec53f469] to "/Users/ian/.julia/compiled/v1.12/VOTables/jl_b0XJEy".
ERROR: LoadError: MethodError: no method matching unsafe_convert(::Type{Cstring}, ::Vector{UInt8})
The function `unsafe_convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  unsafe_convert(::Type{Cstring}, ::Symbol)
   @ Base strings/cstring.jl:106
  unsafe_convert(::Type{Cstring}, ::String)
   @ Base strings/cstring.jl:83
  unsafe_convert(::Type{Cstring}, ::Union{Memory{Int8}, Memory{UInt8}})
   @ Base strings/cstring.jl:90
  ...

Stacktrace:
  [1] macro expansion
    @ ~/.julia/packages/EzXML/DL8na/src/error.jl:50 [inlined]
  [2] parsexml(xmlstring::StringViews.StringView{Vector{UInt8}}; options::@Kwargs{})
    @ EzXML ~/.julia/packages/EzXML/DL8na/src/document.jl:114
  [3] parsexml(xmlstring::StringViews.StringView{Vector{UInt8}})
    @ EzXML ~/.julia/packages/EzXML/DL8na/src/document.jl:109
  [4] tblxml(votfile::String; strict::Bool)
    @ VOTables ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:287
  [5] read(result_type::Type, votfile::String; postprocess::Bool, unitful::Bool, strict::Bool)
    @ VOTables ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:57
  [6] read(result_type::Type, votfile::String)
    @ VOTables ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:56
  [7] read(votfile::String; kwargs::@Kwargs{})
    @ VOTables ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:54
  [8] macro expansion
    @ ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:347 [inlined]
  [9] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [10] top-level scope
    @ ~/.julia/packages/VOTables/H54Mn/src/VOTables.jl:346
 [11] include
    @ ./Base.jl:581 [inlined]
 [12] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2888
 [13] top-level scope
    @ stdin:5
 [14] eval
    @ ./boot.jl:439 [inlined]
 [15] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:2741
 [16] include_string
    @ ./loading.jl:2751 [inlined]
 [17] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:327
 [18] _start()
    @ Base ./client.jl:558
in expression starting at /Users/ian/.julia/packages/VOTables/H54Mn/src/VOTables.jl:1
in expression starting at stdin:

@giordano
Copy link
Contributor

giordano commented Oct 8, 2024

Ah, I saw there was an error when add-ing the package, wasn't expecting to be a different one!

@IanButterworth
Copy link
Member

I've backported #55824 to #56025 so that should be sufficient. Worth testing though.

@IanButterworth
Copy link
Member

Closing given the fix was on #56025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior regression 1.11 Regression in the 1.11 release
Projects
None yet
Development

No branches or pull requests

4 participants