Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
danieldk
left a comment
There was a problem hiding this comment.
Excellent! Left some comments/questions.
| `use flake` exposes the devshell's environment variables but does not | ||
| run its `shellHook`, so the `.venv` used by the devshell is not created | ||
| on direnv activation. Run `kernel-builder devshell` once to create it: |
There was a problem hiding this comment.
It should automatically create it, also in direnv:
❯ ls -ld .venv
ls: cannot access '.venv': No such file or directory
❯ echo "use flake" > .envrc
direnv: error /home/daniel/git/kernels-community/relu/.envrc is blocked. Run `direnv allow` to approve its content
❯ direnv allow
direnv: loading ~/git/kernels-community/relu/.envrc
direnv: using flake
[...]
Creating new venv environment in path: './.venv'
❯ ls -ld .venv
drwxr-xr-x 5 daniel users 4096 May 20 14:13 .venv
There was a problem hiding this comment.
Thanks for catching it. Some configs messed it up and I ended up with some stale instructions.
| ```bash | ||
| $ kernel-builder devshell | ||
| $ exit | ||
| ``` | ||
|
|
||
| Then have direnv source it on every activation by appending to `.envrc`: | ||
|
|
||
| ```bash | ||
| use flake | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| Reload: | ||
|
|
||
| ```bash | ||
| $ direnv allow | ||
| ``` |
There was a problem hiding this comment.
This should also not be necessary. Continuing from above:
❯ cd ..
❯ cd relu
❯ pip install catalogue # Installing some unrelated dependency.
Collecting catalogue
Downloading catalogue-2.0.10-py3-none-any.whl.metadata (14 kB)
Downloading catalogue-2.0.10-py3-none-any.whl (17 kB)
Installing collected packages: catalogue
Successfully installed catalogue-2.0.10
❯ pip show catalogue
Name: catalogue
Version: 2.0.10
Summary: Super lightweight function registries for your library
Home-page: https://github.com/explosion/catalogue
Author: Explosion
Author-email: contact@explosion.ai
License: MIT
Location: /home/daniel/git/kernels-community/relu/.venv/lib/python3.13/site-packages
Requires:
Required-by
Wonder if something is missing in the configuration on your machine, I have (zsh is my default shell):
programs.direnv = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
nix-direnv.enable = true;
};There was a problem hiding this comment.
Yes, should be fixed now.
| $ cmake -B build-ext -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
| $ ln -sf build-ext/compile_commands.json compile_commands.json |
There was a problem hiding this comment.
I think most IDEs do this automatically when there is a CMakeLists.txt? Not 100% sure.
There was a problem hiding this comment.
We recommend two extensions from the doc. None of them seems to do this automatically:
llvm-vs-code-extensions.vscode-clangdconsumes the file but doesn't seem to produce it (clangd docs).ms-vscode.cpptoolsreads either an explicitcompileCommandspath or a Configuration Provider; it doesn't generate the file either.
|
|
||
| ```bash | ||
| $ cd path/to/kernel | ||
| $ code . |
There was a problem hiding this comment.
It's been a while since I used VS Code, but I don't think this is necessary when you use https://github.com/direnv/direnv-vscode .
There was a problem hiding this comment.
I didn't use it because the project doesn't seem like it's actively maintained (last commit was 2 years back).
There was a problem hiding this comment.
IIRC, last time I tried it in Cursor it just worked. The project is only a very small amount of code, so it probably does not need a lot of maintenance? Worth trying I think.
Co-authored-by: Daniël de Kok <me@danieldk.eu>
No description provided.