### Start ZooKeeper Server Source: https://github.com/pkgxdev/pantry/blob/main/projects/apache.org/zookeeper/README.md Set the configuration directory and start the ZooKeeper server. ```bash export ZOOCFGDIR=/path/to/your/config zkServer start ``` -------------------------------- ### Run Make Commands Source: https://github.com/pkgxdev/pantry/wiki/Building-for-Your-Language Use make commands for building and installing packages. `hw.concurrency` represents the number of CPU cores, and `prefix` is the package installation path. ```bash make --jobs {{ hw.concurrency }} make prefix={{ prefix }} install ``` -------------------------------- ### Install OpenBao with pkgx Source: https://github.com/pkgxdev/pantry/blob/main/projects/openbao.org/openbao/README.md Use this command to install OpenBao and its necessary configuration files using pkgx. It handles the creation of directories and copying of environment and service files. ```bash # pkgx +openbao.org/openbao bao-setup Package directory /root/.pkgx/openbao.org/openbao/v2.0.1 install: creating directory '/etc/openbao' '/root/.pkgx/openbao.org/openbao/v2.0.1/etc/openbao/openbao.env' -> '/etc/openbao/openbao.env' '/root/.pkgx/openbao.org/openbao/v2.0.1/etc/openbao/openbao.hcl' -> '/etc/openbao/openbao.hcl' '/root/.pkgx/openbao.org/openbao/v2.0.1/etc/systemd/system/openbao.service' -> '/etc/systemd/system/openbao.service' ``` -------------------------------- ### Clone Pantry and Initialize Dev Environment Source: https://github.com/pkgxdev/pantry/blob/main/README.md Clone the pkgx pantry repository and set up the development environment using 'dev' to install brewkit. ```sh $ git clone https://github.com/pkgxdev/pantry $ cd pantry $ dev # https://docs.pkgx.sh/dev # ^^ adds brewkit (ie. the `bk` command) to your devenv # ^^ IMPORTANT! Otherwise the `bk` command will not be found # ^^ Alternatively, you can use pkgx and prefix your commands with the ENV # ^^ PKGX_PANTRY_PATH=$(pwd) pkgx bk [command] (PKGX_PANTRY_DIR for pkgx^2) ``` -------------------------------- ### Start Colima Source: https://github.com/pkgxdev/pantry/blob/main/projects/docker.com/cli/README.md Execute this command to start Colima. Replace with your desired Colima instance name. ```bash colima start ``` -------------------------------- ### Install glauth using pkgx Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/glauth/glauth/README.md This command installs glauth and its dependencies using pkgx. It copies configuration files to the appropriate system directories. ```bash # pkgx +github.com/glauth/glauth glauth-setup Package directory /root/.pkgx/github.com/glauth/glauth/v2.4.0 install: creating directory '/etc/glauth' '/root/.pkgx/github.com/glauth/glauth/v2.4.0/etc/glauth/glauth.env' -> '/etc/glauth/glauth.env' '/root/.pkgx/github.com/glauth/glauth/v2.4.0/etc/glauth/glauth.toml' -> '/etc/glauth/glauth.toml' '/root/.pkgx/github.com/glauth/glauth/v2.4.0/etc/systemd/system/glauth.service' -> '/etc/systemd/system/glauth.service' ``` -------------------------------- ### Pantry Recipe for Binutils Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Example of how to extend pantry recipes for older Binutils versions. Requires accepting older tarball extensions. ```text - **`gnu.org/binutils` `~2.28 || ~2.30 || ~2.31 || ~2.32`** — extend `versions:` and `distributable:` to accept the older tarball extensions (`.tar.gz` and `.tar.bz2` instead of `.tar.xz`). ``` -------------------------------- ### Minimal SIMD Program Example Source: https://github.com/pkgxdev/pantry/blob/main/projects/go.dev/dev-simd/README.md A basic Go program demonstrating the use of simd/archsimd package for vector addition. ```go package main import ( "fmt" "simd/archsimd" ) func main() { // 4-wide u32 vector add (NEON on arm64, SSE/AVX on amd64) a := archsimd.LoadUint32x4([]uint32{1, 2, 3, 4}) b := archsimd.LoadUint32x4([]uint32{10, 20, 30, 40}) var out [4]uint32 a.Add(b).Store(out[:]) fmt.Println(out) // [11 22 33 44] } ``` -------------------------------- ### Start OpenCanary Service Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/thinkst/opencanary/README.md Starts the OpenCanary service after configuration. This command should be run as root or with sudo -E. ```bash $ pkgx opencanaryd --start ``` -------------------------------- ### Copy Sample OpenCanary Configuration Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/thinkst/opencanary/README.md Copies a sample configuration file to /etc/opencanaryd/opencanary.conf. This should be run as root. After copying, edit the configuration file before starting OpenCanary. ```bash $ pkgx opencanaryd --copyconfig [*] A sample config file is ready /etc/opencanaryd/opencanary.conf [*] Edit your configuration, then launch with "pkgx opencanaryd --start" ``` -------------------------------- ### Example package.yml Structure Source: https://github.com/pkgxdev/pantry/wiki/Home A basic structure for a package.yml file, including distributable URL, version, build script, and test script. ```yaml distributable: url: https://example.com/download/{{version}}/src.tar.gz strip-components: 1 versions: - 1.0.0 build: script: | touch "{{prefix}}"/example # ^^ this script must install something to `{{prefix}}` or the build will be failed! test: script: | ls -l ``` -------------------------------- ### Pantry Recipe for GCC Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Example of how to extend pantry recipes for older GCC versions. Requires accepting old tags and applying specific build flags and patching. ```text - **`gnu.org/gcc` `~7.5 || ~9.5`** — extend `versions:` to accept old tags; add per-version `script:` step prepending CC/CXX with bottle-as-sysroot flags, applying `--disable-bootstrap --disable-lto --disable-plugin` for these older versions, and post-build patching the specs file + `include-fixed/bits/{fcntl-linux,statx,...}.h`. ``` -------------------------------- ### Node.js Console Log Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md A simple example of printing a string to the console using Node.js. ```js console.log("Hello, World!"); ``` -------------------------------- ### PHP Echo Statement Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md A basic example of echoing a string using PHP. ```php echo "Hello, World!"; ``` -------------------------------- ### Self-Call Example Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md Illustrates calling another Mask command named 'test1' from within a Maskfile. ```sh $MASK test1 ``` -------------------------------- ### Glibc Bootstrap Cascade Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Outlines the sequential build process for older GCC versions, starting from a modern GCC and cascading down to older compatible versions. ```text ```text pkgx gcc 16 →builds→ gcc 14 →builds→ gcc 12 (already at pkgx) gcc 12 →builds→ gcc 10 (already at pkgx) gcc 10 →builds→ gcc 9 (untested, likely OK; C++ std OK) gcc 9 →builds→ gcc 7 (untested; gcc 7 needs older C++ ABI bits) gcc 7 →builds→ gcc 5 (gcc 5 needs C++03 not C++11) gcc 5 →builds→ gcc 4.8 (gcc 4.8 needs gcc ≥ 3.4) ``` ``` -------------------------------- ### Pull and Run a Docker Container Source: https://github.com/pkgxdev/pantry/blob/main/projects/docker.com/cli/README.md Once Colima is running and the context is set, you can use standard Docker commands to manage containers. This example pulls the nginx image and runs it in detached mode, mapping port 80. ```bash docker pull nginx docker run -d -p 80:80 nginx ``` -------------------------------- ### Find Xcode Manpage Directories Source: https://github.com/pkgxdev/pantry/blob/main/projects/man-db.gitlab.io/man-db/README.md This command finds all directories within the Xcode installation that contain manpages and formats them into a colon-separated list suitable for the MANPATH environment variable. ```bash find $(xcode-select -p) -type d | /usr/bin/grep '/usr/share/man$' | /usr/bin/tr -s '\n' ':' ; echo ``` -------------------------------- ### Initialize a New Package Source: https://github.com/pkgxdev/pantry/wiki/Home Use the 'bk init' command to create a new package.yml file. You can create a generic 'wip' package or specify a package name. ```sh $ bk init # ^^ creates a new “wip” package # or… $ bk init foo.com # ^^ creates ./projects/foo.com/package.yml ``` -------------------------------- ### Clone the Pantry and Initialize Development Environment Source: https://github.com/pkgxdev/pantry/wiki/Home Clone the pantry repository and set up the development environment using the 'dev' command. ```sh git clone https://github.com/pkgxdev/pantry cd pantry dev ``` -------------------------------- ### Inspect Package Provides and Run Package Source: https://github.com/pkgxdev/pantry/blob/main/README.md Use 'pkgx yq' to inspect the 'provides' key in a package.yml. Once defined, packages can be run directly if they are in the pantry 'dev' environment. ```sh $ pkgx yq .provides /dev/null; then FPATH=$ZSH_COMPLETIONS_ROOT/share/zsh-completions:$FPATH autoload -Uz compinit compinit fi ``` -------------------------------- ### Fork, Branch, Push, and Create PR Source: https://github.com/pkgxdev/pantry/blob/main/README.md Standard GitHub workflow for contributing: fork the repository, create a new branch, push your changes, and create a pull request. ```sh $ gh repo fork $ git branch -m my-new-package $ git push origin my-new-package $ gh pr create ``` -------------------------------- ### Contribute to the Pantry Source: https://github.com/pkgxdev/pantry/wiki/Home Push your changes and create a pull request. CI/CD will build and test on all supported platforms. Packages must be relocatable. ```sh # PKGX_PREFIX=~/scratch/pkgx sh <(curl pkgx.sh) ``` -------------------------------- ### Export Kaggle Username and API Key as Environment Variables Source: https://github.com/pkgxdev/pantry/blob/main/projects/kaggle.com/README.md Sets the Kaggle username and API key as environment variables. This is an alternative to using the `kaggle.json` file. ```bash export KAGGLE_USERNAME=datadinosaur export KAGGLE_KEY=xxxxxxxxxxxxxx ``` -------------------------------- ### Build and Test SIMD Go Code Source: https://github.com/pkgxdev/pantry/blob/main/projects/go.dev/dev-simd/README.md Compile and run tests for Go code that utilizes SIMD intrinsics. Ensure the GOEXPERIMENT=simd flag is set. ```sh # build / run SIMD code (set the experiment flag) GOEXPERIMENT=simd pkgx +go.dev/dev-simd -- go build ./... GOEXPERIMENT=simd pkgx +go.dev/dev-simd -- go test ./... ``` -------------------------------- ### Test a Package Source: https://github.com/pkgxdev/pantry/wiki/Home Run the tests defined in the package.yml to verify the package's functionality using the 'bk test' command. ```sh bk test ``` -------------------------------- ### Python Print Statement Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md Demonstrates printing a string to standard output using Python. ```python print("Hello, World!") ``` -------------------------------- ### Troubleshoot Build Issues Source: https://github.com/pkgxdev/pantry/wiki/Home Step into the build directory to manually edit and run the build script, or execute build commands directly for debugging. ```sh # TIP: If you need to create the env of the pkg then step into the build directory, edit the build script # and remove everything but the `export` commands, then source it (`source dev.pkgx.build.sh`) ``` -------------------------------- ### Convert Models using convert.py Script Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/ggerganov/llama.cpp/README.md Convert your own models using the provided 'convert.py' script from the llama.cpp project. This requires launching the script within a specific pkgx environment. The '--' is necessary because 'convert.py' is not explicitly listed in the llama.cpp package. ```sh pkgx +llama-cli -- convert.py path/to/your/model ``` -------------------------------- ### Package Versions Array Source: https://github.com/pkgxdev/pantry/wiki/Structure-of-a-`package.yml` Defines a list of available package versions. ```yaml versions: - 1.1.0 - 1.1.2 - 1.2.0 ``` -------------------------------- ### Empirical Build of GCC 9.5.0 Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Details the successful build of GCC 9.5.0 on Linux/aarch64 using a modern toolchain as a sysroot, including build flags and post-build adjustments. ```text 3. **`gnu.org/gcc` 9.5.0** — **empirically built** on linux/aarch64 using pkgx-gcc 16 + glibc-2.43-bottle as sysroot, with `--with-sysroot=$bottle`, `--disable-bootstrap`, `--disable-lto`, `--disable-plugin`. 488 MB self-contained bottle. After build, `patchelf --set-rpath $libpath` on `cc1`/`cc1plus` makes it work without `LD_LIBRARY_PATH`. C and C++ smoke tests pass (`exit=42`, `iostream` "hi"). ``` -------------------------------- ### Package Platforms Whitelist Source: https://github.com/pkgxdev/pantry/wiki/Structure-of-a-`package.yml` Specifies allowed platforms for building a package. Useful when a package cannot be built on all platforms. ```yaml platform: - darwin - linux/aarch64 ``` -------------------------------- ### Specify Specific Toolchain Version Source: https://github.com/pkgxdev/pantry/blob/main/projects/go.dev/dev-simd/README.md Access a specific snapshot of the Go dev.simd toolchain using its CalVer-style version. ```sh pkgx +go.dev/dev-simd@2026.6.1.17.4.35 -- go version # a specific snapshot ``` -------------------------------- ### Export Kaggle Configuration Variables Source: https://github.com/pkgxdev/pantry/blob/main/projects/kaggle.com/README.md Allows exporting other Kaggle configuration values as environment variables. The variable name should be prefixed with 'KAGGLE_' and follow the format of the configuration key. ```bash export KAGGLE_PROXY ``` -------------------------------- ### Edit Package Configuration Source: https://github.com/pkgxdev/pantry/wiki/Home Open the package.yml file for the currently worked-on package in your default editor using 'bk edit'. ```sh bk edit ``` -------------------------------- ### Glibc Version Verification Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Confirms the Glibc version after bootstrapping on different hosts. Used to verify the success of the cascaded build process. ```text glibc-2.17 aarch64: gnu_get_libc_version() = 2.17 (3/3 hosts) ``` ```text glibc-2.24 aarch64: gnu_get_libc_version() = 2.24 (3/3 hosts) ``` ```text glibc-2.17 x86-64: gnu_get_libc_version() = 2.17 (3/3 hosts) ``` ```text glibc-2.24 x86-64: gnu_get_libc_version() = 2.24 (3/3 hosts) ``` -------------------------------- ### Configure Glibc Build with Sysroot Flags Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md This snippet shows how to set environment variables for GCC and CPP to use a specific Glibc bottle as the system root. It's used to ensure host-independent builds by directing the compiler and linker to use the Glibc bottle's headers and libraries. ```sh SYSROOT_FLAGS=" -nostdinc -isystem $GLIBC_BOTTLE/include -isystem $KERNEL_HEADERS/include -isystem $GCC_BOTTLE/lib/gcc/$TRIPLE/$GCC_V/include -B $GLIBC_BOTTLE/lib -Wl,--dynamic-linker=$GLIBC_BOTTLE/lib/ld-linux-.so. -Wl,--rpath=$GLIBC_BOTTLE/lib " CC="gcc $SYSROOT_FLAGS" CPP="gcc $SYSROOT_FLAGS -E" \ ./configure ... ``` -------------------------------- ### Run llama-cli with Default Chat Prompt Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/ggerganov/llama.cpp/README.md Execute the llama-cli with a default Hugging Face model for chat interactions. This command leverages pkgx to manage the environment and dependencies. ```sh $ pkgx +brewkit -- run llama-cli ``` -------------------------------- ### Run llama-cli with Custom Arguments Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/ggerganov/llama.cpp/README.md Pass custom arguments to the llama-cli when running it via pkgx. The '$ARGS' placeholder allows for flexible command-line usage. ```sh pkgx llama-cli $ARGS ``` -------------------------------- ### Echo with Optional Input Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md Conditionally echoes a greeting based on whether an input variable is provided. If no input is given, it defaults to 'Hello, World!'. ```sh if [ -z "$input" ]; then echo "Hello, World!" else echo "Hello, $input!" fi ``` -------------------------------- ### Set Docker Context to Colima Source: https://github.com/pkgxdev/pantry/blob/main/projects/docker.com/cli/README.md Use this command to set your Docker context to the Colima instance. Replace with your Colima instance name. ```bash docker context use colima- ``` -------------------------------- ### x86-64 Specific Fixes for Bootstrap Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Details extra fixes required for the bootstrap cascade on x86-64, including stripping debug info and specific sysroot configurations for build tools. ```text - `strip --strip-debug` on `libgcc*.a` and `crt*.o` from gcc 7.5 before using them — gcc 7.5 emits zlib-compressed `.debug_info` sections that binutils 2.28's `ld` can't decompress (the zlib decompression support was added in binutils ~2.36). Stripping makes the static archive consumable by old `ld`. ``` ```text - `BUILD_CC="gcc --sysroot=/tmp/sysroot-x86-64-g34 -Wl,--dynamic-linker= /opt/glibc-2.34/lib/ld-linux-x86-64.so.2"` to handle the `rpcgen` bootstrap that needs to link against an old-enough libc. ``` -------------------------------- ### Required Older Toolchain Versions for Glibc Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Lists the specific older versions of GCC, Binutils, and Make that are required to successfully build various Glibc releases. ```text | Package | Versions to add | Use cases | |---|---|---| | `gnu.org/gcc` | 4.8, 5, 7, 8, 9 | Build glibc 2.12 – 2.31 | | `gnu.org/binutils` | 2.22, 2.25, 2.27, 2.31, 2.35 | Same | | `gnu.org/make` | 3.82 | Build glibc ≤ 2.18 without the configure-sed patch | ``` -------------------------------- ### Glibc Build Failures with Modern Toolchains Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md Illustrates common build failures encountered when attempting to build older Glibc versions with modern GCC versions, such as GCC 16, due to changes in C standards compliance and toolchain behavior. ```text - **glibc 2.17** (manylinux2014 / CentOS 7 / HPC) — `configure` fails at "C preprocessor /lib/cpp fails sanity check" + "checking for gcc option to accept ISO C89... unsupported". gcc 16 no longer accepts the `-traditional` / strict-C89 mode the era expected, and `debian:bookworm-slim` does not symlink `/lib/cpp`. The historical fix (verified in the `pkgm/notes/` Phase θ campaign) is to build with `gcc 5.4 + binutils 2.26` on `ubuntu:16.04`, plus a 1-line sed patch to `configure` for the `make 4.x` regex (already in this recipe). - **glibc 2.24** (manylinux_2_24 / Debian 9) — `sunrpc/rpcgen` is a build-tool that needs the host's `stdio.h`. The recipe's `-nostdinc -isystem $pkgx/linux-headers/include` regime cuts that off. Older glibc Makefiles propagated `BUILD_CC` without `-nostdinc`, but configuring that around modern Makefile structure is more than a surgical patch. - **glibc 2.19–2.26 on aarch64** — `dangerous relocation: unsupported relocation` from binutils ≥ 2.40. Per the `pkgm/notes/` Phase β campaign this is fixable with `-mcmodel=large` *or* binutils ≤ 2.31 (paradoxically: older binutils handles old glibc better than newer). ``` -------------------------------- ### Force rebuild zcompdump Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/zsh-users/zsh-completions/README.md Remove the existing zcompdump file and re-run compinit to force a rebuild of completion caches. ```zsh rm -f ~/.zcompdump; compinit ``` -------------------------------- ### Audit Package for Issues Source: https://github.com/pkgxdev/pantry/blob/main/README.md Run 'bk audit' to check for common packaging issues in your package. ```sh $ bk audit # ^^ worth doing an audit to check for common pkging issues ``` -------------------------------- ### Package Dependencies with Platform Specificity Source: https://github.com/pkgxdev/pantry/wiki/Structure-of-a-`package.yml` Defines runtime dependencies, including platform-specific ones. ```yaml dependencies: invisible-island.net/ncurses: 6 darwin: gnu.org/binutils: '*' linux/aarch64: github.com/numactl/numactl: '*' ``` -------------------------------- ### Set File Permissions for Kaggle Credentials Source: https://github.com/pkgxdev/pantry/blob/main/projects/kaggle.com/README.md Ensures that only the owner can read the Kaggle API credentials file. This command is typically used on Unix-based systems. ```bash chmod 600 ~/.kaggle/kaggle.json ``` -------------------------------- ### Checkout and Edit an Existing Pull Request Source: https://github.com/pkgxdev/pantry/blob/main/README.md Use the GitHub CLI to checkout a specific pull request by its number or URL, then open the package for editing. ```sh $ gh pr checkout 123 # or you can copy paste the URL: $ gh pr checkout https://github.com/pkgxdev/pantry/pull/123 # then open for editing: $ bk edit ``` -------------------------------- ### Runtime Environment Variables Source: https://github.com/pkgxdev/pantry/wiki/Structure-of-a-`package.yml` Sets environment variables for runtime execution. ```yaml runtime: env: FOO: bar ``` -------------------------------- ### Echo with Input Variable Source: https://github.com/pkgxdev/pantry/blob/main/projects/crates.io/mask/maskfile.md Shows how to use an input variable within an echo command. ```sh echo "Hello, $input!" ``` -------------------------------- ### Uninstall SFTPGo Systemd Service Source: https://github.com/pkgxdev/pantry/blob/main/projects/sftpgo.com/README.md Use this command to remove the SFTPGo systemd service files and user. Ensure you have the necessary sudo privileges. ```bash sudo rm -r \ /etc/sftpgo/sftpgo.{env,json} \ /etc/systemd/system/sftpgo.service sudo userdel -r _sftpgo ``` -------------------------------- ### Activate zsh-autosuggestions in .zshrc Source: https://github.com/pkgxdev/pantry/blob/main/projects/github.com/zsh-users/zsh-autosuggestions/README.md Add this line to the end of your .zshrc file to enable autosuggestions. Restart your terminal for changes to take effect. ```zsh source $ZSH_AUTOSUGGESTIONS_ROOT/share/zsh-autosuggestions/zsh-autosuggestions.zsh ``` -------------------------------- ### Stop Colima Source: https://github.com/pkgxdev/pantry/blob/main/projects/docker.com/cli/README.md Run this command to stop Colima and shut down the associated Docker instance. ```bash colima stop ``` -------------------------------- ### Glibc Smoke Test Output Source: https://github.com/pkgxdev/pantry/blob/main/projects/gnu.org/glibc/README.md The expected output from the glibc smoke test, verifying the correct version is reported. ```text gnu_get_libc_version() = ``` -------------------------------- ### Stop ZooKeeper Server Source: https://github.com/pkgxdev/pantry/blob/main/projects/apache.org/zookeeper/README.md Stop the ZooKeeper server process. ```bash zkServer stop ``` -------------------------------- ### Initialize Conda Shell Hooks Source: https://github.com/pkgxdev/pantry/blob/main/projects/conda.org/README.md Source Conda shell hooks to enable Conda's environment management features in the current terminal session. This is a temporary solution as there is no provided way to unload these hooks. ```sh source <(conda shell.$(basename $SHELL) hook) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.