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

rund: init at version 1.0.0 #59047

Merged
merged 1 commit into from Oct 1, 2019
Merged

rund: init at version 1.0.0 #59047

merged 1 commit into from Oct 1, 2019

Conversation

marler8997
Copy link
Contributor

@marler8997 marler8997 commented Apr 6, 2019

Motivation for this change

Adding a D Programming Language Compiler Wrapper tool that runs and caches D programs.

This is an alternative to the existing rdmd tool. It's a rewrite that leverages a new compiler feature that allows it to run the compiler once instead of having to run it twice like rdmd does. This is a big change to how the cache logic works so I decided to fork the tool rather than trying to update rdmd to support both the old and new logic in the same tool.

It also introduces new features like "Source Compiler Directives" which allow D Language source files to contain compiler configuration. It addresses the same problem described here:

http://chriswarbo.net/projects/nixos/nix_shell_shebangs.html

By using /usr/bin/env, we lose the ability to pass arguments to the nix-shell command. To work around this, nix-shell will look at that second line to get its options.

D programs can use this tool by adding the shebang line #!/usr/bin/env rund to the top of their main source file allowing them to be executed with ./myprogram.d.

i.e.

#!/usr/bin/env rund
//!debugSymbols
//     ^ this is an example of a source compiler directive
import std.stdio;void main() { writeln("Hello World!"); }
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • [N/A] Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • [N/A] Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/development/tools/rund/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/rund/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/rund/default.nix Show resolved Hide resolved
pkgs/development/tools/rund/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/rund/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/rund/default.nix Show resolved Hide resolved
@marler8997
Copy link
Contributor Author

@tadeokondrak thanks for the help, still learning all this nix stuff.

@marler8997
Copy link
Contributor Author

Ping

@marler8997
Copy link
Contributor Author

Wow, I just realized that there have been 3,158 pull requests opened since this one....and it's only been 8 weeks! That's over 50 pull requests a day!

@Lassulus
Copy link
Member

yes, a lot going on in this repo. sadly sometimes PRs get stalled for this reason.
anyway: can you make a separate commit for the maintainers file?

@marler8997 marler8997 mentioned this pull request Sep 30, 2019
10 tasks
@marler8997
Copy link
Contributor Author

Ok I've added myself as a maintainer in this PR: #70060

Will rebase this change once that gets in.

Adding a D Programming Language Compiler Wrapper tool that runs and caches D programs.  This is an alternative to the existing `rdmd` tool.  It's a rewrite that leverages a new compiler feature that allows it to run the compiler once instead of having to run it twice like `rdmd` does.  I decided to create a new tool rather than trying to support both older and new compilers in the same tool.  It also introduces new features like "Source Compiler Directives" which allow D Language source files to contain compiler configuration such as import paths, environment variables, etc.
@marler8997
Copy link
Contributor Author

Rebased

Copy link
Member

@Lassulus Lassulus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with nix-review, successfully ran a hello world D program though this

@Lassulus Lassulus merged commit c6a1412 into NixOS:master Oct 1, 2019
@marler8997 marler8997 deleted the addRund branch October 2, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants