Gitlab and Rust

I am trying to setup the automatic build and deployment for when i push to my gitlab repo. I tried for a build command "npx wrangler build", but i get the following error. Am i using the wrong command? 15:35:32.333 Initializing build environment... 15:35:32.333 Initializing build environment... 15:35:42.786 Success: Finished initializing build environment 15:35:43.453 Cloning repository... 15:35:45.263 Detected the following tools from environment: [email protected], [email protected] 15:35:45.264 Installing project dependencies: npm clean-install --progress=false 15:35:47.688 npm warn deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. 15:35:47.723 npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead 15:35:51.777
15:35:51.777 added 80 packages, and audited 81 packages in 6s 15:35:51.778
15:35:51.778 12 packages are looking for funding 15:35:51.778 run npm fund for details 15:35:51.783
15:35:51.783 4 vulnerabilities (2 low, 1 moderate, 1 high) 15:35:51.783
15:35:51.784 To address all issues, run: 15:35:51.784 npm audit fix 15:35:51.784
15:35:51.786 Run npm audit for details.
1 Reply
Alpha
AlphaOP•6d ago
15:48:39.041 Running custom build: cargo install -q worker-build && worker-build --release
15:48:39.044 /bin/sh: 1: cargo: not found
15:48:39.041 Running custom build: cargo install -q worker-build && worker-build --release
15:48:39.044 /bin/sh: 1: cargo: not found
I think the issue is no cargo in the build enviroment? not sure what i can do about that though... Found the solution in #🦀rust-on-workers
build command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

deploy command:
. "$HOME/.cargo/env" && npx wrangler deploy
build command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

deploy command:
. "$HOME/.cargo/env" && npx wrangler deploy

Did you find this page helpful?