diff options
author | 2023-07-23 08:24:59 +0300 | |
---|---|---|
committer | 2023-07-22 22:24:59 -0700 | |
commit | ce9bba9dd560300c5ab800a9bf932425b251b75b (patch) | |
tree | 27e039d99a30df093661c475bab3388f4400b102 | |
parent | e2e44661c2e5bb96ef70df4e6e68b05e19ec36c7 (diff) | |
download | bun-ce9bba9dd560300c5ab800a9bf932425b251b75b.tar.gz bun-ce9bba9dd560300c5ab800a9bf932425b251b75b.tar.zst bun-ce9bba9dd560300c5ab800a9bf932425b251b75b.zip |
Update `development.md` (#3718)
* Update `development.md`
* Update `development.md`
-rw-r--r-- | docs/project/development.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/project/development.md b/docs/project/development.md index 4849f1780..2a3630a12 100644 --- a/docs/project/development.md +++ b/docs/project/development.md @@ -260,6 +260,39 @@ $ git checkout <hash> ## Troubleshooting +### 'span' file not found on Ubuntu + +> ⚠️ Please note that the instructions below are specific to issues occurring on Ubuntu. It is unlikely that the same issues will occur on other Linux distributions. + +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: + +``` +fatal error: 'span' file not found +#include <span> + ^~~~~~ +``` + +To fix the error, we need to update the GCC version to 11. To do this, we'll need to check if the latest version is available in the distribution's official repositories or use a third-party repository that provides GCC 11 packages. Here are general steps: + +```bash +$ sudo apt update +$ sudo apt install gcc-11 g++-11 +# If the above command fails with `Unable to locate package gcc-11` we need +# to add the APT repository +$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +# Now run `apt install` again +$ sudo apt install gcc-11 g++-11 +``` + +Now, we need to set GCC 11 as the default compiler: + +```bash +$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 +$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 +``` + ### libarchive If you see an error when compiling `libarchive`, run this: |