Run Envision builds in Podman containers
linux vr oci podman
1
fork

Configure Feed

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

move build shim into shim/

There will be a seperate shim for runtime, so it's nice to keep them
both together in a single directory.

+43 -44
+2 -2
pkg.nu
··· 24 24 chmod 744 pkg/uninstall.nu 25 25 26 26 mkdir pkg/oci-shim 27 - cp ($src | path join "shim.nu") pkg/oci-shim/cmake 28 - cp ($src | path join "shim.nu") pkg/oci-shim/cargo 27 + cp ($src | path join "shim/build.nu") pkg/oci-shim/cmake 28 + cp ($src | path join "shim/build.nu") pkg/oci-shim/cargo 29 29 chmod 744 pkg/oci-shim/* 30 30 31 31 http get $"https://gitlab.com/gabmus/envision/-/jobs/($job)/artifacts/raw/Envision-x86_64.AppImage"
-42
shim.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # Copyright (c) 2026 MatrixFurry <matrix@matrixfurry.com> 4 - 5 - # The purpose of this shim is to make Envision build software in a OCI container, with preinstalled build dependencies. 6 - # Just rename this script to the desired build tool, then prepend it to Envision's PATH environment variable. It will 7 - # run instead of the system build tool. 8 - 9 - use std log 10 - 11 - const cmd = path self | path basename 12 - const image = "registry.gitlab.com/matrixfurry/xr-packages/xr-multi:latest" 13 - 14 - def main --wrapped [...args] { 15 - let args = $args | where ($it | is-not-empty) 16 - 17 - # HACK: I don't exactly know why the source path gets appended to the command line 18 - let last_as_workdir = $cmd == "cmake" and $args.0 == "-B" 19 - let workdir = if $last_as_workdir { 20 - $args | last 21 - } else { 22 - pwd 23 - } 24 - let args = if $last_as_workdir { 25 - $args | drop 1 26 - } else { 27 - $args 28 - } 29 - 30 - log info $"Working directory: ($workdir)" 31 - log info $"Running in OCI container via shim: ($cmd) ($args | str join ' ')" 32 - 33 - # TODO: Use image from AtomicXR container registry 34 - podman run ...[ 35 - --security-opt label=disable 36 - --security-opt apparmor=unconfined 37 - -v $"($env.HOME):($env.HOME)" 38 - --workdir $workdir 39 - --env=PWD=$workdir 40 - --rm 41 - ] $image $cmd ...$args 42 - }
+41
shim/build.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2026 MatrixFurry <matrix@matrixfurry.com> 4 + 5 + # The purpose of this shim is to make Envision build software in a OCI container, with preinstalled build dependencies. 6 + # Just rename this script to the desired build tool, then prepend it to Envision's PATH environment variable. It will 7 + # run instead of the system build tool. 8 + 9 + use std log 10 + 11 + const cmd = path self | path basename 12 + const image = "registry.gitlab.com/matrixfurry/xr-packages/xr-multi:latest" 13 + 14 + def main --wrapped [...args] { 15 + let args = $args | where ($it | is-not-empty) 16 + 17 + # HACK: I don't exactly know why the source path gets appended to the command line 18 + let last_as_workdir = $cmd == "cmake" and $args.0 == "-B" 19 + let workdir = if $last_as_workdir { 20 + $args | last 21 + } else { 22 + pwd 23 + } 24 + let args = if $last_as_workdir { 25 + $args | drop 1 26 + } else { 27 + $args 28 + } 29 + 30 + log info $"Working directory: ($workdir)" 31 + log info $"Running in OCI container via shim: ($cmd) ($args | str join ' ')" 32 + 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 + ] $image $cmd ...$args 41 + }