jiengup opened a new issue, #3612:
URL: https://github.com/apache/iggy/issues/3612
## Description
`docker compose -f docker-compose.test.yml up --build` fails when building
the `python-tests` service image. The `maturin develop` step cannot find the
Rust source files.
## Steps to Reproduce
```bash
cd foreign/python
docker compose -f docker-compose.test.yml up --build
```
## Error
The `python-tests` image build fails at the `uv run maturin develop` step:
```
=> ERROR [python-tests base 10/14] RUN uv run maturin develop
------
> [python-tests base 10/14] RUN uv run maturin develop:
------
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `"cargo" "rustc"
...`
error: failed to parse manifest at `/workspace/foreign/python/Cargo.toml`
Caused by:
can't find `src/lib.rs` or `src/main.rs` at `./src/`
```
Cargo expects `src/lib.rs` at `/workspace/foreign/python/src/lib.rs`, but it
does not exist because the files were copied to `/workspace/src/` instead.
## Root Cause
In `foreign/python/Dockerfile.test`, the `WORKDIR` is set to `/workspace` at
line 47, and the `COPY` on line 62:
```dockerfile
COPY foreign/python/src/ ./src/
```
copies the Rust source files to **`/workspace/src/`** instead of
**`/workspace/foreign/python/src/`**.
Later, at line 65, `WORKDIR` switches to `/workspace/foreign/python`, and
`maturin develop` (line 67) runs from that directory. It looks for `src/`
relative to the current working directory (`/workspace/foreign/python/src/`),
which does not exist. Build fails.
## Proposed Fix
Change the `COPY` destination to place the source files under the correct
`foreign/python/` directory:
```diff
-COPY foreign/python/src/ ./src/
+COPY foreign/python/src/ ./foreign/python/src/
```
This fix is in commit `9cbf283f0` on branch `fix/python-docker-test`.
See also: `foreign/python/Dockerfile.test:62`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]