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

Add nix-run and myEnvRun #1019

Merged
merged 1 commit into from
Mar 14, 2014
Merged

Add nix-run and myEnvRun #1019

merged 1 commit into from
Mar 14, 2014

Conversation

rickynils
Copy link
Member

This adds nix-run, which is a thin wrapper around nix-build.
nix-run calls nix-build, and then executes the resulting build.
If no executable artifact is built, nix-runs outputs an error
message.

myEnvRun calls myEnvFun and builds a script that directly runs
the load-env-* script.

Together, nix-run and myEnvRun allows you to set up an environment
that can be loaded in this way:

envs.nix:
{
gcc = myEnvRun {
name = "gcc";
buildInputs = [ gcc ];
};
}

$ nix-run -A gcc envs.nix

You end up directly in your environment without having to do
nix-env -i. You will always have a fresh environment and you
don't have to pollute you profile with a lot of env packages.

@edolstra
Copy link
Member

Hm, I'm still not entirely convinced about the use case for this package. Is this really all that much better than saying nix-build -A gcc; ./result/bin/gcc? Apart from that:

The nix-run package lacks meta attributes. In particular, a longDescription would be useful given that there is no other documentation.

Filenames should not be in camel case, so please use my-env-run.nix instead of myEnvRun.nix. Also, since it's not a package itself, it should be moved to build-support.

@rickynils
Copy link
Member Author

@edolstra I'll add metadata and documentation once we think this is good to have.

I'm open for other suggestions. What I want is what you get today with myEnvFun, but without having to do nix-env -i, because you end up with an outdated environment.

@the-kenny
Copy link
Contributor

I like the idea of adding nix-run. It's a good way to run programs you just need once (like openssl to generate an ssl certificate) without cluttering your profile (via nix-env) or the filesystem (nix-build, result symlink).

@bjornfor
Copy link
Contributor

If it doesn't do much more than nix-build -A foo; ./result/bin/foo (which I use a lot) I'm afraid I don't see the point in it. I never run nix-env -i for testing temporary stuff, I use nix-build and execute.

@ocharles
Copy link
Contributor

I don't see the draw back with this contribution. It resolves itches two people have, and doesn't require any real changes to anything we already have. So it's a +1 from me.

This adds nix-run, which is a thin wrapper around nix-build.
nix-run calls nix-build, and then executes the resulting build.
If no executable artifact is built, nix-runs outputs an error
message.

myEnvRun calls myEnvFun and builds a script that directly runs
the load-env-* script.

Together, nix-run and myEnvRun allows you to set up an environment
that can be loaded in this way:

  envs.nix:
    {
      gcc = myEnvRun {
        name = "gcc";
        buildInputs = [ gcc ];
      };
    }

  $ nix-run -A gcc envs.nix

You end up directly in your environment without having to do
nix-env -i. You will always have a fresh environment and you
don't have to pollute you profile with a lot of env packages.
@rickynils
Copy link
Member Author

I've moved myEnvRun.nix to build-support/my-env-run/default.nix and added meta information.

@shlevy shlevy merged commit 8685278 into NixOS:master Mar 14, 2014
@shlevy
Copy link
Member

shlevy commented Mar 14, 2014

@edolstra Let me know if you think I should revert, but I think this is general enough to be useful to some in the community.

@edolstra
Copy link
Member

Well, we now have nix-shell -p, e.g.

$ nix-shell -p hello --command hello
Hello, world!

Doesn't that remove the need for this function?

@shlevy
Copy link
Member

shlevy commented Mar 15, 2014

Ah true, that pretty much covers this. @rickynils do you still think there's a use for nix-run or myEnvRun now that nix-shell has -p?

@rickynils
Copy link
Member Author

@shlevy @edolstra I guess nix-shell could suffice, and it is more general.

@shlevy
Copy link
Member

shlevy commented Mar 15, 2014

Reverted in a330e24

@rickynils rickynils deleted the nix-run branch October 19, 2014 14:56
klemensn added a commit to klemensn/nixpkgs that referenced this pull request Jun 3, 2022
This release is still subject to double-free crashes in at least the
signature verification functionality, but debugging that requires an up
to date version (released two months ago), so here we go.

