Z
Zerops3w ago
Dally

Cloning and using a repository on build

Hello, i'm struggling a little but to build a rust app in the rust build container. I want to clone a git repository, cd into it and run build, however it looks like the cd command is not working as i would expect, and also i cannot clone the repository to current working folder because it is not empty. What should be the recommended way to do this?
2025-01-07T07:41:43.120Z ━━━━ ✅ git clone --depth 1 --branch musl-fix https://github.com/dallyh/libsql.git ━━━━
2025-01-07T07:41:43.120Z
2025-01-07T07:41:43.122Z
2025-01-07T07:41:43.122Z ━━━━ 🙏 cd libsql ━━━━
2025-01-07T07:41:43.122Z
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z ━━━━ ✅ cd libsql ━━━━
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z ━━━━ 🙏 cargo build -p libsql-server --release ━━━━
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.164Z error: could not find `Cargo.toml` in `/build/source` or any parent directory
2025-01-07T07:41:43.166Z
2025-01-07T07:41:43.166Z ━━━━ ❌ cargo build -p libsql-server --release ━━━━
2025-01-07T07:41:43.120Z ━━━━ ✅ git clone --depth 1 --branch musl-fix https://github.com/dallyh/libsql.git ━━━━
2025-01-07T07:41:43.120Z
2025-01-07T07:41:43.122Z
2025-01-07T07:41:43.122Z ━━━━ 🙏 cd libsql ━━━━
2025-01-07T07:41:43.122Z
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z ━━━━ ✅ cd libsql ━━━━
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.124Z ━━━━ 🙏 cargo build -p libsql-server --release ━━━━
2025-01-07T07:41:43.124Z
2025-01-07T07:41:43.164Z error: could not find `Cargo.toml` in `/build/source` or any parent directory
2025-01-07T07:41:43.166Z
2025-01-07T07:41:43.166Z ━━━━ ❌ cargo build -p libsql-server --release ━━━━
2 Replies
Michal Saloň
Michal Saloň3w ago
Every command is run in separate shell, so you need to run cd xxx && cargo build Or
- |
cd xxx
cargo build
- |
cd xxx
cargo build
Dally
DallyOP3w ago
Oh, yeah havent thought of that, thank you

Did you find this page helpful?