intel / intel/confidential-computing.sgx.sdk

docker build fails from 2.20

Open
#138 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

# Background
I follow the instructions [here](https://github.com/intel/linux-sgx/tree/f656e74afd6ecdbdc2d7397db7ebd46d8cf46ca6/docker/build) to build docker images, but it fails with error `fatal: not a git repository`.

# Steps to reproduce
```bash
git clone https://github.com/intel/linux-sgx
cd linux-sgx/
git checkout tags/
make preparation
cd docker/build
./build_and_run_aesm_docker.sh
```

For tag being `sgx_2.20`, `sgx_2.21` or master branch, the following error is printed
```
make[3]: Leaving directory '/linux-sgx/sdk/utls'
make -C /linux-sgx/external/mbedtls
make[3]: Entering directory '/linux-sgx/external/mbedtls'
Apply patch for SGX...
fatal: not a git repository: /linux-sgx/external/mbedtls/mbedtls_code/../../../.git/modules/external/mbedtls/mbedtls_code
Makefile:57: recipe for target 'library/libmbedcrypto.a' failed
make[3]: Leaving directory '/linux-sgx/external/mbedtls'
make[3]: *** [library/libmbedcrypto.a] Error 128
Makefile.source:242: recipe for target 'mbedtls' failed
make[2]: Leaving directory '/linux-sgx/sdk'
make[2]: *** [mbedtls] Error 2
Makefile:50: recipe for target 'all' failed
make[1]: Leaving directory '/linux-sgx/sdk'
make[1]: *** [all] Error 2
Makefile:66: recipe for target 'sdk_no_mitigation' failed
make: *** [sdk_no_mitigation] Error 2
The command '/bin/sh -c make sdk_install_pkg_no_mitigation' returned a non-zero code: 2
```
For `sgx_2.19`, the docker build finished without error.
So I suspect this issue is related to `mbedtls/mbedtls_code` which is added since release 2.20.

# Environment
- Ubuntu 20.04

Contributor guide

Open the contributing guide

Research direction

Start with docker/build/build_and_run_aesm_docker.sh and external/mbedtls/Makefile, then reproduce the failure using the listed checkout and make commands on Ubuntu 20.04. Check how external/mbedtls/mbedtls_code resolves its Git metadata for sgx_2.20, sgx_2.21, and master; done means the Docker build completes successfully for the affected versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, docker
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.