Skip to content

vscode rust devcontainer: cargo build resulting in "failed to link or copy #13905

Open
@dss010101

Description

Problem

Im not sure if should be reaching out here or vscode for help on this...but i will start here and let me know if im int he wrong location..

i have built a vs code devcontainer based on mcr.microsoft.com/devcontainers/rust:1-1-bullseye, running under Docker Desktop on windows 11. I am able to run a basic example using this without any dependencies

i have the following structure (Note: the target and Cargo.lock do not exist until after i attempt a cargo build:

enter image description here

My toml looks like this:

[package]
name = "aipg_client"
version = "0.1.0"
edition = "2021"

#[dependencies]
#tokio-postgres = "0.7.10"

when i do Cargo build or run from command line, i see this:

vscode ➜ /workspaces/aipg_client $ cargo clean
     Removed 19 files, 3.7MiB total
vscode ➜ /workspaces/aipg_client $ cargo build
   Compiling aipg_client v0.1.0 (/workspaces/aipg_client)
warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.2wavitxjlghb5boo.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/2wavitxjlghb5boo.o`: Operation not permitted (os error 1)

warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.340xt2kclbcozwj5.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/340xt2kclbcozwj5.o`: Operation not permitted (os error 1)

warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.3nlg3iffbximniu8.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/3nlg3iffbximniu8.o`: Operation not permitted (os error 1)

warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.57xak5150to06626.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/57xak5150to06626.o`: Operation not permitted (os error 1)

warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.ele9p2lo4vgyfma.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/ele9p2lo4vgyfma.o`: Operation not permitted (os error 1)

warning: error copying object file `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1.eyyxtxgek58rknf.rcgu.o` to incremental directory as `/workspaces/aipg_client/target/debug/incremental/aipg_client-cn2ostj37iq8/s-gw2y4x6qjv-d1xpw0-working/eyyxtxgek58rknf.o`: Operation not permitted (os error 1)

warning: `aipg_client` (bin "aipg_client") generated 6 warnings
error: failed to link or copy `/workspaces/aipg_client/target/debug/deps/aipg_client-29a466bd116893b1` to `/workspaces/aipg_client/target/debug/aipg_client`

Caused by:
  Operation not permitted (os error 1)

i checked these folders and they are all r/w.
What am i doing wrong?

Steps

  1. Create a vscode dev container: CTRL+SHIFT+P -> devcontainer:new -> rust
  2. Note: i jused a Dockerfile + Docker Compose along with .devcontainer.json. but the issue is reproducible with just a .devcontainer.json file
  3. Install rust analyzer extension in the container
  4. from bash terminal: cargo new test
  5. run cargo build twice

Possible Solution(s)

I dont know yet

Notes

No response

Version

rustc 1.78.0 (9b00956e5 2024-04-29)
cargo 1.78.0 (54d8815 2024-03-26)

vscode ➜ /workspaces/aipg_client $ cargo -vV
cargo 1.78.0 (54d8815 2024-03-26)
release: 1.78.0
commit-hash: 54d8815
commit-date: 2024-03-26
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Debian 11 (bullseye) [64-bit]

vscode ➜ /workspaces/aipg_client $ cat /etc/debian_version
11.9
docker desktop v4.29.0
No response

Metadata

Assignees

No one assigned

    Labels

    A-filesystemArea: issues with filesystemsC-bugCategory: bugO-windowsOS: WindowsS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions