jlgerber / pes

package environment system - written in rust, leveraging new pubgrub crate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PES The Package Environment System

TODOs

  • implement parser from str to Range
  • implement parser from str to Range
  • design a manifest for a pes package
  • implement a reader for the manifest
  • define a package repository to store manifests
  • write a caching package version provider

Design

package manifest

schema: 1

name: mypackage

version: 1.2.3

description: >
    this is the description

targets:
    run:
        requires:
            maya-plugins: ^4.3
            gcc: 4.3.2
    build:
        include-target:
            - run
        requires:
            maya: 1.2.3+<4
environment:
    LD_LIBRARY_PATH: "prepend({root}/foo/bar)"

toml version

schema = 1

name = "mypackage"

version = "1.2.3"

description  = """
The best table ever \
if you know what I mean"""

[target.run]

include-targets = [
    "run"
]

[target.run.requires]
maya-plugins = "^4.3"

[environment]
LD_LIBRARY_PATH = 'prepend(${root}/foo/bar)'

Rust

struct PackageManifest {
    schema: u32,
    name: String,
    version: SemanticVersion,
    description: String,
    targets: HashMap<String, PackageTarget>
}

struct PackageRange {
    package: String,
    range: Range<SemanticVersion>
}

struct PackageTarget {
    name: String,
    include: Option<String>,
    requires: IndexMap<String, Range<SemanticVersion>>
}

thoughts

How will the system work in practice?

There are a number of things that one needs to know when extending a manifest to act as a context:

1 - version - trivial as the manifest already has the info 2 - package name - trivial as the manifest already has the info 3 - package root - how do we record this? Do we brand the manifest at install time? 4 - base environment - what is the set of environment variables that are needed? How is this communicated? (trait?)

The lockfile

We need to be able to serialize and deserialize data

needed fields

In addition to storing the actual solution, we need to consider the following:

  • the solve request (eg what did we solve)
  • the solve timestamp
  • the author

We should key the solve to the target as well:

schema = 1
request = "pes env -d foo-1.0.1 -t build"
timestamp = some timestamp goes here
author = jgerber

[lock.run]
foo = "1.2.3"
bar = "2.4.3"

[lock.build]
foo = "1.2.4"
bar = "2.0.1"
somelib = "1.2.3"

Running pes

 env PES_PACKAGE_REPO_PATH=/home/jgerber/src/rust/pes/test_fixtures/repo cargo run --release --bin pes -- shell  bar-1.0.1

About

package environment system - written in rust, leveraging new pubgrub crate


Languages

Language:Rust 99.5%Language:Makefile 0.5%