Repository navigation
Conversation
Signed-off-by: tdruez <tdruez@aboutcode.org>
Signed-off-by: tdruez <tdruez@aboutcode.org>
Signed-off-by: tdruez <tdruez@aboutcode.org>
Signed-off-by: tdruez <tdruez@aboutcode.org>
chinyeungli
left a comment
There was a problem hiding this comment.
@tdruez It looks very good. I've made some comments and see if you agree.
| is_fetched = nix.fetch_binary( | ||
| store_path=store_path, | ||
| destination=self.project.codebase_path / d2d.TO / output, | ||
| download_directory=self.project.tmp_path, | ||
| ) |
There was a problem hiding this comment.
If there is no "selected_output", all outputs from self.metadata["outputs"].items() will be fetched such as dev, doc, man, info, etc. Those contain source-like content that maps cleanly to from/ and may produces noise in the D2D report, the binary side is supposed to represent the deployed artifacts, not the whole package.
Should we default to a preferred list instead, e.g. out, debug, and fall back to all outputs if none of those exist?
| PATCHED_SOURCE_EXPRESSION = ( | ||
| NIXPKGS_EXPRESSION | ||
| + """ | ||
| pkgs.applyPatches { | ||
| name = "source"; | ||
| src = package.src; | ||
| patches = package.patches or [ ]; | ||
| prePatch = package.prePatch or ""; | ||
| postPatch = package.postPatch or ""; | ||
| } | ||
| """ | ||
| ) | ||
|
|
||
| UPSTREAM_SOURCE_EXPRESSION = NIXPKGS_EXPRESSION + "package.src" |
There was a problem hiding this comment.
Should we add a guard when there is no "src" attribute?
Two examples — these .nix files don't have a src attribute:
- migu (only srcs) - https://github.com/NixOS/nixpkgs/blob/5202e105ca0c9c6779fdfa6bb27d4410abc41b5b/pkgs/by-name/mi/migu/package.nix#L11
- papertrail (dontUnpack = true) - https://github.com/NixOS/nixpkgs/blob/5202e105ca0c9c6779fdfa6bb27d4410abc41b5b/pkgs/by-name/pa/papertrail/package.nix#L9
Something like
if !(package ? src) then
throw "PACKAGE_HAS_NO_SOURCE"
else
and then catch the error in fetch_source ()?
Even without source, the pipeline can still fetch the binary from the cache and create the package from the nixpkgs metadata, so it's worth finishing with a warning rather than failing the run.
If we plan to add a guard, perhaps we can set a self.d2d_enable field to bypass all the d2d_steps.
I think we can skip srcs support in v1 and add it in a later release.
…urce Signed-off-by: tdruez <tdruez@aboutcode.org>
Signed-off-by: tdruez <tdruez@aboutcode.org>
…AR downloads Signed-off-by: tdruez <tdruez@aboutcode.org>
Issues
Changes
scan_nix_packagepipeline, reusing all thedeploy_to_developstepscommitqualifiernix-store --restorenot-deployedstatusextra_datanix-binandzstdin the full Docker image