Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build for Raspi #41

Closed
AustinRobinson opened this issue Feb 25, 2020 · 9 comments
Closed

Unable to build for Raspi #41

AustinRobinson opened this issue Feb 25, 2020 · 9 comments

Comments

@AustinRobinson
Copy link

AustinRobinson commented Feb 25, 2020

When I run make TARGET=Raspi all I get the following output:

Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM dev-test/raspiadk-base as build
 ---> 079fd7b4cb3b
Step 2/3 : WORKDIR /build
 ---> Using cache
 ---> fe6aec93152f
Step 3/3 : FROM build
 ---> fe6aec93152f
Successfully built fe6aec93152f
/bin/sh: 1: clang: not found
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c PAL/HAPPlatformSystemInit.c -o Output/Raspi-/Test/PAL/HAPPlatformSystemInit.o
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c Tests/HAPCryptoTest.c -o Output/Raspi-/Test/Tests/HAPCryptoTest.o
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPBLEAccessoryServer.c -o Output/Raspi-/Test/HAP/HAPBLEAccessoryServer.o
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPPairingPairVerify.c -o Output/Raspi-/Test/HAP/HAPPairingPairVerify.o
make: clang: Command not found
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/PAL/HAPPlatformSystemInit.o] Error 127
make: *** Waiting for unfinished jobs....
make: *** [Build/Makefile:108: Output/Raspi-/Test/Tests/HAPCryptoTest.o] Error 127
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPRequestHandlers+Pairing.c -o Output/Raspi-/Test/HAP/HAPRequestHandlers+Pairing.o
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPBLETransaction.c -o Output/Raspi-/Test/HAP/HAPBLETransaction.o
make: clang: Command not found
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPBLEAccessoryServer.o] Error 127
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPPairingPairVerify.o] Error 127
make: clang: Command not found
make: clang: Command not found
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPDeviceID.c -o Output/Raspi-/Test/HAP/HAPDeviceID.o
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPRequestHandlers+Pairing.o] Error 127
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPBLETransaction.o] Error 127
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPDeviceID.o] Error 127
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1  -ffunction-sections -fdata-sections -DLED_PORT=\"/sys/class/leds/led0/brightness\" -DLED_TRIGGER=\"/sys/class/leds/led0/trigger\" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1      -DHAP_TESTING -IPAL/Mock   -DHAP_Test -c HAP/HAPPDU.c -o Output/Raspi-/Test/HAP/HAPPDU.o
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/HAP/HAPPDU.o] Error 127
make: *** [all] Error 2

But I have clang installed and it is in my path. Here is the output of clang --version

Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@hubertwang
Copy link

Same error here

Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM dev-test/raspiadk-base as build
---> a607ec600c56
Step 2/3 : WORKDIR /build
---> Using cache
---> 89b8b8161649
Step 3/3 : FROM build
---> 89b8b8161649
Successfully built 89b8b8161649
/bin/sh: 1: clang: not found
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1 -ffunction-sections -fdata-sections -DLED_PORT="/sys/class/leds/led0/brightness" -DLED_TRIGGER="/sys/class/leds/led0/trigger" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1 -DHAP_TESTING -IPAL/Mock -DHAP_Test -c PAL/HAPPlatformSystemInit.c -o Output/Raspi-/Test/PAL/HAPPlatformSystemInit.o
clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1 -ffunction-sections -fdata-sections -DLED_PORT="/sys/class/leds/led0/brightness" -DLED_TRIGGER="/sys/class/leds/led0/trigger" -DRPI -I/opt/vc/include -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=1 -DHAP_TESTING -IPAL/Mock -DHAP_Test -c Tests/HAPCryptoTest.c -o Output/Raspi-/Test/Tests/HAPCryptoTest.o
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/PAL/HAPPlatformSystemInit.o] Error 127
make: *** Waiting for unfinished jobs....
make: clang: Command not found
make: *** [Build/Makefile:108: Output/Raspi-/Test/Tests/HAPCryptoTest.o] Error 127
make: *** [all] Error 2

Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@ghost
Copy link

ghost commented Feb 27, 2020

@hubertwang, could you please try this?

docker run -ti dev-test/raspiadk-base /bin/bash
clang --version

seems that clang is not seen in your docker container.

@hubertwang
Copy link

hubertwang commented Feb 27, 2020

clang --version

Hi @hao-gao ,

Here is the result:
HomeKitADK % docker run -ti dev-test/raspiadk-base /bin/bash
root@33b97ea16514:/# clang --version
bash: clang: command not found

You are right, seems clang is not in my docker container.
Not sure if I missed some step during configuration.

Should we install clang manually and run again?

@ghost
Copy link

ghost commented Feb 27, 2020

I am not sure if all dependencies are correctly installed with the raspi_setup_sdcard.sh.
Dependencies are here:
https://github.com/apple/HomeKitADK/blob/master/Tools/raspi_sdcard_setup.sh#L606

@hubertwang
Copy link

hubertwang commented Feb 27, 2020

@hao-gao Oh.....I remember the last message I receive is "Volume failed to eject"
Maybe this cause the script to interrupt. (seems block by antivirus)
I'll try if diskutil unmountDisk "force" can fix the issue

@hubertwang
Copy link

Hmm..unmount has force option, but eject don't
Still stuck on the same position

  • rm .tmp/2019-07-10-raspbian-buster-lite.img
  • sleep 5
  • set +x
    Password:
    Volume failed to eject (I think it's LINE 485)

@ghost
Copy link

ghost commented Feb 27, 2020

Before importing sd card's rootfs as a docker image, make sure you followed this instruction of you console output: [the code]
Ensure SD card is inserted and power cycle Raspi.
If this is the first boot after FS expansion, wait 60 seconds then power cycle Raspi a second time.

Hope this helps.

@AustinRobinson
Copy link
Author

I was able to get this working. I think the dependencies didn't install correctly the first few times I tried it.

@hubertwang
Copy link

Ah, forgot to say, I was able to get it work, too.
It's my environment issue, anti virus blocked some instruction.
After I changed to another mac everything works.

Thank you for the detailed instruction @hao-gao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants