Closed domenkozar closed 2 months ago
Latest commit: |
2ee4450
|
Status: | âś… Deploy successful! |
Preview URL: | https://2ea85a40.devenv.pages.dev |
Branch Preview URL: | https://python-rewrite.devenv.pages.dev |
I noticed that --debugger
doesn't really work as we need to properly attach stdin.
It seems like we're hitting something similar to https://github.com/nix-community/poetry2nix/issues/596, investigating.
Failed for me:
❯ devenv shell
• Building shell ...
error:
at «github:NixOS/nixpkgs/1e383aada51b416c6c27d4884d2e258df201bc11»/lib/modules.nix:346:9:
345| options = checked options;
346| config = checked (removeAttrs config [ "_module" ]);
| ^
347| _module = checked (config._module);
… while evaluating the attribute 'config'
error: The option `devenv.root' does not exist. Definition values:
- In `<unknown-file>': "/usr/local/google/home/fmzakari/code/github.com/fzakaria/sqlelf"
âś– Following command exited with code 1:
/nix/store/y7jg84kb2kr0rln9a33jdlk6vkzkh9ii-nix-2.12.0pre20230216_7c91803/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --system x86_64-linux print-dev-env --profile '/usr/local/google/home/fmzakari/code/github.com/fzakaria/sqlelf/.devenv/gc/shell'
âś– Building shell in 0.6s.
(i uninstalled devenv old, installed new one -> rentered shell)
You'd also need to add to devenv.yaml
:
inputs:
devenv:
url: github:cachix/devenv/python-rewrite
I tried also today out, but the python used by devenv just does not compile. It hangs with configure and does not proceed
It seems like we're hitting something similar to nix-community/poetry2nix#596, investigating.
@domenkozar, did you figure out how to get around it, or is that bug still present? I'm experiencing this issue once again.
It seems like we're hitting something similar to nix-community/poetry2nix#596, investigating.
@domenkozar, did you figure out how to get around it, or is that bug still present? I'm experiencing this issue once again.
See how I override the python in package.nix - that works well!
I tried also today out, but the python used by devenv just does not compile. It hangs with configure and does not proceed
What platform? How comes you don't get it from cachix?
I'll comment here once, if there is a better place, please note.
I use the following which works under the 0.63. but not with the 1:
version:
url: git+https://gitlab.example.com/myflexpgm.git
flake: true
packages = [
(inputs.myflexpgm.defaultPackage."${builtins.currentSystem}")
-> error: attribute 'currentSystem' missing
I'll comment here once, if there is a better place, please note.
I use the following which works under the 0.63. but not with the 1:
version: url: git+https://gitlab.example.com/myflexpgm.git flake: true packages = [ (inputs.myflexpgm.defaultPackage."${builtins.currentSystem}")
-> error: attribute 'currentSystem' missing
We've fixed #658 so now you need to use pkgs.stdenv.system
.
Is this branch compatible with being embedded in a flake currently?
It's not yet compatible, bumping Nix and flake compatability is what's left to do.
How would this PR affect Flake based configuration? How could the generated flake be located if they are not submitted to git?
The process manager is completely broken for me. It's stopping no processes on macOS. Just enabled MySQL
The process manager is completely broken for me. It's stopping no processes on macOS. Just enabled MySQL
The default process manager? Could you provide some logs?
It appears that both devenv.local.nix
and the dotenv
integrations are broken.
No values appear to be loaded from the devenv.local.nix
.
While dotenv
is able to be enabled, it prints an error message that it cannot find the .env
file regardless of whether using the default .env
path or even a hardcoded absolute path as a configuration value.
It appears that both
devenv.local.nix
and thedotenv
integrations are broken.No values appear to be loaded from the
devenv.local.nix
.While
dotenv
is able to be enabled, it prints an error message that it cannot find the.env
file regardless of whether using the default.env
path or even a hardcoded absolute path as a configuration value.
Good point, thanks for catching that! Will make the fixes and make sure the tests cover it.
@jclangst it should be fixed, could you give it a try?
Tested and works!
Found an additional issue when testing this.
Using this version of devenv, the resulting shell has PYTHONPATH
set.
That breaks some packages. A good example is pgadmin4-desktopmode
which when run results in the following:
Traceback (most recent call last):
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/bin/.pgadmin4-wrapped", line 6, in <module>
from pgadmin4.pgAdmin4 import main
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/lib/python3.10/site-packages/pgadmin4/pgAdmin4.py", line 102, in <module>
app = create_app()
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/lib/python3.10/site-packages/pgadmin4/pgadmin/__init__.py", line 759, in create_app
app.register_blueprint(module)
File "/nix/store/fizfk41ad8k4qk9wmsi19pnsp5d4ifm5-python3.10-flask-2.2.5/lib/python3.10/site-packages/flask/scaffold.py", line 50, in wrapper_func
return f(self, *args, **kwargs)
File "/nix/store/fizfk41ad8k4qk9wmsi19pnsp5d4ifm5-python3.10-flask-2.2.5/lib/python3.10/site-packages/flask/app.py", line 1299, in register_blueprint
blueprint.register(self, options)
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/lib/python3.10/site-packages/pgadmin4/pgadmin/misc/__init__.py", line 109, in register
from .cloud import blueprint as module
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/lib/python3.10/site-packages/pgadmin4/pgadmin/misc/cloud/__init__.py", line 29, in <module>
from pgadmin.misc.cloud.azure import deploy_on_azure, clear_azure_session
File "/nix/store/7k0g5s570fx4gmzp934xjm23jkkd1jcg-pgadmin-7.0/lib/python3.10/site-packages/pgadmin4/pgadmin/misc/cloud/azure/__init__.py", line 32, in <module>
from azure.mgmt.rdbms.postgresql_flexibleservers.models import \
ImportError: cannot import name 'NameAvailabilityRequest' from 'azure.mgmt.rdbms.postgresql_flexibleservers.models' (/nix/store/yrchq6xk5pxsscizwzi9zh1ax1ysznq1-python3.10-azure-mgmt-rdbms-10.1.0/lib/python3.10/site-packages/azure/mgmt/rdbms/postgresql_flexibleservers/models/__init__.py)
Unsetting PYTHONPATH
fixes the issues.
However, I am not sure if PYTHONPATH
is intended to be set in resulting shells or what issues may occur from unsetting it.
Our workaround is a wrapper around the packages that break that removes the PYTHONPATH
.
I do still run something fishy and I'm not sure why yet. Nor whether it is problematic. Thought I'd share already.
In some of the existing projects I run devenv shell
and it shows:
...
• Entering shell
path '.../.devenv/gc/shell' does not contain a '.devenv.flake.nix', searching up
This is the result of devenv calling:
nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux develop '.../.devenv/gc/shell'
It does so because .../.devenv/gc/shell
is a symlink to ~/.local/share/.devenv/gc/1694345793165-shell
, which does not exist. I verified (using print("exists?", gc_root, Path(gc_root).exists())
) right before running nix develop
that it indeed does not exist at that time. Any idea / leads?
I do still run something fishy and I'm not sure why yet. Nor whether it is problematic. Thought I'd share already.
In some of the existing projects I run
devenv shell
and it shows:... • Entering shell path '.../.devenv/gc/shell' does not contain a '.devenv.flake.nix', searching up
This is the result of devenv calling:
nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux develop '.../.devenv/gc/shell'
It does so because
.../.devenv/gc/shell
is a symlink to~/.local/share/.devenv/gc/1694345793165-shell
, which does not exist. I verified (usingprint("exists?", gc_root, Path(gc_root).exists())
) right before runningnix develop
that it indeed does not exist at that time. Any idea / leads?
Thanks, I pushed a fix.
Confirmed that the warnings doesn't show anymore :+1: Thanks.
The only thing I'm not too sure of is compatiblity between old/new config+CLI.
A new CLI with old devenv.yaml
results in an error like:
error:
error: flake 'git+file://...' does not provide attribute 'packages.x86_64-linux.devenv.cachix', 'legacyPackages.x86_64-linux.devenv.cachix' or 'devenv.cachix'
An old CLI with new devenv.yaml
results in an error like:
error:
… while updating the lock file of flake 'git+file://...'
error: unsupported input attribute 'treeHash'
To have some kind of a migration path it would be nice if one of the 2 cases would be compatible. That way we can ask developers to upgrade the CLI and then upgrade devenv.yaml
or the other way around. It avoids a lock-step migration with multiple people.
Confirmed that the warnings doesn't show anymore đź‘Ť Thanks.
The only thing I'm not too sure of is compatiblity between old/new config+CLI.
A new CLI with old
devenv.yaml
results in an error like:error: error: flake 'git+file://...' does not provide attribute 'packages.x86_64-linux.devenv.cachix', 'legacyPackages.x86_64-linux.devenv.cachix' or 'devenv.cachix'
An old CLI with new
devenv.yaml
results in an error like:error: … while updating the lock file of flake 'git+file://...' error: unsupported input attribute 'treeHash'
To have some kind of a migration path it would be nice if one of the 2 cases would be compatible. That way we can ask developers to upgrade the CLI and then upgrade
devenv.yaml
or the other way around. It avoids a lock-step migration with multiple people.
The new CLI should only warn if cachix integration is failing, could you post the full log?
For the old CLI I'm afraid we can't do much because the lock file has changed. I'm open to ideas here.
~I noticed it only happens when using direnv(?)~ It happens when using direnv as well as running devenv shell
. The full output:
It does continue, but it is shown as an error.
To reproduce, here are the files: https://gist.github.com/bobvanderlinden/9957bbbca2cbc83f9f5d9443cd020169
EDIT: I made some changes to avoid logging the errors: https://github.com/bobvanderlinden/devenv/compare/42b06d40dc74f7b8783858b574293865a8ee1405..0dc0ed7b7184834a728e8533d46065a6606a373f
The output now looks like:
$ devenv shell
• Building shell ...
âś” Building shell in 1.0s.
• Entering shell
✨ devenv 1.0 is newer than devenv input in devenv.lock. Run `devenv update` to sync.
EDIT2: I noticed some inconsistent styling in the python files. Should it be formatted using a pre-commit? https://github.com/bobvanderlinden/devenv/compare/0dc0ed7b7184834a728e8533d46065a6606a373f..56afd36
I have tested, i seem work !
Good job,
This rewrite looks great ! Congratulations ! When we can expect this PR to be all feature complete and we can start testing ?
[...] and we can start testing ?
That's already possible. The cli should work with older devenv configurations. You can install it using:
nix profile install github:cachix/devenv/python-rewrite
I've been using this version with my patches mentioned above. Haven't run into issues.
I have a few projects at $DAYJOB that do not officially support devenv. In order to work, I setup devenv in the project and just ignored the devenv specific files. Today I started trying to work and devenv fails to initialize. I believe it is because the devenv.lock
file is ignored by git. But here is the full log when trying to access that directory.
So far everything works in my project:
devenv.nix
{pkgs, ...}: {
packages = [
pkgs.postgresql
pkgs.osm2pgsql
pkgs.qgis
];
enterShell = ''
echo "shell"
'';
services.postgres = {
enable = true;
extensions = e: [e.postgis];
initdbArgs = [
"--locale=en_US.UTF-8"
"--encoding=UTF8"
];
settings = {
shared_buffers = "1GB";
work_mem = "50MB";
maintenance_work_mem = "10GB";
autovacuum_work_mem = "2GB";
wal_level = "minimal";
checkpoint_timeout = "60min";
max_wal_size = "10GB";
checkpoint_completion_target = 0.9;
max_wal_senders = 0;
random_page_cost = 1.0;
full_page_writes = "off";
fsync = "off";
};
initialDatabases = [
{
name = "osm";
schema = ./osm.sql;
}
];
};
}
but I always see following error:
error:
error: flake 'git+file:///home/imincik/Projects/gis/iso-codes/code' does not provide attribute 'packages.x86_64-linux.devenv.cachix', 'legacyPackages.x86_64-linux.devenv.cachix' or 'devenv.cachix'
âś– Following command exited with code 1:
/nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux eval .#devenv.cachix --json
• Failed to evaluate .#devenv.cachix
• Maybe you need to upgrade to devenv 1.0: https://devenv.sh/getting-started/
Also, it is reloading all the time even without any change
direnv: .envrc changed, reloading
@imincik The patches mentioned in https://github.com/cachix/devenv/pull/745#issuecomment-1722191281 should resolve the confusing error output.
@imincik The patches mentioned in #745 (comment) should resolve the confusing error output.
Sorry, I thought that this fix is already included.
~I noticed it only happens when using direnv(?)~ It happens when using direnv as well as running
devenv shell
. The full output:It does continue, but it is shown as an error.
To reproduce, here are the files: https://gist.github.com/bobvanderlinden/9957bbbca2cbc83f9f5d9443cd020169
EDIT: I made some changes to avoid logging the errors: https://github.com/bobvanderlinden/devenv/compare/42b06d40dc74f7b8783858b574293865a8ee1405..0dc0ed7b7184834a728e8533d46065a6606a373f
The output now looks like:
$ devenv shell • Building shell ... ✔ Building shell in 1.0s. • Entering shell ✨ devenv 1.0 is newer than devenv input in devenv.lock. Run `devenv update` to sync.
EDIT2: I noticed some inconsistent styling in the python files. Should it be formatted using a pre-commit? https://github.com/bobvanderlinden/devenv/compare/0dc0ed7b7184834a728e8533d46065a6606a373f..56afd36
Could you make a PR for these two changes? Thanks a lot :heart:
processes
command is missing help text when running devenv --help
devenv --help
...
inputs Manage inputs in devenv.yaml. See http://devenv.sh/inputs/
processes
search Search packages matching NAME in nixpkgs input.
...
Service (in this case postgresql) is not terminated by devenv processes stop
.
devenv.yaml
inputs:
devenv:
url: github:cachix/devenv/python-rewrite
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
devenv.nix
{ pkgs, ... }:
{
services.postgres.enable = true;
}
$ devenv update
Run services
devenv up -d
• Building processes ...
• Using Cachix: devenv
âś” Building processes in 1.4s.
• Building shell ...
âś” Building shell in 1.4s.
• Starting processes ...
• PID is 3323104.
• See logs: $ tail -f /tmp/devenv-services/.devenv/processes.log
• Stop: $ devenv processes stop
Try to stop service (try twice)
devenv processes stop
âś” Stopping processes in 0.0s.
devenv processes stop • Stopping processes ...✖ No processes running. ✖ Stopping processes in 0.0s.
* Check if Postgresql is running (it is)
ps aux | grep postgre imincik 3323122 0.0 0.0 222740 3080 ? Ss 20:02 0:00 /nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin/bash /nix/store/wlblzf9qis78xv59rd15k2vrjwwyslam-postgres imincik 3323124 0.0 0.1 298380 20600 ? S 20:02 0:00 /nix/store/ki3srrjjzqalvh0hd9lmqavp5v9wr9jp-postgresql-14.9/bin/postgres imincik 3323128 0.0 0.0 298380 3852 ? Ss 20:02 0:00 postgres: checkpointer imincik 3323129 0.0 0.0 298380 5628 ? Ss 20:02 0:00 postgres: background writer imincik 3323130 0.0 0.0 298380 5496 ? Ss 20:02 0:00 postgres: walwriter imincik 3323131 0.0 0.0 298944 6828 ? Ss 20:02 0:00 postgres: autovacuum launcher imincik 3323132 0.0 0.0 282948 4240 ? Ss 20:02 0:00 postgres: stats collector imincik 3323133 0.0 0.0 298808 6688 ? Ss 20:02 0:00 postgres: logical replication launcher
NOTE: what was killed by `devenv processes stop` was `.devenv/processes` script.
Search is crashing when running devenv search postgres
.
Devenv configuration: same as in https://github.com/cachix/devenv/pull/745#issuecomment-1758211464
devenv search postgres
• Using Cachix: devenv
trace: warning: The type types.string
is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
Traceback (most recent call last):
File "/nix/store/gi2g45cnxf9hk39cgdzr7ycdpk08yjji-python3.11-devenv-1.0/bin/.devenv-wrapped", line 9, in
KeyError: 'default'
```
Also, my other observation is that the search looks slower than in current stable version. It evaluates even when running the same search command again.
# Steps to reproduce
* Search for hello package (run it twice)
```
time devenv search hello
...
devenv search hello 14.52s user 1.91s system 97% cpu 16.768 total
time devenv search hello
...
devenv search hello 14.71s user 1.99s system 90% cpu 18.436 total
```
Another very important thing for my use cases is ability to follow nixpkgs
version from other input flake.
For example, use nixpkgs
version from myflake
:
inputs:
myflake:
url: github:myrepo/myflake
nixpkgs:
follows: myflake/nixpkgs
This configuration is currently not allowed by YAML schema validation specified in yaml.py.
I made it working using following patch, but it would be better if url
and follows
would be mutually exclusive required objects:
diff --git a/src/devenv/yaml.py b/src/devenv/yaml.py
index 825dbcc..9b696f1 100644
--- a/src/devenv/yaml.py
+++ b/src/devenv/yaml.py
@@ -11,7 +11,9 @@ inputsSchema = EmptyDict() | MapPattern(
Str(),
Map(
{
- "url": Str(),
+ # "url": Str(),
+ Optional("url", default=None): Str(),
+ Optional("follows", default=None): Str(),
Optional("flake", default=None): Bool(),
Optional("inputs", default=None): Any(),
Optional("overlays", default=None): Seq(Str()),
@@ -50,7 +52,7 @@ def validate_and_parse_yaml(dot_devenv_root):
inputs = {}
for input, attrs in devenv.get("inputs", {}).items():
- inputs[input] = {k: attrs[k] for k in ("url", "inputs", "flake") if k in attrs}
+ inputs[input] = {k: attrs[k] for k in ("url", "follows", "inputs", "flake") if k in attrs}
with open(os.path.join(dot_devenv_root, "flake.json"), "w") as f:
f.write(json.dumps(inputs))
I haven’t used devenv much but I’m currently testing it out a bit.
First I integrated version 0.63 into my project and then migrated it to version 1.0.
I didn’t really encounter any issues, however I’m using the declarative Flakes approach so some things like devenv up -d
aren’t working/available.
Probably because of the task “ Fix flake.nix support”?
The only thing that I missed compared to my personal setup is random ports.
I’m investing this as part of my work and one of the soft requirements was that it would be nice to launch multiple instances without port collisions.
I was just using this code to generate the port numbers export WEBPORT=$(($RANDOM + 1100))
.
There’s of course still a chance of getting a collision but they are fairly rare and you can just reload the environment to “fix” it.
Not exactly what I would call a pretty solution but at least one doesn’t have to edit a file.
Command devenv test
is documented in the list of commands, but it is not clear how to configure it. URL http://devenv.sh/tests/ doesn't exist.
$ devenv
Usage: devenv [OPTIONS] COMMAND [ARGS]...
https://devenv.sh: Fast, Declarative, Reproducible, and Composable
Developer Environments.
Options:
-v, --verbose Enable verbose output.
-n, --nix-flags NIX-FLAGS Flags to pass to Nix. See `man nix.conf 5`.
Example: --nix-flags "--option bash-prompt >"
-d, --debugger Enable Nix debugger.
-s, --system TEXT Nix system to use.
-o, --offline Disable network access.
--help Show this message and exit.
Commands:
...
test Run tests. See http://devenv.sh/tests/
...
Command
devenv test
is documented in the list of commands, but it is not clear how to configure it. URL http://devenv.sh/tests/ doesn't exist.
You can find the documentation at https://python-rewrite.devenv.pages.dev/tests/
Github CI is crashing on out of memory
on any attempt to enter the shell. The same project works with current stable version.
Run devenv shell pre-commit run --all --show-diff-on-failure
• Building shell ...
error: out of memory
âś– Building shell in 88.3s.
Error: Process completed with exit code 1.
Command
devenv test
is documented in the list of commands, but it is not clear how to configure it. URL http://devenv.sh/tests/ doesn't exist.You can find the documentation at https://python-rewrite.devenv.pages.dev/tests/
Thank you for explanation @ankhers . So it is something like NixOS test for devenv environment.
Python interpreter appears in shell environment even if not configured by devenv.nix
.
devenv.yaml
inputs:
devenv:
url: github:cachix/devenv/python-rewrite
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
devenv.nix
{ pkgs, ... }:
{
services.postgres.enable = true;
}
verify that I don't have any python installed outside of Devenv shell
$ python
The program 'python' is not in your PATH. It is provided by several packages.
You can make it available in an ephemeral shell by typing one of the following:
try to run python
in Devenv shell - it is there
devenv shell python --version
• Building shell ...
âś” Building shell in 1.5s.
Python 3.11.5
$ echo $PYTHONPATH /nix/store/h7kkkiyxrl535ik4ivbbbnn9x2fgma7g-honcho-1.1.0/lib/python3.11/site-packages:/nix/store/c2g2jfc4bxk447qh1ddljdw17nwmn4kg-python3.11-setuptools-68.2.2/lib/python3.11/site-packages:/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/site-packages
Is this related to your [discourse comment](https://discourse.nixos.org/t/devenv-pre-1-0-call-for-testing/34050?u=imincik) saying
"""
Python native system libraries is currently broken, but once we fix this we believe it will work much better than it used to.
"""
When running nix flake show
using Devenv's provided nix build it fails.
Get nix version used by Devenv
devenv -v info | grep "Running command:"
• Running command: /nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux flake metadata
• Running command: /nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux eval --raw '.#info'
Try to run nix flake show
/nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux flake show
path:/home/imincik/Projects/nix/devenv-test-python/small
├───devShell
│ └───x86_64-linux: development environment 'devenv-shell'
├───devenv: unknown
└───packages
└───x86_64-linux
├───ci: package 'ci'
error:
error: expected a derivation
Try to run nix flake check
/nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux flake check
warning: unknown flake output 'devenv'
trace: warning: The type `types.string` is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
error:
… while checking flake output 'packages'
at /home/imincik/Projects/nix/devenv-test-python/small/.devenv.flake.nix:90:7:
89| {
90| packages."${system}" = {
| ^
91| optionsJSON = options.optionsJSON;
… while checking the derivation 'packages.x86_64-linux.info'
at /home/imincik/Projects/nix/devenv-test-python/small/.devenv.flake.nix:92:25:
91| optionsJSON = options.optionsJSON;
92| inherit (config) info procfileScript procfileEnv procfile;
| ^
93| ci = config.ciDerivation;
error: flake attribute 'packages.x86_64-linux.info' is not a derivation
Try to build packages.x86_64-linux.info
/nix/store/bnbhch04awczibxch0qg4lbc3aksrcvw-nix-devenv-2.18.0/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --system x86_64-linux build .#packages.x86_64-linux.info
error:
… while evaluating the flake output attribute 'packages.x86_64-linux.info'
at «none»:0: (source not available)
error: string '# env
- DEVENV_DOTFILE: /home/imincik/Projects/nix/devenv-test-python/small/.devenv
- DEVENV_PROFILE: /nix/store/gwz0xqnjzcbhjb10vd89kpfn54iyyjhk-devenv-profile
- DEVENV_ROOT: /home/imincik/Projects/nix/devenv-test-python/small
- DEVENV_STATE: /home/imincik/Projects/nix/devenv-test-python/small/.devenv/state
# packages
- pre-commit-3.3.3
- pkg-config-wrapper-0.29.2
' has context with the output 'out' from derivation '/nix/store/ln0b17lcmm0ayqay3ia9ymcnf8rkfbd0-devenv-profile.drv', but the string is not the right placeholder for this derivation output. It should be '/nix/store/gwz0xqnjzcbhjb10vd89kpfn54iyyjhk-devenv-profile'
:wave: another bug report
Cannot use a python(?) package
All defaults after init
{pkgs, ...}: {
# https://devenv.sh/basics/
env.GREET = "devenv";
packages = [pkgs.awscli2]
}
Package exists
$ devenv search awscli2
• Using Cachix: devenv
trace: warning: The type `types.string` is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
trace: warning: libsForQt5 now uses makeScopeWithSplicing which does not have "overrideScope'", use "overrideScope".
+--------------+---------+------------------------------------------+
| Package | Version | Description |
+--------------+---------+------------------------------------------+
| pkgs.awscli2 | 2.13.33 | Unified tool to manage your AWS services |
+--------------+---------+------------------------------------------+
Error log on shell activiation:
awscli2 works without devenv:
$ nix-shell -p awscli2 --command "aws --version"
aws-cli/2.13.33 Python/3.11.5 Linux/6.2.0-36-generic source/x86_64.ubuntu.22 prompt/off
Devenv is failing on version
GLIBC_2.38' not found`.
devenv.nix
{ pkgs, ... }: {
packages = [
# qgis currently works only on linux
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.qgis
pkgs.grass
];
languages.python = {
enable = true;
package = pkgs.python3.withPackages (p: [
p.rasterio
p.fiona
]);
};
services = {
postgres = {
enable = true;
extensions = e: [ e.postgis ];
};
};
}
Command:
devenv up
/nix/store/cl6bxs1bad3bbw6fhhrvdq1vlihqjqqg-python3-3.11.4/bin/python3.11: /nix/store/vq3sdi8l15rzfl5zvmwpafrzis4sm6xf-glibc-2.37-8/lib/libm.so.6: version `GLIBC_2.38' not found (required by /nix/store/jippvc3nhbzl961dfs6xxr1n4hiiknhh-devenv-profile/lib/libpython3.11.so.1.0)
/nix/store/cl6bxs1bad3bbw6fhhrvdq1vlihqjqqg-python3-3.11.4/bin/python3.11: /nix/store/vq3sdi8l15rzfl5zvmwpafrzis4sm6xf-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/jippvc3nhbzl961dfs6xxr1n4hiiknhh-devenv-profile/lib/libpython3.11.so.1.0)
UPDATE: I was missing github:cachix/devenv/python-rewrite
input in devenv.yaml
. When added, this error doesn't show up anymore.
Can't use Python configured via languages.python
.
devenv.yaml
inputs:
devenv:
url: github:cachix/devenv/python-rewrite
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
devenv.nix
{ pkgs, ... }:
{
languages.python = {
enable = true;
package = pkgs.python3.withPackages (p: [
p.rasterio
p.fiona
]);
};
}
launch Devenv shell
devenv shell
try to import Python fiona module
python -c 'import fiona'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'fiona'
I'm sorry if this has already been tracked, but with the current method of declaring LD_LIBRARY_PATH
inside the wrapper, when managing a project using poetry, it is difficult to access the shared library because poetry does not use wrapped python. This will cause problems.
For some reason it seems like the interpreter before wrapping is being referenced
devenv
started as a bash wrapped in Nix to explore the design space.As a result, there were many subtle bugs and lack of features that were hard to implement.
Previous
devenv
was 240M in closure and now it's down to 126M.TODO
devenv ci
things in favor ofdevenv test
.Fixes
Fixes https://github.com/cachix/devenv/issues/744 Fixes #693 Fixes #658 Fixes #244 Fixes #436 Fixes #629 Fixes #731 Fixes #83 Fixes #80 Fixes #749 Fixes #507 Fixes #258 Fixes #486 Fixes #745 Fixes #599 Fixes #607
Try it out 🚀
Add
devenv.yaml
:Plain Nix
Flakes