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

Rust rewrite #1005

Merged
merged 152 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
30829df
generating examples should depend on successful build
domenkozar Jul 21, 2023
0d967cd
unpin python 3.7 for cloudflare & fix build
domenkozar Jul 21, 2023
21d606c
switch to nix ide with lsp support
domenkozar Jul 22, 2023
b4e98ae
ci: name the reinstallation step
domenkozar Jul 22, 2023
b9c1704
Rewrite CLI in Python
domenkozar Jul 10, 2023
c81069c
devenv inputs add <name> <url>
domenkozar Jul 27, 2023
cf9d122
cli
domenkozar Jul 27, 2023
cfc0cb8
devenv print-dev-env --json
figsoda Aug 14, 2023
d517bf0
Nix 2.17 + patches
domenkozar Aug 16, 2023
1d37fdb
shellcheck
domenkozar Aug 19, 2023
0fa6402
Debug
domenkozar Aug 19, 2023
1cc2387
Disable macos-latest for now
domenkozar Aug 19, 2023
868f1b9
fix a few examples
domenkozar Aug 20, 2023
ce115ef
python: wrap to specify LD_LIBRARY_PATH
domenkozar Aug 21, 2023
bc7f048
bump nix
domenkozar Aug 21, 2023
78d4f82
python-poetry: debug LD_LIBRARY_PATH
domenkozar Aug 21, 2023
a70c617
python: specify also DYLD_LIBRARY_PATH
domenkozar Aug 21, 2023
434e915
Add languages.python.manylinux.enable, pass libraries to the interpre…
domenkozar Aug 21, 2023
6c1194b
if there's no cachix defined, ignore the error
domenkozar Aug 24, 2023
a4e43db
bump nix
domenkozar Aug 24, 2023
5881792
fix $ devenv shell ls -la
domenkozar Sep 10, 2023
5b6f6f2
fix gc symlink
domenkozar Sep 10, 2023
506e189
allow passing through arguments from run_nix to run_command
bobvanderlinden Sep 16, 2023
5ff197a
only log command errors when logging is enabled
bobvanderlinden Sep 16, 2023
64f252f
disable stderr and logging for cachix evaluation
bobvanderlinden Sep 16, 2023
369233d
add black pre-commit
bobvanderlinden Sep 16, 2023
28fcf4a
format python files using black
bobvanderlinden Oct 6, 2023
5fa9210
[FEAT] Conditionally link devenv profile
penguincoder Oct 16, 2023
a44199c
containers: correctly pass no registry case
domenkozar Oct 25, 2023
123c00d
devenv processes stop: print PID
domenkozar Oct 31, 2023
6408e95
normalize paths when root is /
mcdonc Dec 19, 2023
b25e8a0
Recreate Python venv and run pip install less often
mcdonc Dec 24, 2023
fba13cf
Recreate Python venv and run pip install less often
mcdonc Dec 24, 2023
15d3a6f
container startup commands did not work due to quoting of args; we no…
mcdonc Dec 24, 2023
5af48b4
examples/python-poetry: use python libraries instead of packages
bobvanderlinden Jan 10, 2024
835ad1d
to allow 'devenv processes stop' to stop processes we need to exec th…
mcdonc Jan 15, 2024
eef3e48
add a --keep-going flag and handle ctrl-C during test running more gr…
mcdonc Jan 19, 2024
a6155c7
until we get the env-venv nixpkgs stuff in a place we can use, we nee…
mcdonc Jan 19, 2024
8ca5e67
some packages are now unfree
mcdonc Jan 19, 2024
85acc1c
some packages are now unfree
mcdonc Jan 19, 2024
90bb9f2
install rails via gem, add libyaml to make tests pass
mcdonc Jan 19, 2024
a0901d2
add comment about env-venv
mcdonc Jan 19, 2024
1f05fd6
comment
mcdonc Jan 19, 2024
9c24a04
make python-native-libs test pass
mcdonc Jan 19, 2024
4344327
put user-defined libs first on LD_LIBRARY_PATH
mcdonc Jan 20, 2024
7d14211
add --exclude feature
mcdonc Jan 23, 2024
e721186
make tests pass
mcdonc Jan 23, 2024
c926f5a
try to make these tests pass but they do not
mcdonc Jan 23, 2024
62b52bc
make vault test pass in reality
mcdonc Jan 24, 2024
77185f3
update poetry lock
mcdonc Jan 24, 2024
caf1a2e
pre-commit run -a
mcdonc Jan 24, 2024
da4589b
mark phoenix as broken
mcdonc Jan 24, 2024
fb1c7e2
print the command being run so we can run it by hand if it fails
mcdonc Jan 28, 2024
ac2e743
allow builtins (like set and if) within container exec commands
mcdonc Jan 28, 2024
2fad7a8
Support allowBroken
jozuas Jan 28, 2024
64f270d
update nix to 2.21 (dev)
domenkozar Feb 16, 2024
748ff8b
search: fix missing default
domenkozar Feb 17, 2024
9bd8d1a
use self-hosted arm/linux
domenkozar Dec 14, 2023
3697204
fix cloudflare
domenkozar Feb 17, 2024
ff0400d
bump nix
domenkozar Feb 17, 2024
f60f26e
.devenv.flake.nix -> .devenv/flake.nix
domenkozar Feb 19, 2024
461c9ef
bump
domenkozar Feb 19, 2024
7de2eac
bump
domenkozar Feb 20, 2024
05ec151
revert .devenv/flake.nix
domenkozar Feb 20, 2024
f7aa880
unpin python 3.7 for cloudflare & fix build
domenkozar Jul 21, 2023
30c8045
Rewrite CLI in Python
domenkozar Jul 10, 2023
f75c105
devenv inputs add <name> <url>
domenkozar Jul 27, 2023
be14084
cli
domenkozar Jul 27, 2023
ced9ccf
Debug
domenkozar Aug 19, 2023
1f9f741
Disable macos-latest for now
domenkozar Aug 19, 2023
226da37
sync with upstream
mcdonc Feb 19, 2024
617acc6
container devenv is now owned and procs started by a nonroot user
mcdonc Feb 20, 2024
0a2ddff
remove shadowed function
mcdonc Feb 20, 2024
94dc937
format
domenkozar Feb 20, 2024
5ea46ef
debug
domenkozar Feb 20, 2024
078554c
fix ci?
domenkozar Feb 22, 2024
e058737
bump nix
domenkozar Feb 22, 2024
de506ee
containers are only supported on linux
domenkozar Feb 23, 2024
46acff0
don't rely on profiles on ci
domenkozar Feb 23, 2024
9b30c73
fix ci?
domenkozar Feb 23, 2024
baeadb3
Rewrite in Rust
domenkozar Feb 28, 2024
1f0bb14
fix ci
domenkozar Mar 12, 2024
7f39eef
Introduce devenv-nixpkgs
domenkozar Mar 12, 2024
0565784
display process logs during testing
domenkozar Mar 12, 2024
bbbe0a3
fix cli test
domenkozar Mar 12, 2024
02c48f6
--cores defaults to 2, --max-jobs defaults to num_cpu/2
domenkozar Mar 13, 2024
6f91d5a
fix dotenv test
domenkozar Mar 13, 2024
e91d7a4
fix glibcLocales test on darwin
domenkozar Mar 14, 2024
d2f7f88
bump nix
domenkozar Mar 14, 2024
b9e31f3
fix flakes eval
domenkozar Mar 14, 2024
2006015
skip tests for now
domenkozar Mar 14, 2024
051c6c4
fix direnv test
domenkozar Mar 15, 2024
688973c
fix example generation
domenkozar Mar 15, 2024
928228d
ci: avoid building all over again
domenkozar Mar 15, 2024
2cd189b
remove dummy removal of tmpdir
domenkozar Mar 15, 2024
4c986e8
docs: more devenv.yaml examples
domenkozar Mar 15, 2024
796c609
examples/cockroachdb: supports only linux
domenkozar Mar 15, 2024
49a97ab
examples/python-venv: correctly use state dir
domenkozar Mar 15, 2024
2e043c0
examples/simple-remote: use simple example as a base
domenkozar Mar 15, 2024
d8a8c12
bump nix
domenkozar Mar 15, 2024
794116e
fix flake/flake-parts templates
domenkozar Mar 15, 2024
dffe8c9
fix github actions for tests
domenkozar Mar 15, 2024
3baecf3
try fix more examples
domenkozar Mar 16, 2024
fb7d977
examples: rubyonrails: use port 3000 instead of 5100
bobvanderlinden Mar 16, 2024
055bc43
examples: rubyonrails: force overwriting any files
bobvanderlinden Mar 16, 2024
6ab8ee4
postgres: support non-alphanumeric usernames
bobvanderlinden Mar 16, 2024
74364ee
devenv: avoid rebuild when unrelated sources change
bobvanderlinden Mar 16, 2024
9a90212
Merge pull request #1009 from bobvanderlinden/rust-rewrite-rubyonrail…
domenkozar Mar 16, 2024
c574ac1
fix a few more tests
domenkozar Mar 17, 2024
7ebf8ce
feat: add DEVENV_RUNTIME
midchildan Mar 15, 2024
547d33a
fix(postgres): don't crash with long working directory
midchildan Mar 15, 2024
e1c2d72
doc: explain DEVENV_RUNTIME
midchildan Mar 16, 2024
d9d8928
more test fixes
domenkozar Mar 17, 2024
92fa4a7
fix impure test
domenkozar Mar 18, 2024
1b78811
make /tmp configurable
domenkozar Mar 18, 2024
cb94234
ruby: try with clean
domenkozar Mar 18, 2024
f0cfaf6
Remove permit-insecure test for now
domenkozar Mar 18, 2024
2340486
disable standardml on aarch64
domenkozar Mar 18, 2024
9e459eb
add 1.0 blog post
domenkozar Mar 18, 2024
b5681ea
fix supported-languages example
domenkozar Mar 18, 2024
fe19d7f
process-compose: set is_strict
domenkozar Mar 18, 2024
27f8923
disable purescript on aarch64-linux
domenkozar Mar 18, 2024
cc76f0b
always keep going
domenkozar Mar 18, 2024
2e9debc
docs: sync with pre-commit hooks
domenkozar Mar 19, 2024
a5bb0bd
docs: render strikethrough
domenkozar Mar 19, 2024
dea8689
texlive: use str instead of string
domenkozar Mar 19, 2024
ccbd306
Make edit pass on 1.0 release post
Mar 19, 2024
b80b159
docs(phoenix): add example for elixir phoenix
Mar 19, 2024
419e68a
Merge pull request #1012 from cyberaesthete/patch-2
domenkozar Mar 19, 2024
015f239
Merge pull request #1011 from euphemism/edit-pass-on-1.0-release-post
domenkozar Mar 19, 2024
fef4366
Make more release-post tweaks
Mar 19, 2024
ec5ceba
Merge pull request #1013 from euphemism/edit-pass-on-1.0-release-post
domenkozar Mar 19, 2024
68d3840
blog: edits
domenkozar Mar 19, 2024
ecaa6b2
recommend experimental Nix installer
domenkozar Mar 19, 2024
24775a7
fix a bug in devenv init
domenkozar Mar 19, 2024
ba710af
docs(phoenix): remove interactive prompt from devenv shell init script
Mar 19, 2024
abbeeb0
Merge pull request #1014 from cyberaesthete/docs/phoenix
domenkozar Mar 19, 2024
08d8a34
Make further tweaks to 1.0-release-post copy
Mar 19, 2024
2e08fc0
Merge pull request #1015 from euphemism/edit-pass-on-1.0-release-post
domenkozar Mar 20, 2024
910e2b8
DEVENV_RUNTIME: use XDG_RUNTIME_DIR or TMPDIR or /tmp
domenkozar Mar 19, 2024
d0c7023
fix #694
domenkozar Mar 20, 2024
23e9cf0
pre-commit: provide all packages that are used for the hooks
domenkozar Mar 20, 2024
129434a
blog clarify things
domenkozar Mar 20, 2024
3adfb7f
run flake tests
domenkozar Mar 20, 2024
f840b83
integrate cachix
domenkozar Mar 20, 2024
883b0e4
fix flake template
domenkozar Mar 20, 2024
c7f36c7
don't fail on older devenv modules
domenkozar Mar 20, 2024
60cb6f7
fix postgresql localhost healthcheck
domenkozar Mar 20, 2024
1bf66bf
garden
domenkozar Mar 20, 2024
3ccd354
fix tests
domenkozar Mar 20, 2024
b4be768
log to stderr
domenkozar Mar 20, 2024
2edb077
Fix flake-parts template
domenkozar Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"customizations": {
"vscode": {
"extensions": [
"bbenoist.Nix"
"jnoortheen.nix-ide"
]
}
},
"image": "ghcr.io/cachix/devenv:latest",
"overrideCommand": false,
"updateContentCommand": "devenv ci"
"updateContentCommand": "devenv test"
}
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
set -euo pipefail

# Use our own last built devenv/nix in CLI
devenv_bin=$(nix build --print-out-paths --accept-flake-config)
PATH_add "$devenv_bin/bin"
nix build --print-out-paths --accept-flake-config || echo "nix build failed, using previous build"
PATH_add "result/bin"

# External users should use `source_url` to load this file
source_env ./direnvrc
Expand Down
84 changes: 48 additions & 36 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [[ubuntu-latest], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
os: [[self-hosted, linux, X64], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -25,37 +25,57 @@ jobs:
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
- name: Run tests
- id: build
run: |
devenv ci
devenv shell devenv-run-tests
devenv search ncdu | grep "pkgs\.ncdu"
bin=$(nix build --print-out-paths)
echo "bin=$bin" >> $GITHUB_OUTPUT
- name: Run tests
run: ./result/bin/devenv test
tests:
needs: build
strategy:
fail-fast: false
matrix:
os: [[self-hosted, linux, X64], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix build
export PATH=$PWD/result/bin:$PATH
devenv shell devenv-test-cli
devenv-run-tests tests
pin:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/pin.yml
secrets: inherit
generate-examples:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux, X64]
outputs:
examples: ${{ steps.set-examples.outputs.examples }}
steps:
- name: Checkout base repo
uses: actions/checkout@v4
- id: set-examples
run: |
json=$(tree -J -L 1 examples | jq -c '[.[0].contents[] | .name]')
json=$(nix shell nixpkgs#tree -c tree -J -L 1 examples | nix shell nixpkgs#jq -c jq -c '[.[0].contents[] | .name]')
echo "examples=$json" >> $GITHUB_OUTPUT
examples:
name: ${{ matrix.example }} (${{ join(matrix.os) }})
needs: [generate-examples]
needs: [generate-examples, build]
strategy:
fail-fast: false
matrix:
os: [[ubuntu-latest], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
os: [[self-hosted, linux, X64], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
example: ${{ fromJSON(needs.generate-examples.outputs.examples) }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -70,15 +90,11 @@ jobs:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config . "nixpkgs#gawk"
- name: Disable package aliases
run: |
mkdir -p ~/.config/nixpkgs
echo '{ allowAliases = false; }' > ~/.config/nixpkgs/config.nix
- run: devenv shell devenv-test-example ${{ matrix.example }}
nix build
PATH=$PWD/result/bin:$PATH devenv-run-tests --only ${{ matrix.example }} examples
direnv:
name: direnv (${{ join(matrix.os) }})
needs: build
strategy:
fail-fast: false
matrix:
Expand All @@ -94,25 +110,23 @@ jobs:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
mv ./examples/simple/devenv.yaml ./examples/simple/devenv.yaml.orig
awk '
{ print }
/^inputs:$/ {
print " devenv:";
print " url: path:../../src/modules";
}
' ./examples/simple/devenv.yaml.orig > ./examples/simple/devenv.yaml
nix profile remove '.*'
nix profile install . 'nixpkgs#direnv'
mkdir -p ~/.config/direnv/
cat > ~/.config/direnv/direnv.toml << 'EOF'
[global]
strict_env = true
EOF
direnv allow ./examples/simple
direnv exec ./examples/simple true

devenv_dir=$PWD
export PATH=$PWD/result/bin:$PATH
nix build

tmp="$(mktemp -d)"
pushd "$tmp"
nix shell nixpkgs#direnv -c devenv --override-input devenv path:$devenv_dir?dir=src/modules init
popd
fish-zsh:
name: zsh/fish (${{ join(matrix.os) }})
needs: build
strategy:
fail-fast: false
matrix:
Expand All @@ -127,9 +141,7 @@ jobs:
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
- run: |
nix shell nixpkgs#zsh -c zsh -c "$(which devenv) version"
nix shell nixpkgs#fish -c fish -c "$(which devenv) version"
nix shell nixpkgs#zsh -c zsh -c "./result/bin/devenv version"
nix shell nixpkgs#fish -c fish -c "./result/bin/devenv version"
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Nix & devenv
result
.env
.env.*
.devenv*
.direnv*
/.cache
/.pre-commit-config.yaml
/bin
/include
/lib
pyvenv.cfg
/.direnv
/.venv

# examples
examples/rust/app/target

# Rust
target
Loading
Loading