Questions tagged [shake-build-system]

Shake is a Haskell library for writing build systems - designed as a replacement for make.

Shake is a Haskell library for writing build systems - designed as a replacement for make. Website at https://shakebuild.com/.

127 questions
3
votes
1 answer

Shake: How to reliably, automatically force rebuild when my rules change, becoming out of sync with the shake database?

Shake has shakeVersion :: String: Defaults to 1. The version number of your build rules. Change the version number to force a complete rebuild, such as when making significant changes to the rules that require a wipe. The version number should be…
nh2
  • 24,526
  • 11
  • 79
  • 128
3
votes
2 answers

How do you declare PHONY targets as default actions with shake?

I'm in the process of converting a Makefile into a Shakefile, and I'm not sure how to handle PHONY make targets (clean, install, etc.). I tried something like: main = shake shakeOptions $ do want ["install"] "install" *> \_ -> do need…
Hudon
  • 1,636
  • 18
  • 28
2
votes
2 answers

haskell: cd command does not work in shake/command library

For some reason I cannot make cd command work in shake/command Haskell library. It thinks directory I called with cd does not exist even though it is present in the filesystem. Here is an excerpt of my code: dataDir = "data" data Settings =…
altern
  • 5,829
  • 5
  • 44
  • 72
2
votes
1 answer

Avoiding oracle, OR separating oracles of the same type

I have the following situation: find-deps is an external program that is very quick to run, and discovers dependency information, similar to ghc -M. Its output is some file deps. compile is an external program that is very slow to run; unlike ghc…
Cactus
  • 27,075
  • 9
  • 69
  • 149
2
votes
1 answer

How can I get console input mid-build in Shake?

For various unfortunate reasons, part of my build requires root privileges. I'm trying to use sudo for this: cmd_ "sudo other_script.sh" [input] [output] However, presumably because of how Shake handles console input/output, I cannot actually enter…
Alex O'Brien
  • 459
  • 1
  • 6
  • 13
2
votes
1 answer

How to build for different environments using shake-build?

Is there a built-in way to pass command-line arguments to a "shakefile"? I'd like to pass --env production|development|staging and then use it within my rules to (slightly) alter the build-steps for each environment.
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
2
votes
1 answer

Shake: Inherit stderr

Using Shake, I am calling cdparanoia. cdparanoia outputs a useful progress meter (including graphics to display issues) when its stderr is connected to a terminal; but not otherwise. The --stderr-progress forces some progress output, but it's not…
user3416536
  • 1,429
  • 9
  • 20
2
votes
1 answer

Is it possible for Shake to change a source file?

When running tools such as formatters and linting tools with "auto-correction" options, it can be that the input and output for a Rule are the same file; for example: "//*.hs" %> \out -> cmd_ "ormolu" "-m" "inplace" out -- OR batch 10…
mavnn
  • 9,101
  • 4
  • 34
  • 52
2
votes
2 answers

shake - rule finished running but did not produce file:

I try to use shake to convert some markdonw files to html ("bake"). The markdown files are in a directory "dough" and the html should go to "baked". The goal is to produce the index.html file, which links the other files. This is my first use of…
user855443
  • 2,596
  • 3
  • 25
  • 37
2
votes
1 answer

Is there a way to get Shake (build system) to show all the Rules that were generated

I have a lot of rules i'm generating via calling functions with parameters (similar rules that vary slightly depending on which project to build) and when no parameters are passed or a "show_all" is passed as a target I'd like to list out all the…
sbditto85
  • 1,485
  • 14
  • 21
2
votes
1 answer

Shake depending on on node_modules directory

I am using Shake with an npm based project, but am baffled by how to handle the node_modules folder. The flow should be simple from what I can tell: Any change to package.json would cause node_modules to be re-populated. All the changes to…
Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85
2
votes
1 answer

Running an Action if part of a file changes

What is the recommended way of running some Action if part of a file changes? My use-case is given a file that I know exists (concretely elm-package.json), run a shell command (elm package install --yes) if part of the file changes (the dependencies…
Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85
2
votes
1 answer

Handling multiple build configurations in parallel

How can I build one set of source files using two different configurations without having to rebuild everything? My current setup adds an option --config=rel which will load all options from build_rel.cfg and compile everything to the directory…
nesqi
  • 97
  • 7
2
votes
1 answer

Building a C++ project that links to a Haskell library, using Shake and Stack

I'm trying to build a simple C++ project (an executable) that calls a Haskell function, using Shake for the build script and calling Stack from within the script to build the Haskell library. Let's say the Haskell library is called…
2
votes
1 answer

How to override Shake configuration on the command-line

I maintain small configuration files per project read via usingConfigFile. I'd like to be able to override any of those settings on the command line. It seems using shakeArgsWith (rather than shakeArgs) is the first step on the way but I don't see…
marangisto
  • 260
  • 2
  • 8
1 2
3
8 9