Skip to content

Implement a better build system #78

@samvv

Description

@samvv

Right now the Python script that builds Bolt is just an ugly file full of shortcuts and assumptions. Ideally, we can declaratively specify the build file in a build language that automatically does the caching for us.

This build language could simply be a subset of the Bolt language itself, where each expression is persistently cached on disk. That way, download, unzip and compile only happens once.

Very hypothetical example for LLVM:

let source = 
    download f"https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-{version}.tar.gz"
  |> extract ~strip_components:1

let configure
    ~version:string
    ~prefix:string
    ?(assertions = false)
    ?(targets: llvm_target[] = [ Host ])
  = cmake_generate
      (source version)
      ~defines:{
        "CMAKE_INSTALL_PREFIX" = prefix,
        "LLVM_ENABLE_ASSERTIONS" = assertions,
        "LLVM_TARGETS_TO_BUILD" = ";".join(targets),
      }

let build *args = configure *args |> cmake_build

let package *args =
  build *args ~prefix=install_dir |> cmake_install

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpriority:lowIf possible, oher issues should be taken care of first
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions