about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-22T01·17+0100
committertazjin <mail@tazj.in>2020-07-22T01·28+0000
commit950ba404bef3a0564399d96da09bf78ff0965d09 (patch)
tree94c262c3a0d9f4b4dde32e2611395236d2b1a91f
parent3b02fcb0a7ee5397d2565272d5ded55fd9cc165d (diff)
fix(3p/nix): Fix string escaping issue in schema include r/1418
The SQL schemas are included as string constants which are
concatenated into a header file. In the previous Makefiles, this was
done with envsubst or something - we moved it to CMake.

There was a missing quote around the string to be interpolated, which
meant that CMake interpreted the semicolons as part of its language
syntax and did not emit them.

Change-Id: Ibb4512788b26b53f297db3535094dc0194614446
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1342
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
-rw-r--r--third_party/nix/src/libstore/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/CMakeLists.txt b/third_party/nix/src/libstore/CMakeLists.txt
index 705be9574d2f..bfc6b4eb5947 100644
--- a/third_party/nix/src/libstore/CMakeLists.txt
+++ b/third_party/nix/src/libstore/CMakeLists.txt
@@ -13,11 +13,11 @@ file(READ "schema.sql" NIX_SCHEMA)
 string(CONFIGURE
   "#pragma once
    namespace nix {
-   constexpr char kNixSqlSchema[] = R\"(${NIX_SCHEMA})\"\;
+   constexpr char kNixSqlSchema[] = R\"(${NIX_SCHEMA})\";
    }"
   NIX_SCHEMA_GEN)
 
-file(WRITE ${PROJECT_BINARY_DIR}/generated/schema.sql.hh ${NIX_SCHEMA_GEN})
+file(WRITE ${PROJECT_BINARY_DIR}/generated/schema.sql.hh "${NIX_SCHEMA_GEN}")
 
 set(HEADER_FILES
     binary-cache-store.hh