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

Note: clarify naming requirement for type=process #15

Open
tomberek opened this issue Aug 30, 2020 · 1 comment
Open

Note: clarify naming requirement for type=process #15

tomberek opened this issue Aug 30, 2020 · 1 comment

Comments

@tomberek
Copy link

Note the mismatch between the name of the job and the variable it is referred to as "job" vs "jobXX".

# services.nix
  job = {
    name = "jobXX";
    pkg = pkgs.callPackage ./job-package.nix {};
    dependsOn = {};
    type = "process";
  };
#dist.nix
job = [ infrastructure.machine1];

This will fail with a difficult to understand error:

disnix-env -s services.nix -i infra.nix -d dist.nix
[coordinator]: Building manifest...
error: value is a string while a set was expected
(use '--show-trace' to show detailed location information)

Changing it to name="job" removes the error and makes the system work as expected. This is documented in the manual:

Every service has a canonical name, so that it is known to which one is referred from the inter-dependency arguments. This name must match the attribute name.

An error message pointing people to this possibility or detecting it (or removing this constraint?) would be helpful.

@svanderburg
Copy link
Owner

Agreed. However, due to laziness etc. it's not that easy to make error checking very robust.

In the current development version. I significantly revised the entire process that consumes the input models and applies all the required transformations to generate a manifest file. See: https://sandervanderburg.blogspot.com/2020/07/a-new-input-model-transformation.html

Maybe that implementation will already be doing a much better job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants