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
4
votes
2 answers

How should I let Shake know that 'ghc --make' is needed to track changes to haskell files?

I want to know the recommended way to use shake and ghc --make together. In my project, the shake rules are used to compile C source code into their *.o files (which I call cobjects), and these objects are linked together into my haskell program by…
Ein
  • 1,553
  • 3
  • 15
  • 22
4
votes
1 answer

Conditionally using the .exe extension with the Shake build system

Using the wonderful Shake build system, I want to compile a project in a a way which is agnostic to the host operating system. I have trouble detecting the presence of binaries because they have a different extension across systems (ie: Windows uses…
kvanbere
  • 3,289
  • 3
  • 27
  • 52
4
votes
1 answer

Would it be feasible to extend shake to being a configuration tool too?

In the vein of Puppet/Chef; I would really like to use Shake for more than just local builds. I think the principles of Shake are abstract enough (I haven't dug deep though to know) that it could be used as the foundation for a larger configuration…
Ixmatus
  • 1,051
  • 9
  • 15
4
votes
1 answer

Adding system' actions should change the rule history

I have this kind of rule: "foo" *> \out do need something create "foo" somehow It's built correctly, and running the build twice won't build the target. Then I add a system' to this rule: "foo" *> \out do ... system' something Running…
lethalman
  • 1,976
  • 1
  • 14
  • 18
3
votes
1 answer

How to run shake without stack

I created the recommended build.sh file from the "Running" section of the Shake manual: #!/bin/sh mkdir -p _shake ghc --make Shakefile.hs -v -rtsopts -threaded -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@" but running…
avh4
  • 2,635
  • 1
  • 22
  • 25
3
votes
1 answer

How can `forP` be executed in an action?

An action expects a return value of Action (), but forP returns an Action[()]. How can it be executed in an action?
adius
  • 13,685
  • 7
  • 45
  • 46
3
votes
1 answer

How to debug shake rules execution?

I love Shake as a build system, but one thing I find hard with Shake is to troubleshoot rules triggering issues. I often run into a situation where I think something should not be rebuilt yet it is rebuilt. What are some guidelines to troubleshoot…
insitu
  • 4,488
  • 3
  • 25
  • 42
3
votes
1 answer

How do I skip a shake Action?

I'd like to download a bunch of web pages with shake, then do some processing on them. However, I'd also like the option to download the pages outside of shake, tell shake I've done so, and let shake continue with the remainder of the processing…
Daniel Wagner
  • 145,880
  • 9
  • 220
  • 380
3
votes
1 answer

Haskell shake: special rule for building directories

Sometimes it is the case that to create a directory mkdir is not the right tool. It may be git clone or rsync or mount. So when we have a rule like this: needDir dirs = filterM ((fmap not) . doesDirectoryExist) dirs >>= need rules = do { …
fakedrake
  • 6,528
  • 8
  • 41
  • 64
3
votes
1 answer

Why Shake dependencies are explicitly `needed`?

I find first example of Shake usage demonstrating a pattern that seems error prone: contents <- readFileLines $ out -<.> "txt" need contents cmd "tar -cf" [out] contents Why do we need need contents when readFileLines reads them and cmd…
sevo
  • 4,559
  • 1
  • 15
  • 31
3
votes
1 answer

Shake: Signal whether anything had to be rebuilt at all

I use shake to build a bunch of static webpages, which I then have to upload to a remote host, using sftp. Currently, the cronjob runs git pull # get possibly updated sources ./my-shake-system lftp ... # upload I’d like to avoid running the final…
Joachim Breitner
  • 25,395
  • 6
  • 78
  • 139
3
votes
2 answers

Shake for cross-compilations?

I've got a project that builds two sets of targets. One is firmware for various version of a handheld device that ultimately creates a .dfu file for each device. This uses the arm compilation chain. The other set are emulators for those same devices…
3
votes
2 answers

How to define a timer rule in Shake

I'm trying to understand how to use Shake and how to build new rules. As an exercise, I've decided to implement what I call a backup rule. The idea is to generate a file if it doesn't exists OR if it's too old (let's more than 24 hour). I like to…
mb14
  • 22,276
  • 7
  • 60
  • 102
3
votes
2 answers

How can Shake FilePatterns be used to minify JS and CSS files?

Common practice with .js and .css file minification is to create .min.js and .min.css files. The problem is Shake FilePatterns will match both minified and non-minified files with this scheme with a pattern like //*.js. The docs seem to recommend…
Luke Hoersten
  • 8,355
  • 3
  • 21
  • 18
3
votes
1 answer

How does Shake decide whether to rebuild a target?

I'm confused about the rules Shake uses to work out whether an output needs to be rebuilt. I have a simple build for documents with two steps. The full build file is below but to summarise, asciidoc is used to transform a .txt file into a .dbxml…
Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
1
2
3
8 9