NB: Upstream released two source tarballs without further information,
qdigidoc4_r.2.11.110.orig.tar.xz contains sources without subdirectory,
qdigidoc4_r.2.11.110-1804.tar.xz contains a subdirectory with sources;
their difference is irrelevant for our build, so pick the one 1804 one:
```
$ diff -u -r qdigidoc4_r.2.11.110.orig/ qdigidoc4_r.2.11.110-1804/qdigidoc4/
Only in qdigidoc4_r.2.11.110.orig/cmake: .git
Only in qdigidoc4_r.2.11.110.orig/common: .git
Only in qdigidoc4_r.2.11.110.orig/common: .gitmodules
diff '--color=auto' -u -r qdigidoc4_r.2.11.110.orig/debian/changelog qdigidoc4_r.2.11.110-1804/qdigidoc4/debian/changelog
--- qdigidoc4_r.2.11.110.orig/debian/changelog	2022-01-28 13:44:35.000000000 +0200
+++ qdigidoc4_r.2.11.110-1804/qdigidoc4/debian/changelog	2022-01-28 13:44:38.000000000 +0200
@@ -1,3 +1,9 @@
+qdigidoc4 (4.2.11.110-1804) unstable; urgency=medium
+
+  * Release: 4.2.11.110.
+
+ -- RIA <[email protected]>  Fri, 28 Jan 2022 13:44:38 +0200
+
 qdigidoc4 (0.2.0.3) stable; urgency=low

   * Initial release
Only in qdigidoc4_r.2.11.110.orig/extensions/cmake: .git
Only in qdigidoc4_r.2.11.110.orig/extensions: .git
Only in qdigidoc4_r.2.11.110.orig/extensions: .gitmodules
```

```
$ git log --oneline v4.2.9..v4.2.11
2631e24 (tag: v4.2.11) Update translation (NixOS#1025)
76c671a Support Fedora (NixOS#997)
639cebe Update Qt to 5.12.2 (NixOS#1019)
cde7fb8 Add web-eid to diagnostics (NixOS#989)
faa8276 Add default option to sign button (NixOS#1001)
cb8262a Update OpenLDAP 2.6.0 (NixOS#996)
132de43 Workaround for Yaru theme on ubuntu 21.10 (NixOS#994)
58e4278 Improve safeFilename (NixOS#986)
1710f47 Fix coverity and cppcheck warnings (NixOS#992)
60af0bb Remove autofocus (NixOS#981)
5a9ff0a Use thread monitor event state (NixOS#845)
cdd95a5 Fix LDAP certificate validation (NixOS#980)
92f81ec Workaround SID/MID proxy unicode issues (NixOS#982)
92a5aaa Update version number and OpenSSL, OpenLDAP versions (NixOS#977)
5971e54 Update Xalan-C 1.12 (NixOS#976)
1f848cf Add more specific info for OpenSSLExceptions (NixOS#970)
0497b7f Set Select folder dialog button label and fix some translation warnings (NixOS#974)
e56e814 Workaround recent Qt changes to pass mousePressEvent (NixOS#978)
44f4a7e Update translations in russian for settings (NixOS#973)
25756eb Wait for upper level operations to avoid locked screen (NixOS#979)
232784e Don't set focus to fonds image (NixOS#967)
5cf2157 Change the view of expired and expiring certificates (NixOS#965)
b001274 Resolve a yellow background, when PIN is locked (NixOS#971)
4b20375 Fix the boolean value (NixOS#975)
1a41817 Resolve Ubuntu 21.04 warnings (NixOS#946)
301178b Set read-only permission for files in signed container (NixOS#962)
e028a30 Update OpenLDAP 2.5.5 (NixOS#963)
1fb5f6a Set accessible name to pin (NixOS#966)
18e6112 Handle libdigidocpp exception (NixOS#943)
a9efe0f Update translations (NixOS#961)
06e44a0 Fix Linux dark theme (NixOS#950)
a6ff428 Fix missed border of Accordion (NixOS#960)
a14476c Update list of components in Info view (NixOS#958)
8980270 Fix normalization of filenames (NixOS#952)
e4aac44 Shorten notifications display time (NixOS#948)
14606dc Use QSysInfo for OS version (NixOS#931)
b8716e7 Resolve a yellow background, when PIN is locked (NixOS#947)
0319c6b Don't allow searching for spaces during encryption (NixOS#929)
```
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

Successfully merging this pull request may close these issues.

6 participants