Registry / devops / bare-make

bare-make

JSON →
library1.7.2jsnpmunverified

bare-make is an opinionated build system generator designed to simplify the CMake workflow by enforcing a consistent build environment. It leverages CMake to generate build files specifically for Ninja, utilizing Clang as the compiler toolchain across all supported operating systems. This approach ensures highly reliable and reproducible compilation processes by standardizing the build system and compiler. While it imposes these specific tools, it remains fully compatible with standard CMake, allowing developers to easily "eject" to a plain CMake flow if needed. The current stable version is 1.7.2, and it appears to follow an active release cadence tied to its parent organization's projects. Its primary differentiators include its programmatic JavaScript API for build automation and its strong focus on build consistency through fixed toolchains, making it ideal for projects requiring strict build guarantees.

npm install bare-make
INSTALL
IMPORT
SIG · BARE-MAKE
B
bare-make
devopsjavascriptv1.7.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

make
import make from 'bare-make';
import { generate, build } from 'bare-make';
The primary API is exposed as a default export object containing all build functions. Avoid named imports for functions like `generate` or `build` directly from the package root.
make (CJS)
const make = require('bare-make');
CommonJS import for Node.js environments, as shown in the package README. This is fully supported.
GenerateOptions
import type { GenerateOptions } from 'bare-make';
import { GenerateOptions } from 'bare-make';
Import types explicitly for use in TypeScript projects to ensure correct type checking without bundling issues. Using `import` without `type` for interfaces can lead to runtime errors or unnecessary code in some environments.

Demonstrates the full programmatic workflow of generating, building, installing, and testing a CMake project using bare-make's API, including verbose output and parallel execution.

import make from 'bare-make'; import path from 'path'; import os from 'os'; async function runBuildProcess() { // Define your project's root, build directory, and install prefix const projectRoot = process.cwd(); // Or specify a different path const buildDir = path.join(projectRoot, 'build-bare-make'); const installPrefix = path.join(projectRoot, 'dist-prebuilds'); console.log(`Starting bare-make build process in: ${projectRoot}`); try { console.log('\n--- Generating build system ---'); // Generate build files for Ninja using Clang, enabling debug symbols await make.generate({ source: projectRoot, build: buildDir, platform: os.platform(), arch: os.arch(), debug: true, // Configure a debug build verbose: true, // Enable verbose output for generation stdio: 'inherit' // Stream output directly to console }); console.log(`Build system successfully generated in: ${buildDir}`); console.log('\n--- Building project ---'); // Build all targets in parallel await make.build({ build: buildDir, target: 'all', // Build all targets defined in CMakeLists.txt parallel: os.cpus().length, // Use all available CPU cores verbose: true, stdio: 'inherit' }); console.log('Project built successfully.'); console.log('\n--- Installing artifacts ---'); // Install built artifacts to a specified prefix await make.install({ build: buildDir, prefix: installPrefix, verbose: true, stdio: 'inherit' }); console.log(`Artifacts installed to: ${installPrefix}`); console.log('\n--- Running tests (if enabled) ---'); // Run CTest tests if enabled in CMakeLists.txt await make.test({ build: buildDir, timeout: 60, // Max 60 seconds per test parallel: os.cpus().length, verbose: true, stdio: 'inherit' }); console.log('Tests completed.'); } catch (error) { console.error('\nBuild process failed:', error.message); process.exit(1); } } runBuildProcess();
bare-make --version
Debug
Known issues
gotchabare-make explicitly enforces the use of Ninja as the build system generator and Clang as the compiler toolchain. Projects expecting to use other compilers (e.g., GCC, MSVC) or alternative build systems (e.g., Makefiles, Visual Studio) will need to adapt their `CMakeLists.txt` or use plain CMake directly.
fix
Ensure your project's CMake configuration is compatible with Clang and Ninja. If specific toolchains are non-negotiable, consider using CMake directly without `bare-make` or using its 'eject' capability.
affects: >=1.0.0
gotchabare-make relies on CMake, Ninja, and Clang being pre-installed and discoverable in the system's PATH. It does not bundle or automatically install these fundamental underlying tools itself.
fix
Before using `bare-make`, ensure that CMake (version 3.15+ recommended), Ninja, and Clang are correctly installed on your development and CI/CD systems and are accessible via the system's PATH environment variable.
affects: >=1.0.0
gotchaThe package lists 'bare-pipe' as a peer dependency (`"bare-pipe": "*"`). While not a direct runtime dependency that `npm install` would automatically fetch, it is crucial for `bare-make`'s internal process management and might require explicit installation by the user (`npm install bare-pipe`).
fix
Ensure 'bare-pipe' is installed alongside 'bare-make' in your project. Check for any version compatibility requirements if encountering process-related issues, especially those related to standard I/O redirection or child process management.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Command failed with exit code 1: cmake ... (or ninja ... or clang ...)
Underlying build tools (CMake, Ninja, or Clang) are either not found in the system's PATH, or there's a fundamental configuration error within your CMake project's `CMakeLists.txt`.
fix
First, verify that CMake, Ninja, and Clang are installed and added to your system's PATH. If they are, enable verbose output (`verbose: true` in options, `stdio: 'inherit'`) to see the exact command output and diagnose `CMakeLists.txt` errors.
Error: Source directory '...' does not contain a CMakeLists.txt file.
The `source` option provided to `make.generate()` or via the CLI points to a directory that does not contain a `CMakeLists.txt` file, which is the required entry point for a valid CMake project.
fix
Adjust the `source` option to correctly point to the root directory of your CMake project where the primary `CMakeLists.txt` file is located. This is typically the directory containing your project's top-level build definition.
Error: Target '...' not found
The specified `target` in `make.build()` (or via the `--target` CLI flag) does not exist in your CMake project. Common targets include 'all', 'install', or names of executables/libraries you define.
fix
Review your `CMakeLists.txt` files to identify the correct target names. Use `cmake --build <build-dir> --target help` from the command line to list available targets if you are unsure.
Upgrade
Version history
1.7.2latest on npm
Audit
Dependencies
bare-piperequiredPeer dependency required for internal process management and stdio redirection.
Agent activity
2 hits · last 30 days
node
2
Resources
bare-make — npm install bare-make · libregistry