Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the !cmd macros #18

Closed
zimbatm opened this issue Jan 26, 2021 · 2 comments
Closed

Replace the !cmd macros #18

zimbatm opened this issue Jan 26, 2021 · 2 comments

Comments

@zimbatm
Copy link
Member

zimbatm commented Jan 26, 2021

I'm suspicious of things like cmd!("{cmd_arg} {arg...} {path}"). They are probably invoking /bin/sh -c "{cmd_arg} {arg...} {path}" under the hood instead of execve(cmd_arg, arg..., path). This might cause some escaping issues if any of the argument contains a whitespace in them.

@Rizary
Copy link
Contributor

Rizary commented Jan 27, 2021

I have talked to matklad, and he said he doesn't invoke /bin/sh -c.

@zimbatm
Copy link
Member Author

zimbatm commented Jan 27, 2021

I did an strace and can confirm that it invokes execve() as expected. Matklad is the best.

@zimbatm zimbatm closed this as completed Jan 27, 2021
brianmcgee added a commit that referenced this issue May 13, 2024
When running against nixpkgs we were stalling. This was due to a long running read tx which was preventing any writes.

This breaks up reading the cache when walking the filesystem into many smaller read txs.

On my laptop I'm now getting the following with the echo sample:

```console
# fresh cache

❯ nix run .# -- -c --config-file ./test/echo.toml --tree-root ../../../github.com/nixos/nixpkgs
38825 files changed in 320.655826ms

# hot cache

❯ nix run .# -- --config-file ./test/echo.toml --tree-root ../../../github.com/nixos/nixpkgs
0 files changed in 252.920853ms%
```

Signed-off-by: Brian McGee <brian@bmcgee.ie>

Reviewed-on: https://git.numtide.com/numtide/treefmt/pulls/18
Reviewed-by: Jonas Chevalier <zimbatm@noreply.git.numtide.com>
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants