XR for Universal Blue and Fedora Atomic Desktops
vr fedora-atomic linux
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

envision: write proper shim

+28 -4
+28 -4
envision/shim.nu
··· 6 6 # Just rename this script to the desired build tool, then prepend it to Envision's PATH environment variable. It will 7 7 # run instead of the system build tool. 8 8 9 + use std log 10 + 9 11 const cmd = path self | path basename 10 12 11 13 def main --wrapped [...args] { 12 - # Replace working directory with /build in commands 13 - let args = $args | str replace -a (pwd) /build 14 + let args = $args | where ($it | is-not-empty) 14 15 15 - # TODO: Use latest image from AtomicXR container registry 16 - podman run -v .:/build localhost/xr-multi:latest $cmd ...$args 16 + # HACK: I don't exactly know why the source path gets appended to the command line 17 + let last_as_workdir = $cmd == "cmake" and $args.0 == "-B" 18 + let workdir = if $last_as_workdir { 19 + $args | last 20 + } else { 21 + pwd 22 + } 23 + let args = if $last_as_workdir { 24 + $args | drop 1 25 + } else { 26 + $args 27 + } 28 + 29 + log info $"Working directory: ($workdir)" 30 + log info $"Running in OCI container via shim: ($cmd) ($args | str join ' ')" 31 + 32 + # TODO: Use image from AtomicXR container registry 33 + podman run ...[ 34 + --security-opt label=disable 35 + --security-opt apparmor=unconfined 36 + -v $"($env.HOME):($env.HOME)" 37 + --workdir $workdir 38 + --env=PWD=$workdir 39 + --rm 40 + ] localhost/xr-multi:latest $cmd ...$args 17 41 }