{"action":"created","issue":{"url":"https://api.github.com/repos/spark/firmware/issues/507","labels_url":"https://api.github.com/repos/spark/firmware/issues/507/labels{/name}","comments_url":"https://api.github.com/repos/spark/firmware/issues/507/comments","events_url":"https://api.github.com/repos/spark/firmware/issues/507/events","html_url":"https://github.com/spark/firmware/issues/507","id":97269122,"number":507,"title":"'stat: command not found' when building on Windows","user":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars.githubusercontent.com/u/8040367?v=3","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-26T00:17:08Z","updated_at":"2015-08-10T13:54:48Z","closed_at":null,"body":"When I follow the [Getting Started directions](https://github.com/spark/firmware/blob/develop/docs/gettingstarted.md), it succeeds up to the 'ARM GNU Create Flash Image' step. It creates `main.bin.pre_crc`, `main.bin.no_crc`, `main.elf` and `main.map`, as well as `.bin.pre_crc`, `.bin.no_crc`, `.elf` and `.map` files for my application name.\r\n\r\nThe build process worked for the Core firmware in 2014 when I followed [the instructions](https://github.com/spark/firmware/blob/master/README.md). Something has changed; the stat error is new.\r\n\r\nGit for Windows' bin folder does not contain a stat executable. Is there a workaround I can apply to the build script to make it platform-sensitive or is there something else I should install that the instructions didn't specify?\r\n\r\n> [...]\r\n> Invoking: ARM GNU Create Flash Image\r\n> arm-none-eabi-objcopy -O binary ../build/target/main/platform-0/main.elf ../build/target/main/platform-0/main.bin.pre_crc\r\n> if [ -s ../build/target/main/platform-0/main.bin.pre_crc ]; then \\\r\n>         head -c $((`stat --print %s ../build/target/main/platform-0/main.bin.pre_crc` - 38)) ../build/target/main/platform-0/main.bin.pre_crc > ../build/target/main/platform-0/main.bin.no_crc && \\\r\n>         tail -c 38 ../build/target/main/platform-0/main.bin.pre_crc > ../build/target/main/platform-0/main.bin.crc_block && \\\r\n>         test \"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20280078563412\" = `xxd -p -c 500 ../build/target/main/platform-0/main.bin.crc_block` && \\\r\n>         ../build/bin/win32/sha256sum ../build/target/main/platform-0/main.bin.no_crc | cut -c 1-65 | xxd -r -p | dd bs=1 of=../build/target/main/platform-0/main.bin.pre_crc seek=$((`stat --print %s ../build/target/main/platform-0/main.bin.pre_crc` - 38)) conv=notrunc  && \\\r\n>         head -c $((`stat --print %s ../build/target/main/platform-0/main.bin.pre_crc` - 4)) ../build/target/main/platform-0/main.bin.pre_crc > ../build/target/main/platform-0/main.bin.no_crc && \\\r\n>          crc32 ../build/target/main/platform-0/main.bin.no_crc | cut -c 1-10 | xxd -r -p | dd bs=1 of=../build/target/main/platform-0/main.bin.pre_crc seek=$((`stat --print %s ../build/target/main/platform-0/main.bin.pre_crc` - 4)) conv=notrunc ;\\\r\n>         fi\r\n> /usr/bin/sh: line 1: stat: command not found\r\n> head: -38: invalid number of bytes\r\n> make: *** [../build/target/main/platform-0/main.bin] Error 1\r\n\r\nI tried downloading http://gnuwin32.sourceforge.net/packages/stat.htm to `C:\\Program Files (x86)\\GnuWin32\\bin` beside `make.exe`. Now instead of `/usr/bin/sh: line 1: stat: command not found`, I get:\r\n\r\n> c:\\PROGRA~2\\GNUWIN32\\BIN\\stat.exe: invalid option -- -\r\n> Usage: c:\\PROGRA~2\\GNUWIN32\\BIN\\stat.exe [-l] [-f] file1 [file2 ...]"},"comment":{"url":"https://api.github.com/repos/spark/firmware/issues/comments/129461436","html_url":"https://github.com/spark/firmware/issues/507#issuecomment-129461436","issue_url":"https://api.github.com/repos/spark/firmware/issues/507","id":129461436,"user":{"login":"m-mcgowan","id":2465470,"avatar_url":"https://avatars.githubusercontent.com/u/2465470?v=3","gravatar_id":"","url":"https://api.github.com/users/m-mcgowan","html_url":"https://github.com/m-mcgowan","followers_url":"https://api.github.com/users/m-mcgowan/followers","following_url":"https://api.github.com/users/m-mcgowan/following{/other_user}","gists_url":"https://api.github.com/users/m-mcgowan/gists{/gist_id}","starred_url":"https://api.github.com/users/m-mcgowan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-mcgowan/subscriptions","organizations_url":"https://api.github.com/users/m-mcgowan/orgs","repos_url":"https://api.github.com/users/m-mcgowan/repos","events_url":"https://api.github.com/users/m-mcgowan/events{/privacy}","received_events_url":"https://api.github.com/users/m-mcgowan/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T13:54:48Z","updated_at":"2015-08-10T13:54:48Z","body":"Good idea @jnm2! At present, the docs for the build are in github, but we should definitely add a link to that form the main docs site so that everything is available/searchable from one place. "}}