Go to file
Yann E. MORIN fbddd12601 support/download: fix concurrent cargo vendor
Commit 8450b76918 (package/pkg-cargo: move CARGO_HOME into DL_DIR)
allowed for a shared cargo cache of crates. Internally, cargo is
supposed to lock themselves when accessing that cache, and that commit
even had some research in that area, pointing at [0] for complaints
about too-coarse the lock, so it was deemed safe to have a shared cargo
home.

However, in practice, the locking as implemented by cargo, fails to
properly protect the concurrent accesses to the crates cache, with random
failures that manifest themselves like so:

        Blocking waiting for file lock on package cache
        Blocking waiting for file lock on package cache
     Downloading crates ...
    error: failed to sync
    Caused by:
      failed to download packages
    Caused by:
      failed to download `autocfg v1.1.0`
    Caused by:
      unable to get packages from source
    Caused by:
      failed to unpack package `autocfg v1.1.0`
    Caused by:
      failed to unpack entry at `autocfg-1.1.0/src/tests.rs`
    Caused by:
      No such file or directory (os error 2) while canonicalizing [...]

with the last few errors sometime being:

    Caused by:
      failed to parse manifest at `[...]/aho-corasick-0.7.18/Cargo.toml`
    Caused by:
      can't find library `aho_corasick`, rename file to `src/lib.rs` or specify lib.path

So, as we do not systematically use our own cargo build (we can use a
pre-built one with host-rust-bin), we can't patch cargo (even if we knew
what to do!).

Instead, we implement a lock ourselves, by wrapping the call to "cargo
vendor" with a flock(1) on cargo home.

Note: the download wrapper is already flock-ed, but it is a per-package
lock, so it does not prevent different packages from being downloaded in
parallel; if those packages need cargo vendoring, that will not be
protected by the flock on the dl wrapper. So we really do need a flock
on cargo home.

[0] https://github.com/rust-lang/cargo/issues/6930

Fixes: 8450b76918

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Moritz Bitsch <moritz@h6t.eu>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-01-14 21:00:16 +01:00
arch arch/arch.mk.xtensa: relax check on overlay file to apply only to internal toolchains 2022-11-13 22:32:31 +01:00
board board/orangepi-zero-plus: bump Linux/U-Boot and switch to extlinux 2023-01-12 20:21:32 +01:00
boot boot/barebox: bump version to 2022.12.0 2023-01-12 11:44:48 +01:00
configs board/orangepi-zero-plus: bump Linux/U-Boot and switch to extlinux 2023-01-12 20:21:32 +01:00
docs docs/website: update sponsors.html page 2023-01-11 22:21:11 +01:00
fs fs/ext2: generate Y2K38-resilient filesystems 2022-12-14 20:29:11 +01:00
linux {linux, linux-headers}: bump 4.9.x / 5.{10, 15}.x / 6.{0, 1}.x series 2023-01-13 11:21:08 +01:00
package package/unbound: bump version to 1.17.1 2023-01-14 11:53:11 +01:00
support support/download: fix concurrent cargo vendor 2023-01-14 21:00:16 +01:00
system system: add options for /var factory and tmpfiles pre-seed 2022-12-22 11:07:59 +01:00
toolchain {toolchain, linux-headers}: add support for 6.1 headers 2022-12-18 14:56:37 +01:00
utils package/perl: bump to version 5.36.0 2023-01-12 20:33:22 +01:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2022.02.8 2022-12-10 20:57:31 +01:00
Config.in security hardening: add support for glibc _FORTIFY_SOURCE=3 2022-12-31 18:41:58 +01:00
Config.in.legacy package/qemu: refactor target emulator selection 2022-12-29 22:34:52 +01:00
COPYING
DEVELOPERS DEVELOPERS: add Daniel Lang for package/libsigc 2023-01-12 20:25:36 +01:00
Makefile Makefile: fix use of many br2-external trees 2023-01-07 21:09:21 +01:00
Makefile.legacy
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches