summary refs log tree commit diff
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2023-09-06 13:35:02 +0000
committerGitHub <noreply@github.com>2023-09-06 14:35:02 +0100
commit35934b02a98cbb44ba310707a72e55bc4a5c7f0a (patch)
tree1e674263171b3bab9bd6eee9566ed9b8f38a7e89
parentUpdate rust in flake.nix: 1.70.0 -> 1.71.1 to address CVE-2023-38497 (#16260) (diff)
downloadsynapse-35934b02a98cbb44ba310707a72e55bc4a5c7f0a.tar.xz
Add GCC and GNU Make to the Nix flake development environment so that `ruff` can be compiled. (#16090)
* Add gcc and GNU make to the Nix flake

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

* unset LD_LIBRARY_PATH

---------

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
-rw-r--r--changelog.d/16090.misc1
-rw-r--r--flake.nix17
2 files changed, 18 insertions, 0 deletions
diff --git a/changelog.d/16090.misc b/changelog.d/16090.misc
new file mode 100644
index 0000000000..d54ef936c7
--- /dev/null
+++ b/changelog.d/16090.misc
@@ -0,0 +1 @@
+Add GCC and GNU Make to the Nix flake development environment so that `ruff` can be compiled.
\ No newline at end of file
diff --git a/flake.nix b/flake.nix
index dc7ab5b3fe..69c9c19f89 100644
--- a/flake.nix
+++ b/flake.nix
@@ -89,6 +89,10 @@
                   })
                   # The rust-analyzer language server implementation.
                   rust-analyzer
+                  # GCC includes a linker; needed for building `ruff`
+                  gcc
+                  # Needed for building `ruff`
+                  gnumake
 
                   # Native dependencies for running Synapse.
                   icu
@@ -236,6 +240,19 @@
                   URI
                   YAMLLibYAML
                 ]}";
+
+                # Clear the LD_LIBRARY_PATH environment variable on shell init.
+                #
+                # By default, devenv will set LD_LIBRARY_PATH to point to .devenv/profile/lib. This causes
+                # issues when we include `gcc` as a dependency to build C libraries, as the version of glibc
+                # that the development environment's cc compiler uses may differ from that of the system.
+                #
+                # When LD_LIBRARY_PATH is set, system tools will attempt to use the development environment's
+                # libraries. Which, when built against an different glibc version lead, to "version 'GLIBC_X.YY' not
+                # found" errors.
+                enterShell = ''
+                  unset LD_LIBRARY_PATH
+                '';
               }
             ];
           };