Microsoft Dev Container is not compiling Rust during the runtime phase

29 Views Asked by At

I aim to develop my project within a Dev Container to leverage its isolated and consistent development environment capabilities. While the project appears to compile successfully during the build phase, I encounter issues during the runtime phase, where the packages do not compile as expected.

Dockerfile (tried different images rust, ubuntu, debian but same behavior):

# Start from the latest Ubuntu image as the base
FROM mcr.microsoft.com/devcontainers/base:ubuntu

# Install locales and set the default locale to en_US.UTF-8
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
    && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8

# Install necessary packages for building Rust projects
# This includes curl, build-essential for compiling dependencies, and libpq-dev for PostgreSQL support
RUN apt-get update && apt-get install -y curl build-essential libpq-dev

# Optionally upgrade all packages to their latest versions
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && rm -rf /var/lib/apt/lists/*

# Install Rust and Cargo using Rustup by downloading and running the Rustup installer script
# This makes Rust and Cargo available in the PATH
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# RUN rustup update nightly && rustup default nightly

# Install Diesel CLI with only the "postgres" feature
# This step is necessary if you're using Diesel for ORM in a Rust project with PostgreSQL
RUN cargo install diesel_cli --no-default-features --features postgres

# Set /usr/src/app as the working directory
# This directory will be the root directory of your Rust project within the container
WORKDIR /usr/src/app

# Copy the current directory contents into the container at /usr/src/app
# This step is useful for copying your source code into the image, but in your case,
# it might be redundant due to the volume mapping in docker-compose.yml
COPY . .

# The CMD command is omitted in this Dockerfile because the actual command to run the Rust application
# will be provided by the docker-compose.yml configuration. This provides flexibility for development.

# This Dockerfile sets up the environment and dependencies.
# The runtime command and code mounting are handled by docker-compose for a development workflow.
RUN cargo build
RUN cargo build --release
RUN chmod -R 777 target


docker-compose.yml:

version: '3.8'

services:
  app:
    build: .
    volumes:
      - .:/usr/src/app
    depends_on:
      - db
    ports:
       - "8080:8080"  # Maps port 8080 on the host to port 8080 in the container
    env_file:
      - .env
    command: sleep infinity

  db:
    image: postgres:latest
    volumes:
      - postgres_data:/var/lib/postgresql/data
    env_file:
      - .env
    ports:
      - "5433:5432"  # Maps port 5433 on the host to port 5432 in the container

volumes:
  postgres_data:

Output when I build:

linux@linux-1-0:~/code/rust-learn$ docker-compose up --build
[+] Building 468.5s (16/16) FINISHED                                                                                            docker:colima
 => [app internal] load build definition from Dockerfile                                                                                 0.0s
 => => transferring dockerfile: 2.13kB                                                                                                   0.0s
 => [app internal] load .dockerignore                                                                                                    0.0s
 => => transferring context: 2B                                                                                                          0.0s
 => [app internal] load metadata for mcr.microsoft.com/devcontainers/base:ubuntu                                                         0.5s
 => [app  1/11] FROM mcr.microsoft.com/devcontainers/base:ubuntu@sha256:08845a02c0472bb026f9cc4bb74bccaf2039945e7a9b41c4dbcce578c1830d4  0.0s
 => [app internal] load build context                                                                                                    0.2s
 => => transferring context: 35.38kB                                                                                                     0.2s
 => CACHED [app  2/11] RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/*     && localedef -i en_US -c -f   0.0s
 => CACHED [app  3/11] RUN apt-get update && apt-get install -y curl build-essential libpq-dev                                           0.0s
 => CACHED [app  4/11] RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && rm -rf /var/lib/apt/lists/*            0.0s
 => CACHED [app  5/11] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y                                       0.0s
 => CACHED [app  6/11] RUN cargo install diesel_cli --no-default-features --features postgres                                            0.0s
 => CACHED [app  7/11] WORKDIR /usr/src/app                                                                                              0.0s
 => [app  8/11] COPY . .                                                                                                                 0.2s
 => [app  9/11] RUN cargo build                                                                                                        132.2s
 => [app 10/11] RUN cargo build --release                                                                                              276.7s
 => [app 11/11] RUN chmod -R 777 target                                                                                                 43.2s
 => [app] exporting to image                                                                                                            14.8s
 => => exporting layers                                                                                                                 14.7s
 => => writing image sha256:b19745855a8edd99febcaffc02d5ca6ceb45dfa274376fdc7727e2708b789373                                             0.0s
 => => naming to docker.io/library/rust-learn-app                                                                                        0.1s
[+] Running 3/3
 ✔ Network rust-learn_default  Created                                                                                                   0.1s 
 ✔ Container rust-learn-db-1   Created                                                                                                   0.4s 
 ✔ Container rust-learn-app-1  Created    

But when I try to build again in Dev container:

vscode ➜ /usr/src/app (master) $ sudo su
root ➜ /usr/src/app (master) $ cargo build
   Compiling proc-macro2 v1.0.70
   Compiling libc v0.2.151
error: failed to build archive: 'libc-6c2047d403069015.libc.eadf2d7e0f6422ae-cgu.0.rcgu.o': section header table goes past the end of the file: e_shoff = 0x3cf70

error: could not compile `libc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to build archive: 'proc_macro2-1d2f752adcb009c4.proc_macro2.a80e9495546eca59-cgu.6.rcgu.o': section table goes past the end of file

error: could not compile `proc-macro2` (lib) due to 1 previous error
root ➜ /usr/src/app (master) $ 

I tried to clean cache and build:

root ➜ /usr/src/app (master) $ cargo clean
     Removed 54 files, 19.6MiB total
root ➜ /usr/src/app (master) $ cargo build
   Compiling proc-macro2 v1.0.70
   Compiling libc v0.2.151
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcI5yW5G/symbols.o" "/usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.0.rcgu.o" "/usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o" "/usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o" "/usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.br1bi5e9ohhaj41.rcgu.o" "-Wl,--as-needed" "-L" "/usr/src/app/target/debug/deps" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-320ebc7037fb8f95.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-5c5363659220970d.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-bec15aa2c4312c4c.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-fe71d6e60bf77974.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-0f5608a77595bf7e.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-b8b7c25fe3bad107.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-0f75b33b546e9dfc.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-2c2d79a7fce0ec84.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-d29140320fecac62.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-9274a8eb44eefdb5.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-4c1e8c7ac02fe45d.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-0f62d6b334d8a8b9.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-56f5161b8051bb71.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-659f33ab33d4b7a0.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-194ca45e594e82cf.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-8de8e7171366ad5b.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-dd54ac19f2116694.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-7466f872aeeff38e.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-9886ca42a5954174.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `<<alloc::collections::btree::map::IntoIter<K,V,A> as core::ops::drop::Drop>::drop::DropGuard<K,V,A> as core::ops::drop::Drop>::drop':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN174_$LT$$LT$alloc..collections..btree..map..IntoIter$LT$K$C$V$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$..drop..DropGuard$LT$K$C$V$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h2bd825ba6d80810dE+0x57): undefined reference to `alloc::collections::btree::node::Handle<alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Dying,K,V,NodeType>,alloc::collections::btree::node::marker::KV>::drop_key_val'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::boxed::Box<dyn core::ops::function::FnMut<()>+Output = core::result::Result<(),std::io::error::Error>+core::marker::Send+core::marker::Sync>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr228drop_in_place$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$$RP$$GT$$u2b$Output$u20$$u3d$$u20$core..result..Result$LT$$LP$$RP$$C$std..io..error..Error$GT$$u2b$core..marker..Send$u2b$core..marker..Sync$GT$$GT$17h750a7fcaf9d30d5cE+0x1e): undefined reference to `<alloc::boxed::Box<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr228drop_in_place$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$$RP$$GT$$u2b$Output$u20$$u3d$$u20$core..result..Result$LT$$LP$$RP$$C$std..io..error..Error$GT$$u2b$core..marker..Send$u2b$core..marker..Sync$GT$$GT$17h750a7fcaf9d30d5cE+0x39): undefined reference to `<alloc::boxed::Box<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::raw_vec::RawVec<alloc::boxed::Box<dyn core::ops::function::FnMut<()>+Output = core::result::Result<(),std::io::error::Error>+core::marker::Send+core::marker::Sync>>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr258drop_in_place$LT$alloc..raw_vec..RawVec$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$$RP$$GT$$u2b$Output$u20$$u3d$$u20$core..result..Result$LT$$LP$$RP$$C$std..io..error..Error$GT$$u2b$core..marker..Send$u2b$core..marker..Sync$GT$$GT$$GT$17h0b84a4305f5aa609E+0x2): undefined reference to `<alloc::raw_vec::RawVec<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17hcc609a71fe0f7f72E+0x2): undefined reference to `<alloc::raw_vec::RawVec<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<std::io::error::repr_bitpacked::Repr>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr57drop_in_place$LT$std..io..error..repr_bitpacked..Repr$GT$17h8b8466cdf6617c77E+0x2): undefined reference to `<std::io::error::repr_bitpacked::Repr as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::boxed::Box<[u8]>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr58drop_in_place$LT$alloc..boxed..Box$LT$$u5b$u8$u5d$$GT$$GT$17ha4a994dfa9161b35E+0xd): undefined reference to `<alloc::boxed::Box<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::boxed::Box<[u32]>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr59drop_in_place$LT$alloc..boxed..Box$LT$$u5b$u32$u5d$$GT$$GT$17hd9564b1d5d09227bE+0xd): undefined reference to `<alloc::boxed::Box<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::raw_vec::RawVec<*const i8>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr67drop_in_place$LT$alloc..raw_vec..RawVec$LT$$BP$const$u20$i8$GT$$GT$17h0b5050b52a1e7f5dE+0x2): undefined reference to `<alloc::raw_vec::RawVec<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::ptr::drop_in_place<alloc::raw_vec::RawVec<alloc::ffi::c_str::CString>>':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3ptr77drop_in_place$LT$alloc..raw_vec..RawVec$LT$alloc..ffi..c_str..CString$GT$$GT$17hf856640a52a7b7f1E+0x2): undefined reference to `<alloc::raw_vec::RawVec<T,A> as core::ops::drop::Drop>::drop'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::str::validations::next_code_point':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3str11validations15next_code_point17h1a7cb10ef4b51d04E+0xa): undefined reference to `<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3str11validations15next_code_point17h1a7cb10ef4b51d04E+0x99): undefined reference to `<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3str11validations15next_code_point17h1a7cb10ef4b51d04E+0x100): undefined reference to `<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3str11validations15next_code_point17h1a7cb10ef4b51d04E+0x146): undefined reference to `<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::str::traits::<impl core::cmp::PartialEq for str>::eq':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core3str6traits54_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$str$GT$2eq17h57a78b85743678d6E+0x2d): undefined reference to `<[A] as core::slice::cmp::SlicePartialEq<B>>::equal'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::iter::traits::double_ended::DoubleEndedIterator::try_rfold':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core4iter6traits12double_ended19DoubleEndedIterator9try_rfold17h93a5a628bb2325abE+0x9d): undefined reference to `core::iter::traits::double_ended::DoubleEndedIterator::rfind::check::{{closure}}'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `core::slice::<impl [T]>::starts_with':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hbde3eaa21644ff51E+0x80): undefined reference to `<[A] as core::slice::cmp::SlicePartialEq<B>>::equal'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `alloc::collections::btree::map::IntoIter<K,V,A>::dying_next':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN5alloc11collections5btree3map25IntoIter$LT$K$C$V$C$A$GT$10dying_next17he76083a09aa1be8fE+0x2e): undefined reference to `alloc::collections::btree::navigate::LazyLeafRange<alloc::collections::btree::node::marker::Dying,K,V>::deallocating_end'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN5alloc11collections5btree3map25IntoIter$LT$K$C$V$C$A$GT$10dying_next17he76083a09aa1be8fE+0x65): undefined reference to `alloc::collections::btree::navigate::LazyLeafRange<alloc::collections::btree::node::marker::Dying,K,V>::deallocating_next_unchecked'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `<alloc::collections::btree::map::IntoIter<K,V,A> as core::ops::drop::Drop>::drop':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text._ZN99_$LT$alloc..collections..btree..map..IntoIter$LT$K$C$V$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h431ddc27f3f22a99E+0x53): undefined reference to `alloc::collections::btree::node::Handle<alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Dying,K,V,NodeType>,alloc::collections::btree::node::marker::KV>::drop_key_val'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.1.rcgu.o: in function `main':
          build_script_build.888a6c65ea88cc32-cgu.1:(.text.main+0x11): undefined reference to `std::rt::lang_start'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `core::str::pattern::simd_contains':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern13simd_contains17hfdff16dc554bfed9E+0x971): undefined reference to `core::iter::traits::iterator::Iterator::try_fold'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `core::str::pattern::simd_contains::{{closure}}':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern13simd_contains28_$u7b$$u7b$closure$u7d$$u7d$17h416d2d4840c12f6bE+0x7e): undefined reference to `core::core_simd::masks::mask_impl::Mask<T,_>::to_bitmask_integer'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `core::str::pattern::TwoWaySearcher::next':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern14TwoWaySearcher4next17h43dda9c03109b4a0E+0x1bc): undefined reference to `core::cmp::max_by'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `core::str::pattern::TwoWaySearcher::next':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern14TwoWaySearcher4next17h83433e0de282943aE+0x1bc): undefined reference to `core::cmp::max_by'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `core::str::pattern::small_slice_eq':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern14small_slice_eq17hb529adf93e607108E+0xb9): undefined reference to `core::iter::traits::iterator::Iterator::zip'
          /usr/bin/ld: build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN4core3str7pattern14small_slice_eq17hb529adf93e607108E+0x19f): undefined reference to `<core::iter::adapters::zip::Zip<A,B> as core::iter::adapters::zip::ZipImpl<A,B>>::next'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `<&str as core::str::pattern::Pattern>::is_contained_in':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$15is_contained_in17ha8f24efcdcf73d7aE+0xf9): undefined reference to `<[A] as core::slice::cmp::SlicePartialEq<B>>::equal'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `<core::str::pattern::StrSearcher as core::str::pattern::Searcher>::next':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h90ee45c02cdc2aa2E+0x33b): undefined reference to `core::cmp::max_by'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621.build_script_build.888a6c65ea88cc32-cgu.2.rcgu.o: in function `<core::str::pattern::CharSearcher as core::str::pattern::Searcher>::next_match':
          build_script_build.888a6c65ea88cc32-cgu.2:(.text._ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h3b54ce133f4d9972E+0x29e): undefined reference to `<[A] as core::slice::cmp::SlicePartialEq<B>>::equal'
          /usr/bin/ld: /usr/src/app/target/debug/build/proc-macro2-5df71f02774a5621/build_script_build-5df71f02774a5621: hidden symbol `_ZN72_$LT$alloc..boxed..Box$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h9395906bf801bcd8E' isn't defined
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `proc-macro2` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
0

There are 0 best solutions below