error

13 views
Skip to first unread message

nicolas...@gmail.com

unread,
Dec 1, 2015, 1:30:18 PM12/1/15
to Shake build system
it's for sure some small pb on my part, but I am now encountering an error, so I just put it out there if someone experience the same in the future :


upon running the rule


"_build/builder" <.> exe %> \out -> do
unit $ cmd "stack build --stack-yaml=stack.yaml" $ takeFileName out
cmd ("cp $(stack path --stack-yaml=stack.yaml --local-install-root)/bin/" ++ (takeFileName out)) out


I get a failure on the second command

Error when running Shake build system:
* _build/builder
user error (Development.Shake.cmd, system command failed
Command: cp $(stack path --stack-yaml=stack.yaml --local-install-root)/bin/builder _build/builder
Exit code: 64
Stderr:
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
)

solution maybe later

nicolas...@gmail.com

unread,
Dec 1, 2015, 1:51:51 PM12/1/15
to Shake build system, nicolas...@gmail.com
as forecasted

"_build/builder" <.> exe %> \out -> do
unit $ cmd "stack build --stack-yaml=stack.yaml" $ takeFileName out

Stdout localinstallroot <- cmd "stack path --stack-yaml=stack.yaml --local-install-root"
cmd "cp " (trim localinstallroot ++ "/bin/" ++ (takeFileName out)) out

so nested shell not encouraged. good call

Ryan Gonzalez

unread,
Dec 1, 2015, 2:01:51 PM12/1/15
to nicolas...@gmail.com, Shake build system
On Tue, Dec 1, 2015 at 12:51 PM, <nicolas...@gmail.com> wrote:
as forecasted

   "_build/builder" <.> exe %> \out -> do
        unit $ cmd "stack build --stack-yaml=stack.yaml"  $ takeFileName out
        Stdout localinstallroot <- cmd "stack path --stack-yaml=stack.yaml --local-install-root"
        cmd "cp " (trim localinstallroot ++ "/bin/" ++ (takeFileName out)) out

so nested shell not encouraged. good call


Indeed, Shake doesn't run commands using the shell. If you REALLY want shell access, you can do:

cmd Shell ("cp $(stack path --stack-yaml=stack.yaml --local-install-root)/bin/" ++ (takeFileName out)) out
 
On Tuesday, December 1, 2015 at 7:30:18 PM UTC+1, nicolas...@gmail.com wrote:
> it's for sure some small pb on my part, but I am now encountering an error, so I just put it out there if someone experience the same in the future :
>
>
> upon running the rule
>
>
>    "_build/builder" <.> exe %> \out -> do
>         unit $ cmd "stack build --stack-yaml=stack.yaml"  $ takeFileName out
>         cmd ("cp $(stack path --stack-yaml=stack.yaml --local-install-root)/bin/" ++ (takeFileName out)) out
>
>
> I get a failure on the second command
>
> Error when running Shake build system:
> * _build/builder
> user error (Development.Shake.cmd, system command failed
> Command: cp $(stack path --stack-yaml=stack.yaml --local-install-root)/bin/builder _build/builder
> Exit code: 64
> Stderr:
> usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
>        cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
> )
>
>
>
> solution maybe later




--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.

Neil Mitchell

unread,
Dec 2, 2015, 8:12:25 AM12/2/15
to Ryan Gonzalez, Nicolas R, Shake build system
Ryan's answer is spot on - by default Shake uses RawCommand from
https://hackage.haskell.org/package/process-1.4.1.0/docs/System-Process.html#t:CmdSpec,
which is equivalent to calling the process directly passing arguments.
If you add Shell it switches to ShellCommand which goes via a shell.

The downsides of Shell are it is platform-specific (and sometimes
"what your /bin/sh alias is" specific), and has more overhead (an
extra process). It's sometimes necessary, but relatively rarely.
Reply all
Reply to author
Forward
0 new messages