Skip to content

GMT build error in Julia 1.11 and [email protected] #1574

@CyprienBosserelle

Description

@CyprienBosserelle

Hi,
I've noticed a build error when installing GMT.jl (] add [email protected]) on a new computer and current stable Julia (v1.11 but also occur with current LTS) .

I appears because of a call to replace with 3 arguments in line 68 of build.jl (Sys.iswindows() && (userdir = replace(userdir, "/", "\\"))) whereas it should be Sys.iswindows() && (userdir = replace(userdir, "/" => "\\")) for newer version of Julia (>=1.7 ?)

Funny thing is build.jl seem to only be called on fresh install. If I install @v1.15 and then upgrade to @v1.20 it just seem to work.

I'm happy with this workaround but I thought you may want to fix this.
Cheers
Cyp

Error message:

ERROR: Error building `GMT`:
ERROR: LoadError: MethodError: no method matching replace(::String, ::String, ::String)
The function `replace` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  replace(::AbstractString, !Matched::Pair...; count)
   @ Base strings\util.jl:936
  replace(!Matched::IO, ::AbstractString, !Matched::Pair...; count)
   @ Base strings\util.jl:933
  replace(!Matched::Union{Function, Type}, ::Any; count)
   @ Base set.jl:868
  ...

Stacktrace:
 [1] get_de_libnames()
   @ Main C:\Users\XXX\.julia\packages\GMT\yRgLc\deps\build.jl:63
 [2] top-level scope
   @ C:\Users\XXX\.julia\packages\GMT\yRgLc\deps\build.jl:78
 [3] include(fname::String)
   @ Main .\sysimg.jl:38
 [4] top-level scope
   @ none:5
in expression starting at C:\Users\XXX\.julia\packages\GMT\yRgLc\deps\build.jl:71

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions