-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
stage-1: fix typo that breaks resume #9056
Conversation
$d should be $sd, this causes resume from hibernate to fail if resumeDevice is not explicitly set in config. Introduced in commit: 'stage-1: Shut up warnings about swap devices that don't exist yet'
stage-1: fix typo that breaks resume
Ah, this is why resume didn't work for me on the systemd-219 branch. Picked it back 026c31d. |
What would a VM test for this look like? Do we have some way to simulate a resume in qemu? |
It would be nice to have a typo-resilient language for such "scripts" (i. e. with static type checking). |
@vcunat yeah except it doesn't exist... e.g. you might still write |
The need for outside-environment variables is rather rare – I see mostly need for local bindings (such as this mistyped iterator). The truth is I don't know about a suitable language+library for these kind of things. |
@vcunat so you have two ints, |
The fact that types don't catch everything isn't an argument against using On Fri, Jul 31, 2015 at 10:03 AM, lethalman [email protected]
|
@vcunat Well, we can rewrite the stage-1 script in Perl :-) |
@lethalman: mistyping into something that is defined is much less likely, especially when one minimizes scope sizes, and adding a strong type-checking would decrease the probability even more. Perl doesn't sound as a significant enough improvement in terms of finding errors before running, but maybe it's just because I know too little about it (or about a suitable lint-like tool for it). |
Perl (unlike Python) does actually complain about undefined variables, so it would have caught this error. Regarding better type checking, there are probably not that many options, given that the language interpreter has to fit inside an initrd... (Unless of course we'd want to go for a compiled language.) |
For now I'd just settle for a test 😄 |
(I'm sorry most of this thread is off topic.) I think we could have compilation for such things, as we don't allow in-place modification anyway. To stay conservative, we might still leave the source along each executable. But even then I don't see a clear choice of language. |
cough NixOS/nix#553 |
$d should be $sd, this causes resume from hibernate to fail if
resumeDevice is not explicitly set in config. Introduced in commit:
'stage-1: Shut up warnings about swap devices that don't exist yet'
Resume stopped working after a recent update, and this commit fixes it for me. I tested this against current nixos-unstable, but I have not tested the change after rebasing on master.