You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit: I tried with 0.19 and it seems I have the error message everytime. I am pretty sure I misused shake :). Still there might be some underlying issue. So I'll let you close it.
While I was trying to use shake to generate a static website I stumble upon this strange behavior.
For me it looks like a bug.
So the here is a self-contained way to reproduce the problem:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
importProtoludeimportDevelopment.ShakeimportDevelopment.Shake.CommandimportDevelopment.Shake.FilePathimportDevelopment.Shake.Utilmain::IO()
main = shakeArgs shOpts buildRules
where
shOpts =
shakeOptions
{ shakeVerbosity =Chatty
, shakeLintInside = ["\\"]
}
siteDir::FilePath
siteDir ="_site"optimDir::FilePath
optimDir ="_optim"build::FilePath->FilePath
build =(</>) siteDir
copy::FilePath->Action()
copy out =dolet src ="src"</> (dropDirectory1 out)
copyFileChanged src out
cleanRule::Rules()
cleanRule =
phony "clean"$do
putInfo "Cleaning files in _site and _optim"
forM_ [siteDir,optimDir] $flip removeFilesAfter ["//*"]
buildRules::Rules()
buildRules =do
cleanRule
build "//*"%> copy
> ./build.sh clean
[1 of 1] Compiling Main ( Shakefile.hs, _shake/Main.o )
Linking _shake/build ...
# clean
Cleaning files in _site and _optim
Will remove //* from _site
Will remove //* from _optim
Build completed in 0.00s
work as expected
> ./build.sh _site/posts/0010-Haskell-Now/index.org
# _site/posts/0010-Haskell-Now/index.org
Copying from src/posts/0010-Haskell-Now/index.org to _site/posts/0010-Haskell-Now/index.org
Build completed in 0.00s
also copy as expected.
But when trying on .hs files or .jpg files:
> ./build.sh _site/posts/0010-Haskell-Now/list.hs
# _site/posts/0010-Haskell-Now/list.hs
# src/posts/0010-Haskell-Now/list.hs
Error when running Shake build system:
at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shake-0.18.5-8T3hsb7Jhgk1bvj5gpap6X:Development.Shake.Internal.Args
* Depends on: _site/posts/0010-Haskell-Now/list.hs
at copyFileChanged, called at Shakefile.hs:34:3 in main:Main
at need, called at src/Development/Shake/Internal/Derived.hs:104:5 in shake-0.18.5-8T3hsb7Jhgk1bvj5gpap6X:Development.Shake.Internal.Derived
* Depends on: src/posts/0010-Haskell-Now/list.hs
at copyFileChanged, called at Shakefile.hs:34:3 in main:Main
at need, called at src/Development/Shake/Internal/Derived.hs:104:5 in shake-0.18.5-8T3hsb7Jhgk1bvj5gpap6X:Development.Shake.Internal.Derived
* Depends on: src/posts/0010-Haskell-Now/list.hs
* Raised the exception:
Build system error - recursion detected:
Key type: FileQ
Key value: src/posts/0010-Haskell-Now/list.hs
Rules may not be recursive
Edits:
the same problem occurs if I use copyFile' instead of copyFileChanged.
Ah, I know what the issue is! You are using // style escapes. The issue with them is that:
`"_site" </> "//*"
Gives //* because </> is documented to return the second component if it is already absolute. You can fix it by moving to the new-style file patterns, writing:
`"_site" </> "**"
Which means the same thing. The plan is to slowly deprecate // - I should follow up on that plan as its a horrible default because its so easy to get wrong with </>.
Edit: I tried with 0.19 and it seems I have the error message everytime. I am pretty sure I misused shake :). Still there might be some underlying issue. So I'll let you close it.
While I was trying to use shake to generate a static website I stumble upon this strange behavior.
For me it looks like a bug.
So the here is a self-contained way to reproduce the problem:
And my
build.sh
file:And then I try to execute
work as expected
also copy as expected.
But when trying on
.hs
files or.jpg
files:Edits:
copyFile'
instead ofcopyFileChanged
.shell.nix
:The text was updated successfully, but these errors were encountered: