-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
module system: Improve error messages around faulty imports #197547
module system: Improve error messages around faulty imports #197547
Commits on May 6, 2023
-
lib/tests/modules.sh: Unload implicit modules
I had some trouble understanding this. Let's try to keep new tests a bit more stateless and explicit.
Configuration menu - View commit details
-
Copy full SHA for e7e6423 - Browse repository at this point
Copy the full SHA e7e6423View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe15279 - Browse repository at this point
Copy the full SHA fe15279View commit details -
lib/modules.nix: Make some functions private
The supposedly public nature of these functions has been holding back module system maintenance, while usages of these functions are expected to be rare. If used anywhere, presumably they're emulating module system behavior because some use case isn't supported properly. We should try to support such a use case directly, if it even exists.
1Configuration menu - View commit details
-
Copy full SHA for 3633bf9 - Browse repository at this point
Copy the full SHA 3633bf9View commit details -
lib/modules: Add class concept to check imports
This improves the error message when an incompatible module is imported.
Configuration menu - View commit details
-
Copy full SHA for b8ff280 - Browse repository at this point
Copy the full SHA b8ff280View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58f385f - Browse repository at this point
Copy the full SHA 58f385fView commit details -
lib/modules: Improve error when a configuration is imported
This is appears to be a fairly common mistake for beginners who want to build larger things from the system configurations, such as NixOps networks, etc. Further explanation seems appropriate.
Configuration menu - View commit details
-
Copy full SHA for 2e689d5 - Browse repository at this point
Copy the full SHA 2e689d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9714487 - Browse repository at this point
Copy the full SHA 9714487View commit details -
Configuration menu - View commit details
-
Copy full SHA for 439f679 - Browse repository at this point
Copy the full SHA 439f679View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06ca786 - Browse repository at this point
Copy the full SHA 06ca786View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f4a58e - Browse repository at this point
Copy the full SHA 1f4a58eView commit details -
lib/modules: Only interpret class declaration in non-shorthand mode
This is to avoid stealing keys from submodules. `class` might be common enough that reinterpreting existing `class` attributes in configurations as a declaration leads to fairly widespread problems.
Configuration menu - View commit details
-
Copy full SHA for 84b1b01 - Browse repository at this point
Copy the full SHA 84b1b01View commit details -
nixos,nixpkgs: Add module classes
This allows modules that declare their class to be checked. While that's not most user modules, frameworks can take advantage of this by setting declaring the module class for their users. That way, the mistake of importing a module into the wrong hierarchy can be reported more clearly in some cases.
Configuration menu - View commit details
-
Copy full SHA for 79703ee - Browse repository at this point
Copy the full SHA 79703eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee1e14b - Browse repository at this point
Copy the full SHA ee1e14bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03a465f - Browse repository at this point
Copy the full SHA 03a465fView commit details -
lib/modules.nix: Deduplicate documentation
`file://./..` looks redundant, but makes the url clickable in vscode.
Configuration menu - View commit details
-
Copy full SHA for 73f584c - Browse repository at this point
Copy the full SHA 73f584cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fac393 - Browse repository at this point
Copy the full SHA 5fac393View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f02e95 - Browse repository at this point
Copy the full SHA 8f02e95View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8054785 - Browse repository at this point
Copy the full SHA 8054785View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7459c02 - Browse repository at this point
Copy the full SHA 7459c02View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd88c79 - Browse repository at this point
Copy the full SHA fd88c79View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c7aa7d - Browse repository at this point
Copy the full SHA 4c7aa7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89491be - Browse repository at this point
Copy the full SHA 89491beView commit details -
lib.modules: configurationClass -> class
This simplifies the documentation. `configuration` is implied by `_type`.
Configuration menu - View commit details
-
Copy full SHA for eab660d - Browse repository at this point
Copy the full SHA eab660dView commit details