pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bob v0.1.0 ready for beta testing





On Mon, 22 Dec 2025, Jonathan Perkin wrote:

It's now at the stage where it works reasonably well across NetBSD, Linux, and SunOS, and I'd like to get some user feedback on what features you'd like, what doesn't work, what needs better docs, etc.

I just tried it out. Scanning went well but building did not.

libnbcompat, which is the first package built, fails with

mkdir: /usr/pkgsrc/pkgtools/libnbcompat/work: Read-only file system
*** Error code 1

Stop.
make: stopped making "all" in /usr/pkgsrc/pkgtools/libnbcompat

This is weird because the config file (see attachment) specifies WRKOBJDIR. Any ideas?

--
Benny
-- Example configuration file for NetBSD.

-- Common variables
local initdir = "/home/bsiegert/bob-test"

-- General configuration variables.
options = {
    build_threads = 7,
    scan_threads = 25,
    verbose = true,
}

-- Variables that configure pkgsrc, where it is, what packages to build, etc.
pkgsrc = {
    basedir = "/usr/pkgsrc",
    logdir = initdir .. "/logs",
    make = "/usr/bin/make",
    packages = initdir .. "/packages",
    pkgtools = "/usr/sbin",
    pkgpaths = {
        "mail/mutt",
        "sysutils/coreutils",
    },
    prefix = "/usr/pkg",
    tar = "/bin/tar",

    -- It is strongly recommended to set up an unprivileged user to perform
    -- builds. If you do, ensure that their home directory is created inside
    -- the sandbox and that work directories are writeable.
    -- build_user = "builder",

    -- Set environment variables for scan processes. This is deliberately
    -- separate from env as only a few specific variables are useful here.
    -- Only add pre-computed variables to avoid forking and speed up scans.
    scanenv = {
        NATIVE_OPSYS = "NetBSD",
        -- NATIVE_OPSYS_VERSION = "<insert correct value>",
        -- NATIVE_OS_VERSION = "<insert correct value>",
    },

    -- Set environment variables for each build. The pkg object allows you to
    -- perform powerful matching against data from the scan to set variables
    -- on a per-package basis.
    env = function(pkg)
        local env = {}
        env.DISTDIR = basedir .. "/distfiles"
        env.MAKE_JOBS = 4
        env.WRKOBJDIR = "/usr/obj/pkgsrc"

        -- Set MAKE_JOBS higher for lang/rust builds
        -- if pkg.pkgpath == "lang/rust" then
        --     env.MAKE_JOBS = "8"
        -- end

        -- Use disk-based WRKOBJDIR for packages that depend on Go
        -- if pkg.scan_depends:match("/lang/go/") then
        --     env.WRKOBJDIR = "/home/builder/build-disk"
        -- end

        return env
    end,
}

scripts = {
    ["pre-build"] = initdir .. "/scripts/pre-build",
    ["pkg-build"] = initdir .. "/scripts/pkg-build",
    ["post-build"] = initdir .. "/scripts/post-build",
}

-- The sandboxes section defines where sandboxes should be created, and how file
-- systems and ancilliary data should be created.
--
-- The number of sandboxes that will be created is build_threads if set,
-- otherwise 1.
--
-- During creation the actions list is processed in order, and when destroying
-- sandboxes it is processed in reverse order.
sandboxes = {
    -- basedir = "/data/chroot",
    -- basedir = initdir .. "/chroot",
    basedir = "/usr/obj/chroot",

    actions = {
        -- NetBSD does not have devfs; device nodes are created via MAKEDEV.
        -- The cwd is relative to the sandbox (e.g., /dev means $SANDBOX/dev).
        -- Commands run on the host, so /dev/MAKEDEV refers to the host file.
        { action = "cmd", cwd = "/dev",
          create = "cp /dev/MAKEDEV /dev/MAKEDEV.local . && ./MAKEDEV all",
          destroy = "rm -rf *" },

        { action = "mount", fs = "proc", dir = "/proc" },
        { action = "mount", fs = "tmp", dir = "/tmp" },
        { action = "mount", fs = "tmp", dir = "/var/tmp" },
        { action = "cmd", create = "chmod 1777 tmp var/tmp" },

        { action = "copy", dir = "/etc" },

        -- System directories (read-only for safety)
        { action = "mount", fs = "null", dir = "/bin", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/sbin", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/libexec", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/lib", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/X11R7", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/bin", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/games", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/include", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/lib", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/libdata", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/libexec", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/share", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/usr/sbin", opts = "-o ro" },
        { action = "mount", fs = "null", dir = "/var/mail", opts = "-o ro" },

        { action = "mount", fs = "null", dir = pkgsrc.basedir, opts = "-o ro" },

        -- Directory where this config and support scripts live.
        { action = "mount", fs = "null", dir = initdir },
    },
}


Home | Main Index | Thread Index | Old Index