Skip to content

Julia's target parsing/detecting deserves a refactor #54482

@gbaraldi

Description

@gbaraldi

Julia currently handrolls it's target detection with a very convoluted script that deserves a refactor.

  • We should start using LLVMs TargetParser lib, we already statically link julia to it for some specific uses, and it reduces the burden on us to keep it up to date with new CPUs. (Though it does mean we need to keep up with LLVM to get new cpus being detected). I also am not sure what happens if it doesn't find a CPU and if could we do some fallback logic.
  • Any time this errors we get very weird and obscure errors.
    i.e, if you have a locally built julia with march=native (the default) and try to build a pkgimg for a generic target you get.
Info Given Example was explicitly requested, output will be shown live
ERROR: Unable to find compatible target in cached code image.
Target 0 (sapphirerapids): Rejecting this target due to use of runtime-disabled features

  ✗ Example
  0 dependencies successfully precompiled in 0 seconds

This has probably not been seen before because package images were always just targeting whatever was loaded in the JIT.

  • The code is currently duplicated between aarch64/arm(which we don't even support anymore)/i686/x86_64, which means finding and fixing bugs is way harder than it should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions