Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ A Nix flake is provided as an alternative to manual dependency installation:

```bash
nix develop
# or explicitly use the pure shell
# nix develop .#pure
export CMAKE_SYSTEM_PROCESSOR=$(uname -m)
bun bd
```

Expand Down Expand Up @@ -150,7 +147,7 @@ $ export PATH="$PATH:/usr/lib/llvm21/bin"

## Building Bun

After cloning the repository, run the following command to build. This may take a while as it will clone submodules and build dependencies.
After cloning the repository, run the following command to build. This may take a while as it downloads and builds dependencies.

```bash
$ bun run build
Expand Down Expand Up @@ -305,15 +302,15 @@ Note that if you make changes to our [WebKit fork](https://github.com/oven-sh/We

The Clang compiler typically uses the `libstdc++` C++ standard library by default. `libstdc++` is the default C++ Standard Library implementation provided by the GNU Compiler Collection (GCC). While Clang may link against the `libc++` library, this requires explicitly providing the `-stdlib` flag when running Clang.

Bun relies on C++20 features like `std::span`, which are not available in GCC versions lower than 11. GCC 10 doesn't have all of the C++20 features implemented. As a result, running `make setup` may fail with the following error:
Bun relies on C++20 features like `std::span`, which are not available in GCC versions lower than 11. GCC 10 doesn't have all of the C++20 features implemented. As a result, running `bun run build` may fail with the following error:

```
fatal error: 'span' file not found
#include <span>
^~~~~~
```

The issue may manifest when initially running `bun setup` as Clang being unable to compile a simple program:
The issue may manifest when initially running `bun run build` as Clang being unable to compile a simple program:

```
The C++ compiler
Expand Down Expand Up @@ -363,7 +360,7 @@ $ xcode-select --install
Bun defaults to linking `libatomic` statically, as not all systems have it. If you are building on a distro that does not have a static libatomic available, you can run the following command to enable dynamic linking:

```bash
$ bun run build -DUSE_STATIC_LIBATOMIC=OFF
$ bun run build --static-libatomic=off
```

The built version of Bun may not work on other systems if compiled this way.
Expand Down
9 changes: 0 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@
export CXX="${pkgs.lib.getExe' clang "clang++"}"
export AR="${llvm}/bin/llvm-ar"
export RANLIB="${llvm}/bin/llvm-ranlib"
export CMAKE_C_COMPILER="$CC"
export CMAKE_CXX_COMPILER="$CXX"
export CMAKE_AR="$AR"
export CMAKE_RANLIB="$RANLIB"
export CMAKE_SYSTEM_PROCESSOR="$(uname -m)"
export TMPDIR="''${TMPDIR:-/tmp}"
'' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
export LD="${pkgs.lib.getExe' lld "ld.lld"}"
Expand All @@ -166,10 +161,6 @@
echo " bun bd test <test-file> # Run tests"
echo "====================================="
'';

# Additional environment variables
CMAKE_BUILD_TYPE = "Debug";
ENABLE_CCACHE = "1";
};
}
);
Expand Down
5 changes: 0 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ pkgs.mkShell rec {
export CXX="${pkgs.lib.getExe' pkgs.clang_21 "clang++"}"
export AR="${pkgs.llvm_21}/bin/llvm-ar"
export RANLIB="${pkgs.llvm_21}/bin/llvm-ranlib"
export CMAKE_C_COMPILER="$CC"
export CMAKE_CXX_COMPILER="$CXX"
export CMAKE_AR="$AR"
export CMAKE_RANLIB="$RANLIB"
export CMAKE_SYSTEM_PROCESSOR=$(uname -m)
export TMPDIR=''${TMPDIR:-/tmp}
'' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
export LD="${pkgs.lib.getExe' pkgs.lld_21 "ld.lld"}"
Expand Down