Commit Graph

2057 Commits

Author SHA1 Message Date
dependabot[bot]
6dbd59e4a4 chore(deps): bump actions/checkout from 4.0.0 to 4.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](3df4ab11eb...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 09:36:45 +01:00
Jairo Llopis
25e07594f4 fix: improve handling of local python dependencies
The pip locker [sometimes created a URL without hash][1] to reflect that there was a local source.

This produced the following error when trying to evaluate that derivation:

    … from call site

      at /nix/store/qdzdi6qvrqxfqxhi3j70d5dsl9f5jpby-source/modules/dream2nix/pip/default.nix:86:28:

        85|       mkDerivation = {
        86|         src = l.mkDefault (fetchers.${metadata.sources.${config.name}.type} metadata.sources.${config.name});
          |                            ^
        87|         doCheck = l.mkDefault false;

    … while calling 'url'

      at /nix/store/qdzdi6qvrqxfqxhi3j70d5dsl9f5jpby-source/modules/dream2nix/pip/default.nix:57:11:

        56|   fetchers = {
        57|     url = info: l.fetchurl {inherit (info) url sha256;};
          |           ^
        58|     git = info: config.deps.fetchgit {inherit (info) url sha256 rev;};

    error: value is null while a string was expected

Of course, one cannot call `builtins.fetchurl` without a `sha256` argument.

Now, local dependencies are specified exactly like that in the lock file. Now, we'll fetch nothing when dealing with local dependencies.

Also, their evaluation when generating `preFixup` attribute is delayed until build time. This was a bigger problem due to the previous bug, but in any case it should still help to reduce evaluation overhead.

FWIW, sometimes local sources might not really exit in the derivation source tree until build time. For example, when building aggregated sources with meta-repo management tools such as Mr. Chef.

[1]: 40b65e4598/pkgs/fetchPipMetadata/src/fetch_pip_metadata/lock_file_from_report.py (L72C28-L72C28)
2023-09-22 10:49:10 +01:00
Jairo Llopis
16552e5813 feat: allow to split buildInputs in python derivations
Follow-up of https://github.com/nix-community/dream2nix/pull/676#discussion_r1326998054, now dependencies marked as buildInputs won't be included as propagatedBuildInputs for python derivations.
2023-09-22 10:45:19 +01:00
Jairo Llopis
56308a22ef feat: output pyEnv for pip derivations
In case you're building a python environment instead of a package, this output is very handy.
2023-09-22 01:47:43 +01:00
DavHau
0d3146539a fix(paths): don't force projectRoot to be in store 2023-09-21 14:39:18 +02:00
DavHau
e913ec992b ci: remove ./ci.nix 2023-09-21 11:00:03 +02:00
DavHau
4eb5478fdd feat(paths): allow paths.package to be an absolute path 2023-09-21 11:00:03 +02:00
Jairo Llopis
8576970852 fix: forward incoming modules when using importPackages interface
Before this patch, if a user calls `importPackages` and includes custom modules in the call, those would be lost.

@moduon MT-1075
2023-09-18 18:12:59 +02:00
DavHau
f8626675d4 fix(php): exclude xml extension
This extension leads to a breakage in composer
2023-09-18 17:56:27 +02:00
DavHau
4234e462ce chore: re-generate all lock files 2023-09-18 17:56:27 +02:00
DavHau
fbcdc4a0a6 fix(pip): don't invalidate lock file on python minor version updates 2023-09-18 17:56:27 +02:00
DavHau
26d0103e1a update nixpkgs input
we now depend on lib.path functions
2023-09-18 17:56:27 +02:00
Yusuf Bera Ertan
40b65e4598
fix(rust-crane): use crane functions from config.deps.crane options (#689) 2023-09-18 00:08:54 +00:00
Yusuf Bera Ertan
d6f2f567ad
fix(rust-crane): actually pull craneSource from config.deps (#688) 2023-09-18 00:01:48 +00:00
DavHau
fbefb96a81 templates: remove v1-python template
This is already covered in examples and all examples are exported as templates already
2023-09-17 15:41:35 +02:00
Yusuf Bera Ertan
599a42d247
refactor: update rust-package example to latest changes (#685) 2023-09-17 09:37:51 +00:00
Jairo Llopis
5a729cb75a docs: simplify python project example
Use `lib.importTOML`, clearer than the previous implementation.

Reuse more information from `pyproject`.
2023-09-15 10:33:20 +02:00
DavHau
398fd949e1 fix(pip): don't set addAutoPatchelfSearchPath on darwin 2023-09-14 17:05:59 +02:00
DavHau
7a07ef5a41 refactor(lock): introduce mkLazy
This seems like a cleaner way to make the value for lock.content more lazy and not trigger errors because paths.XXX is not set in unit tests
2023-09-14 13:51:08 +02:00
DavHau
8d1dbd0e1f fix(lock): remove flakes command from error
The suggested copy paste attribute path is often wrong as it depends on the individual repository setup that dream2nix doesn't control.

Instead now simply hint to `nix run` the .lock attribute
2023-09-14 11:40:51 +02:00
DavHau
a68165d109 chore: update lock files 2023-09-14 11:30:37 +02:00
DavHau
9cc6f02d94 feat(lock): lock file invalidation via lock.invalidationData 2023-09-14 11:30:37 +02:00
DavHau
19bfd98a97 fix(overlays/torch): use autoAddOpenGLRunpathHook 2023-09-14 11:18:58 +02:00
DavHau
77eeb06927 feat(overlays/torch): add /run/opengl-driver/lib to RPATH
This allows resolving libcuda.so.1
2023-09-13 00:07:27 +02:00
DavHau
8d5178a665 fix(pip): set dontStrip for all dependencies
Stripping is slow on large binary wheels and doesn't provide much benefit as it seems
It also prevents some breakages that can occur after stripping.
2023-09-12 01:18:07 +02:00
DavHau
740b89d71a feat(ui): add .drvPath top-level attribute
This allows building evaluated dream2nix modules directly via the nix CLI without having to reference `.public`
2023-09-12 00:39:10 +02:00
DavHau
2ab0222416 feat(ui): add .lock attribute
This allows updating the lock file via `nix run .#{package}.lock` instead of ` nix run .#{package}.config.lock.refresh`

This is better as it's shorter, and the keyword `lock` is widely understood to lock dependencies.
2023-09-12 00:30:51 +02:00
DavHau
08d414a359 feat: community overrides
- Add community overrides accessible via dream2nix.overrides.{lang}.{pname}
- make the pip module use the overrides for dependencies
2023-09-12 00:07:04 +02:00
DavHau
f80d7426f6 fix(python-pyproject): remove default for pythonImportsCheck
The heuristic was not reliable
2023-09-11 23:34:25 +02:00
DavHau
c5bdcd7e67 feat(python): add module WIP-python-pyproject 2023-09-11 22:40:08 +02:00
DavHau
ad4cb86569 fix(pip): fix namespace packages collision error 2023-09-11 22:24:23 +02:00
DavHau
cfac73dbd1 feat(pip): allow pypiSnapshotDate to be null
For many users not having a snapshot date is a valid use case.
Also many users will expect their lock file to be updated to the latest dependency versions via a nix run .#package.config.lock.refresh. so it can be the default behavior.
2023-09-11 16:30:31 +02:00
DavHau
7a7e5bd661 fix(pip): ensure autoPatchelfHook finds python binary dependencies 2023-09-09 16:28:46 +02:00
DavHau
16b9241e2b modules.drv-parts: add deprecation error 2023-09-09 15:19:24 +02:00
DavHau
e079a21487 examples: simplify repo examples 2023-09-09 14:33:21 +02:00
Jairo Llopis
19f1f0625d fix: allow locking git dependencies with pip
When you had a pip git requirement such as `git+https://github.com/OCA/maintainer-tools`, `fetch_pip_metadata` was failing with:

```
Traceback (most recent call last):
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/bin/.fetch_pip_metadata-wrapped", line 9, in <module>
    sys.exit(fetch_pip_metadata())
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/lib/python3.10/site-packages/fetch_pip_metadata/__init__.py", line 126, in fetch_pip_metadata
    lock = lock_file_from_report(report, project_root=args.project_root)
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/lib/python3.10/site-packages/fetch_pip_metadata/lock_file_from_report.py", line 240, in lock_file_from_report
    name, package = lock_entry_from_report_entry(install, project_root)
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/lib/python3.10/site-packages/fetch_pip_metadata/lock_file_from_report.py", line 154, in lock_entry_from_report_entry
    info = lock_info(download_info)
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/lib/python3.10/site-packages/fetch_pip_metadata/lock_file_from_report.py", line 132, in lock_info_from_vcs
    sha256 = nix_prefetch_git(url, rev)
  File "/nix/store/v28wx7mr5m9wasbnmsij4dqfrgl0d28q-python3.10-fetch_pip_metadata/lib/python3.10/site-packages/fetch_pip_metadata/lock_file_from_report.py", line 29, in nix_prefetch_git
    subprocess.run(
  File "/nix/store/bc45k1n0pkrdkr3xa6w84w1xhkl1kkyp-python3-3.10.12/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/bc45k1n0pkrdkr3xa6w84w1xhkl1kkyp-python3-3.10.12/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/bc45k1n0pkrdkr3xa6w84w1xhkl1kkyp-python3-3.10.12/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nix-prefetch-git'
Traceback (most recent call last):
  File "/nix/store/0715rzxpxka6b12x7nl6i25gbxp9m80g-refresh/bin/refresh", line 37, in <module>
    lock_data = run_refresh_scripts(refresh_scripts)
  File "/nix/store/0715rzxpxka6b12x7nl6i25gbxp9m80g-refresh/bin/refresh", line 33, in run_refresh_scripts
    refresh_scripts[name] = run_refresh_script(value["script"])
  File "/nix/store/0715rzxpxka6b12x7nl6i25gbxp9m80g-refresh/bin/refresh", line 19, in run_refresh_script
    subprocess.run(
  File "/nix/store/bc45k1n0pkrdkr3xa6w84w1xhkl1kkyp-python3-3.10.12/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/2qfpia31lh9dajnf9s6dm0rp5dw109d3-script.sh']' returned non-zero exit status 1.
```

@moduon MT-1075
2023-09-08 18:56:45 +02:00
DavHau
97d2648627 feat(lib/internal): add findCycles.nix 2023-09-06 10:37:43 +02:00
DavHau
873561e4fe fix(pip): change nixpkgs-overrides & remove default for top-level source
- nixpkgs-overrides are not lazy enough. They can lead to eval failures thrown in nixpkgs despite not being enabled. Therefore we better use the `import` as an enable mechanism instead of the `enable` option.
We keep the enable option to allow for users to disable the override module via mkForce
2023-09-06 02:07:25 +02:00
Yusuf Bera Ertan
1422324ae1 fix(rust-crane): pull stdenv from correct option, pass drvs separately in devshell 2023-09-06 00:48:26 +02:00
Yusuf Bera Ertan
45bf32881c fix(examples): fix rust-package example 2023-09-06 00:48:26 +02:00
Yusuf Bera Ertan
d9eada06bc fix(rust-crane): add cargo to the devshell 2023-09-06 00:48:26 +02:00
Yusuf Bera Ertan
d7f83af526 fix(buildRustPackage): add patch workspace deps to build rust package 2023-09-06 00:48:26 +02:00
Yusuf Bera Ertan
ddca0cecf6 feat(rust-crane): add devshell to packages 2023-09-06 00:48:26 +02:00
DavHau
556f2e7114 feat(lib): add helper lib.importPackages
This makes the repo initialization simpler (see examples)
2023-09-06 00:43:37 +02:00
DavHau
79fc0de519 examples: templates for all example packages and repos 2023-09-06 00:12:47 +02:00
DavHau
508185ce9b docs(readme): fix example links and add one for flake repo 2023-09-05 20:15:45 +02:00
DavHau
0e9553062c nodejs-granular-v3: use new nodejs-package-lock-v3 module
Also add an example package
2023-09-05 18:52:42 +02:00
DavHau
0d3be890a7 nodejs-granular-v3: init (copy from nodejs-granular) 2023-09-05 18:52:42 +02:00
DavHau
d7a037e723 fix(nodejs-package-lock-v3): handle multiple versions & auto load packageLock 2023-09-05 18:45:57 +02:00
DavHau
1202352107 checks.nix-unit: fix nix-unit call 2023-09-05 16:22:57 +02:00