- Notifications
You must be signed in to change notification settings - Fork1k
docs: document issue with direnv and nix-shell on macOS (#15990)#16015
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
d10d9b5
docs: document issue with direnv and nix-shell on macOS (#15990)
paulroubef24953
make fmt
EdwardAngerteeec289
adds nix/not nix tabs
EdwardAngerteacefb6
checkout origin/main -- **/XAxis.tsx
EdwardAngerta7b2690
add troubleshooting to bottom
EdwardAngertFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
101 changes: 63 additions & 38 deletionsdocs/CONTRIBUTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,51 +2,61 @@ | ||
## Requirements | ||
<div class="tabs"> | ||
We recommend that you use [Nix](https://nix.dev/) package manager to | ||
[maintain dependency versions](https://nixos.org/guides/how-nix-works). | ||
### Nix | ||
1. [Install Nix](https://nix.dev/install-nix#install-nix) | ||
1. After you've installed Nix, instantiate the development with the `nix-shell` | ||
command: | ||
```shell | ||
cd ~/code/coder | ||
# https://nix.dev/tutorials/declarative-and-reproducible-developer-environments | ||
nix-shell | ||
... | ||
copying path '/nix/store/3ms6cs5210n8vfb5a7jkdvzrzdagqzbp-iana-etc-20210225' from 'https:// cache.nixos.org'... | ||
copying path '/nix/store/dxg5aijpyy36clz05wjsyk90gqcdzbam-iana-etc-20220520' from 'https:// cache.nixos.org'... | ||
copying path '/nix/store/v2gvj8whv241nj4lzha3flq8pnllcmvv-ignore-5.2.0.tgz' from 'https://cache. nixos.org'... | ||
... | ||
``` | ||
1. Optional: If you have [direnv](https://direnv.net/) installed with | ||
[hooks configured](https://direnv.net/docs/hook.html), you can add `usenix` | ||
to `.envrc` to automatically instantiate the development environment: | ||
```shell | ||
cd ~/code/coder | ||
echo "use nix" >.envrc | ||
direnv allow | ||
``` | ||
Now, whenever you enter the project folder, | ||
[`direnv`](https://direnv.net/docs/hook.html) will prepare the environment | ||
for you: | ||
```shell | ||
cd ~/code/coder | ||
direnv: loading ~/code/coder/.envrc | ||
direnv: using nix | ||
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +XDG_DATA_DIRS +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH | ||
🎉 | ||
``` | ||
- If you encounter a `creating directory` error on macOS, check the | ||
[troubleshooting](#troubleshooting) section below. | ||
EdwardAngert marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
### Without Nix | ||
Alternatively if you do not want to use Nix then you'll need to install the need | ||
the following tools by hand: | ||
- Go 1.18+ | ||
@@ -73,7 +83,9 @@ the following tools by hand: | ||
- `pandoc` | ||
- on macOS, run `brew install pandocomatic` | ||
</div> | ||
## Development workflow | ||
Use the following `make` commands and scripts in development: | ||
@@ -203,8 +215,7 @@ This helps in naming the dump (e.g. `000069` above). | ||
### Documentation | ||
Visit our [documentation style guide](./contributing/documentation.md). | ||
### Backend | ||
@@ -334,3 +345,17 @@ The | ||
[`release/experimental`](https://github.com/coder/coder/issues?q=sort%3Aupdated-desc+label%3Arelease%2Fexperimental) | ||
label can be used to move the note to the bottom of the release notes under a | ||
separate title. | ||
## Troubleshooting | ||
### Nix on macOS: `error: creating directory` | ||
On macOS, a [direnv bug](https://github.com/direnv/direnv/issues/1345) can cause | ||
`nix-shell` to fail to build or run `coder`. If you encounter | ||
`error: creating directory` when you attempt to run, build, or test, add a | ||
`mkdir` line to your `.envrc`: | ||
```shell | ||
use nix | ||
mkdir -p "$TMPDIR" | ||
``` |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.