diff --git a/.cargo/config.toml b/.cargo/config.toml.cgt similarity index 51% rename from .cargo/config.toml rename to .cargo/config.toml.cgt index 8bef4a7..5f03110 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml.cgt @@ -1,3 +1,4 @@ + [target.x86_64-unknown-linux-gnu] linker = "/usr/bin/clang" rustflags = ["-Clink-arg=-fuse-ld=lld"] @@ -5,4 +6,7 @@ rustflags = ["-Clink-arg=-fuse-ld=lld"] [profile.release] lto = true opt-level = 3 -codegen-units = 1 +codegen-units = <% math.min(ncpus, 4) %> + +[profile.debug] +codegen-units = <% ncpus %> diff --git a/confgen.lua b/confgen.lua index b7c7a84..8d78b1c 100644 --- a/confgen.lua +++ b/confgen.lua @@ -57,7 +57,8 @@ cg.opt.system = function(cmd) if handle == nil then error("Failed to spawn process" .. cmd) end - return handle:read("*a"):gsub("%s+", "") + local data, _ = handle:read("*a"):gsub("%s$", "") + return data end -- Compile the input as lua. Meant to be used as a post-processor.