diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5557ee55d..ebf5be280 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: id: generate-matrix run: cargo xtask ci-job target-matrix ${{ github.event_name == 'merge_group' && format('--merge-group {0}', github.ref) || '' }} ${{ inputs.matrix-args || '' }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} build: name: target (${{ matrix.pretty }},${{ matrix.os }}) @@ -168,7 +168,7 @@ jobs: - name: LLVM instrument coverage id: cov uses: ./.github/actions/cargo-llvm-cov - if: steps.prepare-meta.outputs.has-image && steps.prepare-meta.outputs.test-variant != 'zig' + if: steps.prepare-meta.outputs.has-image && steps.prepare-meta.outputs.test-variant != 'zig' with: name: cross-${{matrix.pretty}} @@ -189,7 +189,7 @@ jobs: id: build-docker-image if: steps.prepare-meta.outputs.has-image timeout-minutes: 120 - run: cargo xtask build-docker-image -v "${TARGET}${SUB:+.$SUB}" ${{ matrix.verbose && '-v' || '' }} + run: cargo xtask build-docker-image -v "${TARGET}${SUB:+.$SUB}" ${{ matrix.verbose && '-v' || '' }} env: TARGET: ${{ matrix.target }} SUB: ${{ matrix.sub }} @@ -243,7 +243,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ github.token }} - name: Push image to GitHub Container Registry if: > (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && @@ -401,10 +401,25 @@ jobs: - uses: ./.github/actions/cargo-publish with: cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ github.token }} conclusion: - needs: [shellcheck, fmt, clippy, test, generate-matrix, build, publish, check, remote, bisect, docker-in-docker, foreign, podman] + needs: + [ + shellcheck, + fmt, + clippy, + test, + generate-matrix, + build, + publish, + check, + remote, + bisect, + docker-in-docker, + foreign, + podman, + ] if: always() runs-on: ubuntu-latest steps: diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml index cbaa02b9f..b3dd95489 100644 --- a/.github/workflows/try.yml +++ b/.github/workflows/try.yml @@ -14,7 +14,7 @@ jobs: gh pr comment ${{ github.event.issue.number }} --body " Starting try run. [Link to action](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.issue.number }})" env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} continue-on-error: true try: if: github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && (contains(toJson(github.event.comment.body), '\n/ci try') || startsWith(github.event.comment.body, '/ci try')) @@ -35,7 +35,7 @@ jobs: gh api graphql -f query='mutation { minimizeComment(input: { classifier: OUTDATED, subjectId: "'"$comment_id"'" }) { minimizedComment { isMinimized } } }' done <<< "$COMMENTS" env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} continue-on-error: true # comment on the PR with the result and links to the logs using gh cli # Something like `### Try build: [{result}]({link_to_logs})` diff --git a/Cargo.lock b/Cargo.lock index a6937f536..2624ed55d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -52,15 +52,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "backtrace" @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "bstr" @@ -124,15 +124,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.1" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "cc" -version = "1.2.51" +version = "1.2.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" +checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" dependencies = [ "find-msvc-tools", "shlex", @@ -152,9 +152,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.42" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", "js-sys", @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.53" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", @@ -175,9 +175,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.53" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.49" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck", "proc-macro2", @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "color-eyre" @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "const-sha1" @@ -277,9 +277,9 @@ dependencies = [ "signal-hook", "tempfile", "thiserror", - "toml 0.9.10+spec-1.1.0", + "toml", "walkdir", - "which 8.0.0", + "which", "winapi", ] @@ -335,18 +335,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "env_home" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" - [[package]] name = "equivalent" version = "1.0.2" @@ -375,21 +363,45 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "find-msvc-tools" -version = "0.1.6" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "futures-core" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "libc", @@ -429,9 +441,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "heck" @@ -456,9 +468,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -502,9 +514,9 @@ checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" [[package]] name = "indexmap" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", "hashbrown", @@ -535,16 +547,18 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -557,43 +571,36 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.178" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libredox" -version = "0.1.12" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" dependencies = [ - "bitflags", "libc", ] [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "log" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" [[package]] name = "miniz_oxide" @@ -636,9 +643,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -654,9 +661,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "owo-colors" -version = "4.2.3" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" +checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" dependencies = [ "supports-color 2.1.0", "supports-color 3.0.2", @@ -664,24 +671,24 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "proc-macro2" -version = "1.0.104" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -698,16 +705,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -717,9 +724,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -728,15 +735,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "rustc-demangle" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc_version" @@ -749,27 +756,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.11.0", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -790,9 +784,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" @@ -836,9 +830,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -849,18 +843,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_spanned" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -888,15 +873,15 @@ checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a37d01603c37b5466f808de79f845c7116049b0579adb70a6b7d47c1fa3a952" +checksum = "b2a0c28ca5908dbdbcd52e6fdaa00358ab88637f8ab33e1f188dd510eb44b53d" dependencies = [ "libc", "signal-hook-registry", @@ -912,6 +897,12 @@ dependencies = [ "libc", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "strsim" version = "0.11.1" @@ -939,9 +930,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.112" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -957,24 +948,24 @@ dependencies = [ "fastrand", "getrandom 0.3.4", "once_cell", - "rustix 1.1.3", + "rustix", "windows-sys 0.61.2", ] [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", @@ -992,38 +983,17 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "toml_edit", -] - -[[package]] -name = "toml" -version = "0.9.10+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.0.4", - "toml_datetime 0.7.5+spec-1.1.0", + "serde_spanned", + "toml_datetime", "toml_parser", "toml_writer", - "winnow 0.7.14", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", + "winnow 0.7.15", ] [[package]] @@ -1035,33 +1005,20 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "winnow 0.5.40", -] - [[package]] name = "toml_parser" -version = "1.0.6+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow 0.7.14", + "winnow 1.0.3", ] [[package]] name = "toml_writer" -version = "1.0.6+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tracing" @@ -1095,9 +1052,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" dependencies = [ "sharded-slab", "thread_local", @@ -1106,9 +1063,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "utf8parse" @@ -1149,9 +1106,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" dependencies = [ "cfg-if", "once_cell", @@ -1162,9 +1119,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1172,9 +1129,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" dependencies = [ "bumpalo", "proc-macro2", @@ -1185,34 +1142,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" dependencies = [ "unicode-ident", ] [[package]] name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.44", -] - -[[package]] -name = "which" -version = "8.0.0" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d" +checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" dependencies = [ - "env_home", - "rustix 1.1.3", - "winsafe", + "libc", ] [[package]] @@ -1395,24 +1338,15 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" [[package]] name = "winnow" -version = "0.7.14" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" - -[[package]] -name = "winsafe" -version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" [[package]] name = "wit-bindgen" @@ -1434,14 +1368,14 @@ dependencies = [ "serde", "serde_json", "shell-words", - "toml 0.7.8", + "toml", "walkdir", - "which 4.4.2", + "which", "wildmatch", ] [[package]] name = "zmij" -version = "1.0.6" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac060176f7020d62c3bcc1cdbcec619d54f48b07ad1963a3f80ce7a0c17755f" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 0bda11a18..7878bdd0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "cross" repository = "https://github.com/cross-rs/cross" version = "0.2.5" -edition = "2021" +edition = "2024" include = [ "src/**/*", "docs/*.md", @@ -28,43 +28,43 @@ members = ["xtask"] [dependencies] is-terminal = "0.4.2" -clap = { version = "4.1.4", features = ["derive"] } +clap = { version = "4.5.45", features = ["derive"] } color-eyre = { version = "0.6.5", default-features = false, features = ["track-caller"] } -eyre = "0.6.8" +eyre = "0.6.12" thiserror = "2.0" -home = "0.5.4" +home = "0.5.11" rustc_version = "0.4.0" toml = "0.9" which = "8.0" shell-escape = "0.1.5" -serde = { version = "1.0.152", features = ["derive"] } -serde_json = { version = "1.0.91", features = ["raw_value"] } -serde_ignored = "0.1.7" +serde = { version = "1.0.219", features = ["derive"] } +serde_json = { version = "1.0.143", features = ["raw_value"] } +serde_ignored = "0.1.12" shell-words = "1.1.0" const-sha1 = "0.3" signal-hook = { version = "0.4" } directories = "6.0" walkdir = { version = "2.3.2", optional = true } -tempfile = "3.3.0" -owo-colors = { version = "4.0", features = ["supports-colors"] } -semver = "1.0.16" -is_ci = "1.1.1" +tempfile = "=3.24.0" +owo-colors = { version = "4.2.2", features = ["supports-colors"] } +semver = "1.0.26" +is_ci = "1.2.0" [target.'cfg(not(windows))'.dependencies] -nix = { version = "0.30", default-features = false, features = ["user"] } -libc = "0.2.139" +nix = { version = "0.30.1", default-features = false, features = ["user"] } +libc = "0.2.175" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.9", features = ["winbase"] } -dunce = "1.0.3" +dunce = "1.0.5" [profile.release] lto = true [dev-dependencies] -regex = "1.7.1" -once_cell = "1.17.0" -ignore = "0.4.20" +regex = "1.11.2" +once_cell = "1.21.3" +ignore = "0.4.23" [package.metadata.release] push = false diff --git a/README.md b/README.md index 8ccb9123c..6e2554857 100644 --- a/README.md +++ b/README.md @@ -324,8 +324,12 @@ $ QEMU_STRACE=1 cross run --target aarch64-unknown-linux-gnu This crate is guaranteed to compile on stable Rust 1.85.0 and up. It *might* compile with older versions but that may change in any new patch release. -Some cross-compilation targets require a later Rust version, and using Xargo -requires a nightly Rust toolchain. +Some cross-compilation targets require a later Rust version. + +### Xargo + +"Xargo" is no longer supported since its maintenance was stopped a long time ago, +most of the functionality is available when using `build-std`. ## License diff --git a/ci/shared.sh b/ci/shared.sh index be112abd9..64e5e4f47 100755 --- a/ci/shared.sh +++ b/ci/shared.sh @@ -45,6 +45,7 @@ function mkcargotemp { echo '# Cargo.toml [workspace] members = ["'"$(basename "$td")"'"] + resolver = "3" ' > "$CARGO_TMP_DIR"/Cargo.toml echo "$td" } diff --git a/ci/test-cross-image.sh b/ci/test-cross-image.sh index 55c04b047..a77f9bb4b 100755 --- a/ci/test-cross-image.sh +++ b/ci/test-cross-image.sh @@ -7,9 +7,13 @@ set -eo pipefail if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi -# ^^subst is not supported on macOS bash (bash <4) + # shellcheck disable=SC2155 -export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}') +export TARGET_UPPER=${TARGET_UPPER^^} + +# OCI does not support uppercase characters from orga/owner names +IMAGE=${IMAGE,,} +CROSS_IMAGE=${CROSS_IMAGE,,} if [[ "${IMAGE}" ]]; then # shellcheck disable=SC2140 diff --git a/ci/test-docker-in-docker.sh b/ci/test-docker-in-docker.sh index 0fa89a07a..1d5a1967c 100755 --- a/ci/test-docker-in-docker.sh +++ b/ci/test-docker-in-docker.sh @@ -9,9 +9,13 @@ set -eo pipefail if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi -# ^^subst is not supported on macOS bash (bash <4) + # shellcheck disable=SC2155 -export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}') +export TARGET_UPPER=${TARGET_UPPER^^} + +# OCI does not support uppercase characters from orga/owner names +IMAGE=${IMAGE,,} +CROSS_IMAGE=${CROSS_IMAGE,,} if [[ "${IMAGE}" ]]; then # shellcheck disable=SC2140 diff --git a/ci/test-podman.sh b/ci/test-podman.sh index 4e49f7ab6..fba97a8a1 100755 --- a/ci/test-podman.sh +++ b/ci/test-podman.sh @@ -11,6 +11,9 @@ if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi +# OCI does not support uppercase characters from orga/owner names +CROSS_IMAGE=${CROSS_IMAGE,,} + ci_dir=$(dirname "${BASH_SOURCE[0]}") ci_dir=$(realpath "${ci_dir}") . "${ci_dir}"/shared.sh diff --git a/ci/test-remote.sh b/ci/test-remote.sh index e9a4bec63..7d51aa874 100755 --- a/ci/test-remote.sh +++ b/ci/test-remote.sh @@ -11,6 +11,9 @@ if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi +# OCI does not support uppercase characters from orga/owner names +CROSS_IMAGE=${CROSS_IMAGE,,} + ci_dir=$(dirname "${BASH_SOURCE[0]}") ci_dir=$(realpath "${ci_dir}") . "${ci_dir}"/shared.sh diff --git a/ci/test.sh b/ci/test.sh index 147c6b06f..337e06bec 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -22,7 +22,7 @@ workspace_test() { main() { local td= - retry cargo fetch + retry cargo fetch --target "${TARGET}" cargo build # Unset RUSTFLAGS @@ -69,22 +69,28 @@ main() { https://github.com/rust-lang-nursery/compiler-builtins "${td}" pushd "${td}" - retry cargo fetch + # FIXME: this cargo fetch will pull more than needed, need a `cargo fetch -p` + retry cargo fetch --target "${TARGET}" # don't use xargo: should have native support just from rustc rustup toolchain add nightly - cross_build --lib --target "${TARGET}" + cross_build -p compiler_builtins --lib --target "${TARGET}" popd rm -rf "${td}" fi + # Solaris: Map old to new symbols. compat.o is compiled in solaris.sh during image build. + # - https://github.com/cross-rs/cross/issues/1599 + # - https://github.com/cross-rs/cross/issues/1730 + [[ ${TARGET} == *-solaris ]] && export RUSTFLAGS+=' -C link-arg=/compat.o' + # `cross build` test for the other targets if [[ "${TARGET}" == *-unknown-emscripten ]]; then td=$(mkcargotemp -d) pushd "${td}" cargo init --lib --name foo . - retry cargo fetch + retry cargo fetch --target "${TARGET}" cross_build --target "${TARGET}" popd @@ -96,7 +102,7 @@ main() { pushd "${td}" # test that linking works cargo init --bin --name hello . - retry cargo fetch + retry cargo fetch --target "${TARGET}" cross_build --target "${TARGET}" popd @@ -176,7 +182,7 @@ main() { git clone --depth 1 https://github.com/cross-rs/rust-cpp-accumulate "${td}" pushd "${td}" - retry cargo fetch + retry cargo fetch --target "${TARGET}" cross_build --target "${TARGET}" popd @@ -190,7 +196,7 @@ main() { git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}" pushd "${td}" - retry cargo fetch + retry cargo fetch --target "${TARGET}" if (( ${RUN:-0} )); then cross_run --target "${TARGET}" else @@ -208,7 +214,7 @@ main() { pushd "${td}" cargo init --bin --name hello . - retry cargo fetch + retry cargo fetch --target "${TARGET}" RUSTFLAGS="$RUSTFLAGS -C target-feature=-crt-static" \ cross_build --target "${TARGET}" popd @@ -225,7 +231,7 @@ main() { https://github.com/cross-rs/rust-cmake-hello-world "${td}" pushd "${td}" - retry cargo fetch + retry cargo fetch --target "${TARGET}" if [[ "${TARGET}" == "arm-linux-androideabi" ]]; then # ARMv5te isn't supported anymore by Android, which produces missing # symbol errors with re2 like `__libcpp_signed_lock_free`. diff --git a/crosstool-ng/arm-unknown-linux-gnueabihf.config.in b/crosstool-ng/arm-unknown-linux-gnueabihf.config.in index 2ec7d18f0..a4c4cb579 100644 --- a/crosstool-ng/arm-unknown-linux-gnueabihf.config.in +++ b/crosstool-ng/arm-unknown-linux-gnueabihf.config.in @@ -19,3 +19,8 @@ CT_GMP_V_6_1=y CT_ISL_V_0_20=y CT_LIBICONV_V_1_15=y CT_NCURSES_V_6_1=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +GLIBC_MAKEINFO_WORKAROUND=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/crosstool-ng/loongarch64-unknown-linux-gnu.config.in b/crosstool-ng/loongarch64-unknown-linux-gnu.config.in index 24d862768..a63b2fa44 100644 --- a/crosstool-ng/loongarch64-unknown-linux-gnu.config.in +++ b/crosstool-ng/loongarch64-unknown-linux-gnu.config.in @@ -14,3 +14,7 @@ CT_KERNEL_LINUX=y %CT_GCC% CT_CC_GCC_ENABLE_DEFAULT_PIE=y CT_CC_LANG_CXX=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/crosstool-ng/loongarch64-unknown-linux-musl.config.in b/crosstool-ng/loongarch64-unknown-linux-musl.config.in index a149d278b..b16a190e0 100644 --- a/crosstool-ng/loongarch64-unknown-linux-musl.config.in +++ b/crosstool-ng/loongarch64-unknown-linux-musl.config.in @@ -14,3 +14,7 @@ CT_LIBC_MUSL=y %CT_GCC% CT_CC_GCC_ENABLE_DEFAULT_PIE=y CT_CC_LANG_CXX=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/deny.toml b/deny.toml index 1dd86f894..b8bdfa322 100644 --- a/deny.toml +++ b/deny.toml @@ -16,6 +16,8 @@ deny = [] skip = [ # home v0.5.11 { name = "windows-sys", version = "0.59.0" }, + # toml v0.9 uses winnow 0.7 directly, while toml_parser (sub-dep of toml) uses winnow 1.0 + { name = "winnow", version = "0.7" }, ] skip-tree = [ { name = "supports-color", depth = 1, version = "2.1.0", reason = "owo-colors pulls in two versions of supports-color" }, diff --git a/docker/Dockerfile.aarch64-linux-android b/docker/Dockerfile.aarch64-linux-android index 1372b35bc..402a37853 100644 --- a/docker/Dockerfile.aarch64-linux-android +++ b/docker/Dockerfile.aarch64-linux-android @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.aarch64-unknown-freebsd b/docker/Dockerfile.aarch64-unknown-freebsd index 951b7f165..29454cc10 100644 --- a/docker/Dockerfile.aarch64-unknown-freebsd +++ b/docker/Dockerfile.aarch64-unknown-freebsd @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index a8f32936d..0a28709f6 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu.centos b/docker/Dockerfile.aarch64-unknown-linux-gnu.centos index a4f77be5e..41bcae60d 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu.centos @@ -1,5 +1,6 @@ -FROM ubuntu:20.04 AS base +FROM ubuntu:24.04 AS base +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY lib.sh / COPY linux-image.sh / RUN /linux-image.sh aarch64 diff --git a/docker/Dockerfile.aarch64-unknown-linux-musl b/docker/Dockerfile.aarch64-unknown-linux-musl index 3be79a939..2707e83f0 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-musl +++ b/docker/Dockerfile.aarch64-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.aarch64_be-unknown-linux-gnu b/docker/Dockerfile.aarch64_be-unknown-linux-gnu index 822b0f002..28aebfae3 100644 --- a/docker/Dockerfile.aarch64_be-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64_be-unknown-linux-gnu @@ -1,6 +1,7 @@ FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.arm-linux-androideabi b/docker/Dockerfile.arm-linux-androideabi index d60d192e4..cdcc49228 100644 --- a/docker/Dockerfile.arm-linux-androideabi +++ b/docker/Dockerfile.arm-linux-androideabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index 2d7f272bc..53db553c1 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabihf b/docker/Dockerfile.arm-unknown-linux-gnueabihf index c10ac3419..21bbcef9a 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabihf +++ b/docker/Dockerfile.arm-unknown-linux-gnueabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.arm-unknown-linux-musleabi b/docker/Dockerfile.arm-unknown-linux-musleabi index 1be893c24..c4fd3b9f1 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabi +++ b/docker/Dockerfile.arm-unknown-linux-musleabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.arm-unknown-linux-musleabihf b/docker/Dockerfile.arm-unknown-linux-musleabihf index a9ed9a184..48dbfea27 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabihf +++ b/docker/Dockerfile.arm-unknown-linux-musleabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv5te-unknown-linux-gnueabi b/docker/Dockerfile.armv5te-unknown-linux-gnueabi index a9e606344..4f2238bfe 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv5te-unknown-linux-gnueabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv5te-unknown-linux-musleabi b/docker/Dockerfile.armv5te-unknown-linux-musleabi index 5e4b659ae..ff4173635 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-musleabi +++ b/docker/Dockerfile.armv5te-unknown-linux-musleabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv7-linux-androideabi b/docker/Dockerfile.armv7-linux-androideabi index a49c451e9..6c3854acd 100644 --- a/docker/Dockerfile.armv7-linux-androideabi +++ b/docker/Dockerfile.armv7-linux-androideabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabi b/docker/Dockerfile.armv7-unknown-linux-gnueabi index 2e74ebcef..23af0a591 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index 87de3bffc..a37b04038 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabi b/docker/Dockerfile.armv7-unknown-linux-musleabi index 909aaff80..7cb9a4f97 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabi +++ b/docker/Dockerfile.armv7-unknown-linux-musleabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabihf b/docker/Dockerfile.armv7-unknown-linux-musleabihf index f88498098..3bb083e0d 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabihf +++ b/docker/Dockerfile.armv7-unknown-linux-musleabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.asmjs-unknown-emscripten b/docker/Dockerfile.asmjs-unknown-emscripten index 0da5c9b13..03ac81167 100644 --- a/docker/Dockerfile.asmjs-unknown-emscripten +++ b/docker/Dockerfile.asmjs-unknown-emscripten @@ -2,6 +2,7 @@ FROM emscripten/emsdk:3.1.14 WORKDIR / ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.cross b/docker/Dockerfile.cross index c836cabf6..365dbfe67 100644 --- a/docker/Dockerfile.cross +++ b/docker/Dockerfile.cross @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 AS rust +FROM ubuntu:24.04 AS rust ENV DEBIAN_FRONTEND=noninteractive COPY docker/lib.sh docker/cross.sh / COPY ./ /project @@ -6,15 +6,17 @@ RUN /cross.sh /project # we build our images in 2 steps, to ensure we have a compact # image, since we want to add our current subdirectory -FROM ubuntu:20.04 AS base +FROM ubuntu:24.04 AS base COPY --from=rust /root/.cargo /root/.cargo COPY --from=rust /root/.rustup /root/.rustup # need some basic devtools, and requirements for docker +COPY docker/ubuntu.sources /etc/apt/sources.list.d/ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ ca-certificates \ curl \ git +RUN sed -i 's|http://|https://|' /etc/apt/sources.list.d/ubuntu.sources RUN curl -fsSL https://get.docker.com | sh diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index 026c82f91..5ba5c714e 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh @@ -14,6 +15,13 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gfortran-i686-linux-gnu \ libc6-dev-i386-cross +# Make i686 libraries available on host to test target binary +RUN ln -s /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libgcc_s.so.1 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libc.so.6 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libstdc++.so.6 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libm.so.6 /lib/ + COPY deny-debian-packages.sh / RUN TARGET_ARCH=i386 /deny-debian-packages.sh \ binutils \ diff --git a/docker/Dockerfile.i586-unknown-linux-musl b/docker/Dockerfile.i586-unknown-linux-musl index 0d7895fa5..b4038f736 100644 --- a/docker/Dockerfile.i586-unknown-linux-musl +++ b/docker/Dockerfile.i586-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.i686-linux-android b/docker/Dockerfile.i686-linux-android index bee3520d9..55de13f1f 100644 --- a/docker/Dockerfile.i686-linux-android +++ b/docker/Dockerfile.i686-linux-android @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.i686-pc-windows-gnu b/docker/Dockerfile.i686-pc-windows-gnu index 1572b9d63..4903b7acf 100644 --- a/docker/Dockerfile.i686-pc-windows-gnu +++ b/docker/Dockerfile.i686-pc-windows-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh @@ -9,15 +10,12 @@ RUN /cmake.sh FROM cross-base AS build -RUN dpkg --add-architecture i386 && apt-get update && \ - apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev +RUN apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev COPY wine.sh / RUN /wine.sh -# Build mingw tools using dwarf exceptions -COPY mingw.sh / -RUN bash mingw.sh +RUN apt-get install --assume-yes --no-install-recommends g++-mingw-w64-i686-posix gfortran-mingw-w64-i686-posix # run-detectors are responsible for calling the correct interpreter for exe # files. For some reason it does not work inside a docker container (it works @@ -25,10 +23,9 @@ RUN bash mingw.sh # directly. This only affects the guest, we are not messing up with the host. # # See /usr/share/doc/binfmt-support/detectors -RUN mkdir -p /usr/lib/binfmt-support/ && \ - rm -f /usr/lib/binfmt-support/run-detectors /usr/bin/run-detectors && \ - ln -s /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \ - ln -s /usr/bin/wine /usr/bin/run-detectors +RUN mkdir -p /usr/lib/binfmt-support && \ + ln -sTf /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \ + ln -sTf /usr/bin/wine /usr/bin/run-detectors COPY windows-entry.sh / ENTRYPOINT ["/windows-entry.sh"] diff --git a/docker/Dockerfile.i686-unknown-freebsd b/docker/Dockerfile.i686-unknown-freebsd index 881644041..93189f3ef 100644 --- a/docker/Dockerfile.i686-unknown-freebsd +++ b/docker/Dockerfile.i686-unknown-freebsd @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index 28fd9ce2b..7a62f20d3 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh @@ -14,6 +15,13 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gfortran-i686-linux-gnu \ libc6-dev-i386-cross +# Make i686 libraries available on host to test target binary +RUN ln -s /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libgcc_s.so.1 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libc.so.6 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libstdc++.so.6 /lib/ +RUN ln -s /usr/i686-linux-gnu/lib/libm.so.6 /lib/ + COPY deny-debian-packages.sh / RUN TARGET_ARCH=i386 /deny-debian-packages.sh \ binutils \ @@ -22,18 +30,12 @@ RUN TARGET_ARCH=i386 /deny-debian-packages.sh \ COPY qemu.sh / RUN /qemu.sh i386 softmmu -COPY dropbear.sh / -RUN /dropbear.sh - -COPY linux-image.sh / -RUN /linux-image.sh i686 - -COPY linux-runner base-runner.sh / +COPY qemu-runner base-runner.sh / COPY toolchain.cmake /opt/toolchain.cmake ENV CROSS_TOOLCHAIN_PREFIX=i686-linux-gnu- ENV CROSS_SYSROOT=/usr/i686-linux-gnu -ENV CROSS_TARGET_RUNNER="/linux-runner i686" +ENV CROSS_TARGET_RUNNER="/qemu-runner i686" ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_RUNNER="$CROSS_TARGET_RUNNER" \ AR_i686_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ @@ -50,4 +52,4 @@ ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ CROSS_CMAKE_CRT=gnu \ CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m32 -march=i686" -RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /linux-runner +RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner diff --git a/docker/Dockerfile.i686-unknown-linux-musl b/docker/Dockerfile.i686-unknown-linux-musl index 3e4408843..aaa667c1d 100644 --- a/docker/Dockerfile.i686-unknown-linux-musl +++ b/docker/Dockerfile.i686-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.loongarch64-unknown-linux-gnu b/docker/Dockerfile.loongarch64-unknown-linux-gnu index fa7139188..31ce64cfc 100644 --- a/docker/Dockerfile.loongarch64-unknown-linux-gnu +++ b/docker/Dockerfile.loongarch64-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.loongarch64-unknown-linux-musl b/docker/Dockerfile.loongarch64-unknown-linux-musl index a7981e295..3dbaf7d73 100644 --- a/docker/Dockerfile.loongarch64-unknown-linux-musl +++ b/docker/Dockerfile.loongarch64-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 26507486b..b1b7dde42 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips-unknown-linux-musl b/docker/Dockerfile.mips-unknown-linux-musl index 6b0406bc5..004584465 100644 --- a/docker/Dockerfile.mips-unknown-linux-musl +++ b/docker/Dockerfile.mips-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index 649bcba04..68a2ab86f 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips64-unknown-linux-muslabi64 b/docker/Dockerfile.mips64-unknown-linux-muslabi64 index 0722f313b..e55eacd32 100644 --- a/docker/Dockerfile.mips64-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-muslabi64 @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index b7d0e7350..553c9e77c 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -1,6 +1,9 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:22.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ +RUN sed -i 's/noble/jammy/g' /etc/apt/sources.list.d/ubuntu.sources +RUN rm /etc/apt/sources.list COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 index 79b1bfba8..b0cad7aa3 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index ae44a3930..616b3b7ab 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -1,6 +1,9 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:22.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ +RUN sed -i 's/noble/jammy/g' /etc/apt/sources.list.d/ubuntu.sources +RUN rm /etc/apt/sources.list COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mipsel-unknown-linux-musl b/docker/Dockerfile.mipsel-unknown-linux-musl index 63247cd30..5add6e25a 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-musl +++ b/docker/Dockerfile.mipsel-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.native b/docker/Dockerfile.native index 09feb6b91..6f1261c70 100644 --- a/docker/Dockerfile.native +++ b/docker/Dockerfile.native @@ -1,7 +1,8 @@ # This dockerfile is used when the target matches the images platform in `build-docker-image` -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.native.centos b/docker/Dockerfile.native.centos index a1958587a..180d34645 100644 --- a/docker/Dockerfile.native.centos +++ b/docker/Dockerfile.native.centos @@ -1,10 +1,11 @@ -FROM ubuntu:20.04 AS base +FROM ubuntu:24.04 AS base ENV DEBIAN_FRONTEND=noninteractive ARG TARGETARCH ARG TARGETVARIANT ARG CROSS_TARGET_TRIPLE +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY lib.sh / COPY linux-image.sh native-linux-image.sh / RUN /native-linux-image.sh diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index 38b0a90d8..03266c10e 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index a0f072207..4bddacd40 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index 4b6b9c092..b0a72ce2a 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index a10cdd5ee..e60330df3 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:22.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-musl b/docker/Dockerfile.riscv64gc-unknown-linux-musl index c90736922..a14b9eb85 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-musl +++ b/docker/Dockerfile.riscv64gc-unknown-linux-musl @@ -1,6 +1,7 @@ FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index b64f0240d..4e2254309 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index d3686b4b5..3555fc90d 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.sparcv9-sun-solaris b/docker/Dockerfile.sparcv9-sun-solaris index a8e4fd50f..9d4704bc3 100644 --- a/docker/Dockerfile.sparcv9-sun-solaris +++ b/docker/Dockerfile.sparcv9-sun-solaris @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv6m-none-eabi b/docker/Dockerfile.thumbv6m-none-eabi index bde147930..869a48bd5 100644 --- a/docker/Dockerfile.thumbv6m-none-eabi +++ b/docker/Dockerfile.thumbv6m-none-eabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv7em-none-eabi b/docker/Dockerfile.thumbv7em-none-eabi index 7fea780f2..ad729c6ca 100644 --- a/docker/Dockerfile.thumbv7em-none-eabi +++ b/docker/Dockerfile.thumbv7em-none-eabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv7em-none-eabihf b/docker/Dockerfile.thumbv7em-none-eabihf index 44becf3f4..46ff00a1a 100644 --- a/docker/Dockerfile.thumbv7em-none-eabihf +++ b/docker/Dockerfile.thumbv7em-none-eabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv7m-none-eabi b/docker/Dockerfile.thumbv7m-none-eabi index 90d6bc3ab..264ac5ec0 100644 --- a/docker/Dockerfile.thumbv7m-none-eabi +++ b/docker/Dockerfile.thumbv7m-none-eabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv7neon-linux-androideabi b/docker/Dockerfile.thumbv7neon-linux-androideabi index c2f0fe815..6c254d318 100644 --- a/docker/Dockerfile.thumbv7neon-linux-androideabi +++ b/docker/Dockerfile.thumbv7neon-linux-androideabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf index 1973b94ff..3d8fe3a32 100644 --- a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf +++ b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv8m.base-none-eabi b/docker/Dockerfile.thumbv8m.base-none-eabi index 6928d7a2c..28ea46736 100644 --- a/docker/Dockerfile.thumbv8m.base-none-eabi +++ b/docker/Dockerfile.thumbv8m.base-none-eabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv8m.main-none-eabi b/docker/Dockerfile.thumbv8m.main-none-eabi index 91bd3d510..f98995364 100644 --- a/docker/Dockerfile.thumbv8m.main-none-eabi +++ b/docker/Dockerfile.thumbv8m.main-none-eabi @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.thumbv8m.main-none-eabihf b/docker/Dockerfile.thumbv8m.main-none-eabihf index 8882b9009..09f530f62 100644 --- a/docker/Dockerfile.thumbv8m.main-none-eabihf +++ b/docker/Dockerfile.thumbv8m.main-none-eabihf @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index 93f68f5bc..c01f450a0 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -1,7 +1,10 @@ -FROM emscripten/emsdk:3.1.14 +FROM emscripten/emsdk:3.1.74 WORKDIR / ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ +RUN sed -i 's/noble/jammy/g' /etc/apt/sources.list.d/ubuntu.sources +RUN rm /etc/apt/sources.list COPY common.sh lib.sh / RUN /common.sh @@ -10,7 +13,7 @@ RUN /cmake.sh RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ libxml2 \ - python + python3 ENV CROSS_TOOLCHAIN_PREFIX=em ENV CROSS_SYSROOT=/emsdk/upstream/emscripten/cache/sysroot diff --git a/docker/Dockerfile.x86_64-linux-android b/docker/Dockerfile.x86_64-linux-android index 5d78c993c..b3888e7ac 100644 --- a/docker/Dockerfile.x86_64-linux-android +++ b/docker/Dockerfile.x86_64-linux-android @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-pc-solaris b/docker/Dockerfile.x86_64-pc-solaris index 1af310287..b1d5d884d 100644 --- a/docker/Dockerfile.x86_64-pc-solaris +++ b/docker/Dockerfile.x86_64-pc-solaris @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index 0bea92329..242397a2e 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh @@ -9,13 +10,12 @@ RUN /cmake.sh FROM cross-base AS build -RUN dpkg --add-architecture i386 && apt-get update && \ - apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev +RUN apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev COPY wine.sh / RUN /wine.sh -RUN apt-get update && apt-get install --assume-yes --no-install-recommends g++-mingw-w64-x86-64 gfortran-mingw-w64-x86-64 +RUN apt-get install --assume-yes --no-install-recommends g++-mingw-w64-x86-64-posix gfortran-mingw-w64-x86-64-posix # run-detectors are responsible for calling the correct interpreter for exe # files. For some reason it does not work inside a docker container (it works @@ -23,10 +23,9 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends g++-m # directly. This only affects the guest, we are not messing up with the host. # # See /usr/share/doc/binfmt-support/detectors -RUN mkdir -p /usr/lib/binfmt-support/ && \ - rm -f /usr/lib/binfmt-support/run-detectors /usr/bin/run-detectors && \ - ln -s /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \ - ln -s /usr/bin/wine /usr/bin/run-detectors +RUN mkdir -p /usr/lib/binfmt-support && \ + ln -sTf /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \ + ln -sTf /usr/bin/wine /usr/bin/run-detectors COPY windows-entry.sh / ENTRYPOINT ["/windows-entry.sh"] diff --git a/docker/Dockerfile.x86_64-unknown-dragonfly b/docker/Dockerfile.x86_64-unknown-dragonfly index b38585571..4826cf53a 100644 --- a/docker/Dockerfile.x86_64-unknown-dragonfly +++ b/docker/Dockerfile.x86_64-unknown-dragonfly @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-unknown-freebsd b/docker/Dockerfile.x86_64-unknown-freebsd index 9629a4363..a8ddb8e66 100644 --- a/docker/Dockerfile.x86_64-unknown-freebsd +++ b/docker/Dockerfile.x86_64-unknown-freebsd @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-unknown-illumos b/docker/Dockerfile.x86_64-unknown-illumos index 2dd5545f5..f222b29f0 100644 --- a/docker/Dockerfile.x86_64-unknown-illumos +++ b/docker/Dockerfile.x86_64-unknown-illumos @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index 0f9503f8d..dea4df872 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos index 54f159c86..324021841 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos @@ -1,3 +1,3 @@ # HACK: this file is currently never used and only exists for usage with `Dockerfile.native.centos` # it will be supported for aarch64 hosts, see #751 and #975 -FROM ubuntu:20.04 AS base +FROM ubuntu:24.04 AS base diff --git a/docker/Dockerfile.x86_64-unknown-linux-musl b/docker/Dockerfile.x86_64-unknown-linux-musl index b25b39b07..adf4bd2c9 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-musl +++ b/docker/Dockerfile.x86_64-unknown-linux-musl @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.x86_64-unknown-netbsd b/docker/Dockerfile.x86_64-unknown-netbsd index ca06a8161..c5c673ddc 100644 --- a/docker/Dockerfile.x86_64-unknown-netbsd +++ b/docker/Dockerfile.x86_64-unknown-netbsd @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.zig b/docker/Dockerfile.zig index b7dbd3673..26844a1f3 100644 --- a/docker/Dockerfile.zig +++ b/docker/Dockerfile.zig @@ -1,6 +1,7 @@ -FROM ubuntu:20.04 AS cross-base +FROM ubuntu:24.04 AS cross-base ENV DEBIAN_FRONTEND=noninteractive +COPY ubuntu.sources /etc/apt/sources.list.d/ COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/aarch64-linux-gnu-glibc.sh b/docker/aarch64-linux-gnu-glibc.sh index 9de3a1ca1..ad8a0e07f 100755 --- a/docker/aarch64-linux-gnu-glibc.sh +++ b/docker/aarch64-linux-gnu-glibc.sh @@ -38,7 +38,6 @@ cp_gcc_archive() { } main() { - set_centos_ulimit yum install -y epel-release yum install -y gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu gfortran-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils gcc-c++ glibc-devel yum clean all diff --git a/docker/android-ndk.sh b/docker/android-ndk.sh index 6f4852236..b7e1e9275 100755 --- a/docker/android-ndk.sh +++ b/docker/android-ndk.sh @@ -11,7 +11,7 @@ main() { # python3 is still needed for newer NDK versions, just since it # simplifies making symlinks even though the toolchain is prebuilt - install_packages curl python python3 + install_packages curl python3 get_ndk_info if [[ "${NDK_VERSION}" -le 9 ]]; then install_packages bzip2 diff --git a/docker/android-system.sh b/docker/android-system.sh index 412758fdb..f5f6ef8b5 100755 --- a/docker/android-system.sh +++ b/docker/android-system.sh @@ -69,18 +69,26 @@ main() { fake_java install_packages ca-certificates \ + 2to3 \ curl \ gcc-multilib \ git \ g++-multilib \ - libncurses5 \ - libtinfo5 \ make \ openssh-client \ - python \ + python-is-python3 \ python3 \ + pybind11-dev \ + libre2-dev \ xz-utils + # Prebuilt clang toolchain depends on libtinfo5 and libncurses5 while Ubuntu 24.04 host ships only libtinfo6 and libncurses6. + # Install latest libtinfo5 and libncurses5 from Debian Bookworm. They depend libc6 >=2.34 only, hence do not cause conflicts. + curl --retry 3 -sSfL https://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb -o libtinfo5.deb + curl --retry 3 -sSfL https://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb -o libncurses5.deb + dpkg -i libtinfo5.deb libncurses5.deb + rm libtinfo5.deb libncurses5.deb + curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O chmod +x repo python3 ./repo init -u https://android.googlesource.com/platform/manifest -b "${TAG}" @@ -126,6 +134,24 @@ main() { esac fi + # Convert Python 2 scripts for Python 3 compatibility + find . -path './.repo/repo' -prune\ + -o -path './art/test' -prune\ + -o -type f -name '*.py'\ + ! -path './prebuilts/sdk/update_prebuilts/update_prebuilts.py'\ + ! -path './art/tools/test_presubmit.py'\ + ! -path './art/tools/jfuzz/run_jfuzz_test.py'\ + ! -path './external/llvm/utils/lit/tests/shtest-encoding.py'\ + -print | while read -r file + do + LC_ALL=C grep -Iq . "$file" || continue + 2to3 -w -n "$file" + done + sed -i 's/lower <= value <= upper/lower <= int(value) <= upper/' ./bionic/libc/fs_config_generator.py + + # Soong looks for a python2.7 executable explicitly + ln -s python3 /usr/bin/python2.7 + build_android install_android "${tools[@]}" @@ -196,6 +222,9 @@ build_android() { export ALLOW_MISSING_DEPENDENCIES=true fi + # Workaround for AOSP expecting literal "C.UTF-8" locale while libc-bin ships it as "C.utf8" + [[ -d '/usr/lib/locale/C.UTF-8' ]] || ln -sTf C.utf8 /usr/lib/locale/C.UTF-8 + set +u # shellcheck disable=SC1091 source build/envsetup.sh @@ -812,7 +841,7 @@ major = sys.version_info.major minor = sys.version_info.minor print(f"{major}.{minor}")') set +u - export PYTHONPATH="${PYTHON_TMPDIR}/lib/python${version}/site-packages/:${PYTHONPATH}" + export PYTHONPATH="${PYTHON_TMPDIR}/local/lib/python${version}/dist-packages/:${PYTHONPATH}" set -u mkdir -p "${PYTHON_TMPDIR}" python3 -m pip install sly==0.4.0 --prefix "${PYTHON_TMPDIR}" diff --git a/docker/cmake.sh b/docker/cmake.sh index 288a9005f..f527ee019 100755 --- a/docker/cmake.sh +++ b/docker/cmake.sh @@ -48,7 +48,6 @@ main() { purge_packages rm -rf "${td}" - rm -rf /var/lib/apt/lists/* rm "${0}" } diff --git a/docker/common.sh b/docker/common.sh index 283949418..aed9cb957 100755 --- a/docker/common.sh +++ b/docker/common.sh @@ -6,19 +6,10 @@ set -euo pipefail # shellcheck disable=SC1091 . lib.sh -# For non-native architectures, look for packages on ports.ubuntu.com instead. -# This is important if you enable additional architectures so you can install libraries to cross-compile against. -# Look for 'dpkg --add-architecture' in the README for more details. -if grep -i ubuntu /etc/os-release >/dev/null; then - NATIVE_ARCH=$(dpkg --print-architecture) - - if [ "$NATIVE_ARCH" = "amd64" ]; then - sed 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list > /etc/apt/sources.list.d/ports.list - sed -i 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=amd64,i386] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list - else - sed -i "s/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=${NATIVE_ARCH}] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g" /etc/apt/sources.list - sed -i "s/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=${NATIVE_ARCH}] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g" /etc/apt/sources.list - fi +# Install ca-certificates before enabling HTTPS in sources +if grep -q -i ubuntu /etc/os-release; then + install_packages ca-certificates + sed -i 's|http://|https://|' /etc/apt/sources.list.d/ubuntu.sources fi install_packages \ @@ -42,6 +33,8 @@ if_centos install_packages \ pkgconfig if_ubuntu install_packages \ + bzip2 \ + adduser \ g++ \ gfortran \ libc6-dev \ diff --git a/docker/crosstool-config/aarch64_be-unknown-linux-gnu.config b/docker/crosstool-config/aarch64_be-unknown-linux-gnu.config index 320632045..5e23c119a 100644 --- a/docker/crosstool-config/aarch64_be-unknown-linux-gnu.config +++ b/docker/crosstool-config/aarch64_be-unknown-linux-gnu.config @@ -36,3 +36,7 @@ CT_GCC_later_than_4_8=y CT_GCC_4_8_or_later=y CT_CC_LANG_CXX=y CT_CC_LANG_FORTRAN=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/docker/crosstool-config/arm-unknown-linux-gnueabihf.config b/docker/crosstool-config/arm-unknown-linux-gnueabihf.config index e68a4ba8f..bac90e425 100644 --- a/docker/crosstool-config/arm-unknown-linux-gnueabihf.config +++ b/docker/crosstool-config/arm-unknown-linux-gnueabihf.config @@ -8,7 +8,7 @@ CT_ARCH_FLOAT_HW=y CT_KERNEL_LINUX=y CT_LINUX_V_4_19=y # CT_LINUX_NO_VERSIONS is not set -CT_LINUX_VERSION="4.19.287" +CT_LINUX_VERSION="4.19.21" CT_LINUX_later_than_4_8=y CT_LINUX_4_8_or_later=y CT_LINUX_later_than_3_7=y @@ -16,15 +16,30 @@ CT_LINUX_3_7_or_later=y CT_LINUX_later_than_3_2=y CT_LINUX_3_2_or_later=y CT_BINUTILS_V_2_32=y -CT_GLIBC_V_2_31=y +CT_GLIBC_V_2_17=y # CT_GLIBC_NO_VERSIONS is not set -CT_GLIBC_VERSION="2.31" +CT_GLIBC_VERSION="2.17" +CT_GLIBC_2_29_or_older=y +CT_GLIBC_older_than_2_29=y +CT_GLIBC_2_27_or_older=y +CT_GLIBC_older_than_2_27=y +CT_GLIBC_2_26_or_older=y +CT_GLIBC_older_than_2_26=y +CT_GLIBC_2_25_or_older=y +CT_GLIBC_older_than_2_25=y +CT_GLIBC_2_24_or_older=y +CT_GLIBC_older_than_2_24=y +CT_GLIBC_2_23_or_older=y +CT_GLIBC_older_than_2_23=y +CT_GLIBC_2_20_or_older=y +CT_GLIBC_older_than_2_20=y CT_GLIBC_2_17_or_later=y +CT_GLIBC_2_17_or_older=y CT_GLIBC_later_than_2_14=y CT_GLIBC_2_14_or_later=y CT_GCC_V_8=y # CT_GCC_NO_VERSIONS is not set -CT_GCC_VERSION="8.5.0" +CT_GCC_VERSION="8.3.0" CT_GCC_later_than_7=y CT_GCC_7_or_later=y CT_GCC_later_than_6=y @@ -42,3 +57,8 @@ CT_ISL_V_0_20=y CT_LIBICONV_V_1_15=y CT_NCURSES_V_6_1=y CT_CC_LANG_FORTRAN=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +GLIBC_MAKEINFO_WORKAROUND=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/docker/crosstool-config/loongarch64-unknown-linux-gnu.config b/docker/crosstool-config/loongarch64-unknown-linux-gnu.config index 667624342..46d3fe816 100644 --- a/docker/crosstool-config/loongarch64-unknown-linux-gnu.config +++ b/docker/crosstool-config/loongarch64-unknown-linux-gnu.config @@ -37,3 +37,7 @@ CT_GCC_4_8_or_later=y CT_CC_GCC_ENABLE_DEFAULT_PIE=y CT_CC_LANG_CXX=y CT_CC_LANG_FORTRAN=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/docker/crosstool-config/loongarch64-unknown-linux-musl.config b/docker/crosstool-config/loongarch64-unknown-linux-musl.config index da1f8bfb3..38f375e4d 100644 --- a/docker/crosstool-config/loongarch64-unknown-linux-musl.config +++ b/docker/crosstool-config/loongarch64-unknown-linux-musl.config @@ -35,3 +35,7 @@ CT_GCC_4_8_or_later=y CT_CC_GCC_ENABLE_DEFAULT_PIE=y CT_CC_LANG_CXX=y CT_CC_LANG_FORTRAN=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/docker/crosstool-config/riscv64gc-unknown-linux-musl.config b/docker/crosstool-config/riscv64gc-unknown-linux-musl.config index 31ae265d6..33060763a 100644 --- a/docker/crosstool-config/riscv64gc-unknown-linux-musl.config +++ b/docker/crosstool-config/riscv64gc-unknown-linux-musl.config @@ -36,3 +36,7 @@ CT_GCC_4_8_or_later=y CT_CC_GCC_ENABLE_DEFAULT_PIE=y CT_CC_LANG_CXX=y CT_CC_LANG_FORTRAN=y +CT_BUILD_MANUALS=n +CT_REMOVE_DOCS=y +CT_LOG_PROGRESS_BAR=n +CT_LOG_ALL=y diff --git a/docker/crosstool-ng.sh b/docker/crosstool-ng.sh index 3ce46e916..84122fea2 100755 --- a/docker/crosstool-ng.sh +++ b/docker/crosstool-ng.sh @@ -6,18 +6,10 @@ set -eo pipefail # shellcheck disable=SC1091 . lib.sh -silence_stdout() { - if [[ "${VERBOSE}" == "1" ]]; then - "${@}" - else - "${@}" >/dev/null - fi -} - main() { local config="${1}" local nproc="${2}" - local ctng_version=${3:-crosstool-ng-1.27.0} + local ctng_version=${3:-crosstool-ng-1.28.0} local ctng_url="https://github.com/crosstool-ng/crosstool-ng" local username=crosstool local crosstooldir=/opt/crosstool @@ -80,7 +72,7 @@ main() { su "${username}" -c "${crosstooldir}/bin/ct-ng olddefconfig" # the download steps can stall indefinitely, so we want to set a timeout to - # ensure it always completes. we therefore attempt to download until + # ensure it always completes. we therefore attempt to download until # this step completes or fails. the built toolchain installs to `/x-tools`. mkdir -p "${dstdir}" chown -R "${username}":"${username}" "${dstdir}" @@ -90,16 +82,14 @@ main() { # timeout is a command, not a built-in, so it won't # work with any bash functions: must call a command. timeout "${timeout}" \ - su "${username}" -c \ - "STOP=${step} CT_DEBUG_CT_SAVE_STEPS=1 ${crosstooldir}/bin/ct-ng build.${nproc}" + su "${username}" -c "${crosstooldir}/bin/ct-ng build.${nproc} STOP=${step}" } - while silence_stdout download; [ $? -eq 124 ]; do + while download; [ $? -eq 124 ]; do # Indicates a timeout, repeat the command. sleep "${sleep}" done - silence_stdout su "${username}" \ - -c "CT_DEBUG_CT_SAVE_STEPS=1 ${crosstooldir}/bin/ct-ng build.${nproc}" + su "${username}" -c "${crosstooldir}/bin/ct-ng build.${nproc}" popd diff --git a/docker/dropbear.sh b/docker/dropbear.sh index 5351cc8f4..04ad92540 100755 --- a/docker/dropbear.sh +++ b/docker/dropbear.sh @@ -9,7 +9,7 @@ set -euo pipefail main() { local version=2022.82 local mirrors=( - "https://matt.ucc.asn.au/dropbear/releases" + "https://matt.ucc.asn.au/dropbear" "https://mirror.dropbear.nl/mirror" ) @@ -28,7 +28,7 @@ main() { pushd "${td}" - download_mirrors "" "dropbear-${version}.tar.bz2" "${mirrors[@]}" + download_mirrors "releases" "dropbear-${version}.tar.bz2" "${mirrors[@]}" tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2" # Remove some unwanted message diff --git a/docker/lib.sh b/docker/lib.sh index 4cb2e5ea3..4a404474c 100644 --- a/docker/lib.sh +++ b/docker/lib.sh @@ -3,12 +3,6 @@ purge_list=() -set_centos_ulimit() { - # this is a bug affecting buildkit with yum when ulimit is unlimited - # https://github.com/docker/buildx/issues/379#issuecomment-1196517905 - ulimit -n 1024000 -} - install_packages() { if grep -i ubuntu /etc/os-release; then apt-get update @@ -21,7 +15,6 @@ install_packages() { fi done else - set_centos_ulimit for pkg in "${@}"; do if ! yum list installed "${pkg}" >/dev/null 2>/dev/null; then yum install -y "${pkg}" diff --git a/docker/linux-image.sh b/docker/linux-image.sh index 86b5d012f..0df7adb0a 100755 --- a/docker/linux-image.sh +++ b/docker/linux-image.sh @@ -57,107 +57,79 @@ max_kernel_version() { main() { # arch in the rust target local arch="${1}" \ - kversion=5.10.0-34 + kversion=6.12.90+deb13.1 - local debsource="deb http://http.debian.net/debian/ bullseye main" - debsource="${debsource}\ndeb http://security.debian.org/ bullseye-security main" + local debsource="deb https://deb.debian.org/debian trixie main" + debsource="${debsource}\ndeb https://security.debian.org trixie-security main" - local dropbear="dropbear-bin" - - local -a deps local kernel= - local libgcc="libgcc-s1" - local ncurses= + local kernel_pkg_split=0 # select debian arch and kernel version case "${arch}" in aarch64) arch=arm64 kernel="${kversion}-arm64" - deps=(libcrypt1:"${arch}") ;; armv7) arch=armhf - kernel='5.*-armmp' - deps=(libcrypt1:"${arch}") + kernel="${kversion}-armmp" ;; i686) arch=i386 kernel="${kversion}-686" - deps=(libcrypt1:"${arch}") - ;; - mips) - # mips was discontinued in bullseye, so we have to use buster. - libgcc="libgcc1" - debsource="deb http://http.debian.net/debian/ buster main" - debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" - kernel='4.*-4kc-malta' - ncurses="=6.1*" ;; mipsel) - kernel='5.*-4kc-malta' - deps=(libcrypt1:"${arch}") + # mipsel was discontinued in trixie, so we have to use bookworm. + kernel='6.*-4kc-malta' + debsource="deb https://deb.debian.org/debian bookworm main" ;; mips64el) - kernel='5.*-5kc-malta' - deps=(libcrypt1:"${arch}") + # mipsel was discontinued in trixie, so we have to use bookworm. + kernel='6.*-5kc-malta' + debsource="deb https://deb.debian.org/debian bookworm main" ;; powerpc) - # there is no buster powerpc port, so we use jessie - # use a more recent kernel from backports - kversion='4.9.0-0.bpo.6' - kernel="${kversion}-powerpc" - debsource="deb http://archive.debian.org/debian jessie main" - debsource="${debsource}\ndeb http://archive.debian.org/debian jessie-backports main" - debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unstable main" - debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main" - - # archive.debian.org Release files are expired. - echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid - echo "APT::Get::AllowUnauthenticated true;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid - echo "Acquire::AllowInsecureRepositories True;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid - - dropbear="dropbear" - deps=(libcrypt1:"${arch}") + # there is no stable port + # https://deb.debian.org/debian-ports/pool-powerpc/main/l/linux/ + kernel='7.*-powerpc' + debsource="deb https://deb.debian.org/debian-ports unstable main" + debsource="${debsource}\ndeb https://deb.debian.org/debian-ports unreleased main" + # Debian Forky splits linux-image-* packages into linux-binary-* and linux-modules-* and linux-base-* + kernel_pkg_split=1 ;; powerpc64) # there is no stable port arch=ppc64 # https://packages.debian.org/en/sid/linux-image-powerpc64 - kernel='6.*-powerpc64' - debsource="deb http://ftp.ports.debian.org/debian-ports unstable main" - debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main" - # sid version of dropbear requires these dependencies - deps=(libcrypt1:"${arch}") + kernel='7.*-powerpc64' + debsource="deb https://deb.debian.org/debian-ports unstable main" + debsource="${debsource}\ndeb https://deb.debian.org/debian-ports unreleased main" + # Debian Forky splits linux-image-* packages into linux-binary-* and linux-modules-* and linux-base-* + kernel_pkg_split=1 ;; powerpc64le) arch=ppc64el - kernel='5.*-powerpc64le' - deps=(libcrypt1:"${arch}") + kernel="${kversion}-powerpc64le" ;; riscv64) - kernel='6.*-riscv64' - debsource="deb http://deb.debian.org/debian unstable main" - deps=(libcrypt1:"${arch}") + kernel="${kversion}-riscv64" ;; s390x) - arch=s390x - kernel='5.*-s390x' - deps=(libcrypt1:"${arch}") + kernel="${kversion}-s390x" ;; sparc64) # there is no stable port # https://packages.debian.org/en/sid/linux-image-sparc64 - kernel='6.*-sparc64' - debsource="deb http://ftp.ports.debian.org/debian-ports unstable main" - debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main" - # sid version of dropbear requires these dependencies - deps=(libcrypt1:"${arch}") + kernel='7.*-sparc64' + debsource="deb https://deb.debian.org/debian-ports unstable main" + debsource="${debsource}\ndeb https://deb.debian.org/debian-ports unreleased main" + # Debian Forky splits linux-image-* packages into linux-binary-* and linux-modules-* and linux-base-* + kernel_pkg_split=1 ;; x86_64) arch=amd64 kernel="${kversion}-amd64" - deps=(libcrypt1:"${arch}") ;; *) echo "Invalid arch: ${arch}" @@ -177,7 +149,7 @@ main() { # using dpkg later, since we cannot redownload via apt. local dpkg_arch dpkg_arch=$(dpkg --print-architecture) - local libgcc_packages=("${libgcc}:${arch}" "libstdc++6:${arch}") + local libgcc_packages=("libgcc-s1:${arch}" "libstdc++6:${arch}") if [[ "${arch}" == "${dpkg_arch}" ]]; then local libgcc_root=/qemu/libgcc mkdir -p "${libgcc_root}" @@ -187,7 +159,7 @@ main() { fi # Download packages - mv /etc/apt/sources.list /etc/apt/sources.list.bak + [[ -f '/etc/apt/sources.list' ]] && mv /etc/apt/sources.list /etc/apt/sources.list.bak mv /etc/apt/sources.list.d /etc/apt/sources.list.d.bak echo -e "${debsource}" >/etc/apt/sources.list @@ -198,15 +170,11 @@ main() { dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" >/etc/dpkg/dpkg.cfg.d/multiarch # Add Debian keys. - curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10,11,12}.asc' -O - curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10,11,12}-security.asc' -O - curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10,11,12}.asc' -O - curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022,2023,2024,2025}.key' -O - - for key in *.asc *.key; do - apt-key add "${key}" - rm "${key}" - done + cd /etc/apt/trusted.gpg.d + curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{10,11,12,13}.asc' -O + curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{10,11,12,13}-security.asc' -O + curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{10,11,12,13}.asc' -O + curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_2026.key' -o archive_2026.asc # allow apt-get to retry downloads echo 'APT::Acquire::Retries "3";' >/etc/apt/apt.conf.d/80-retries @@ -230,17 +198,24 @@ main() { kernel=$(max_kernel_version "$kversions") fi + # Debian Forky splits linux-image-* packages into linux-binary-* and linux-modules-* and linux-base-* + local kernel_packages=() + if (( kernel_pkg_split )); then + kernel_packages=("linux-binary-${kernel}:${arch}" "linux-modules-${kernel}:${arch}" "linux-base-${kernel}:${arch}") + else + kernel_packages=("linux-image-${kernel}:${arch}") + fi + cd "/qemu/${arch}" apt-get -d --no-install-recommends download \ - ${deps[@]+"${deps[@]}"} \ "busybox:${arch}" \ - "${dropbear}:${arch}" \ + "dropbear-bin:${arch}" \ "libtommath1:${arch}" \ "libtomcrypt1:${arch}" \ "libgmp10:${arch}" \ "libc6:${arch}" \ - "linux-image-${kernel}:${arch}" \ - ncurses-base"${ncurses}" \ + "libcrypt1:${arch}" \ + "${kernel_packages[@]}" \ "zlib1g:${arch}" if [[ "${arch}" != "${dpkg_arch}" ]]; then @@ -271,13 +246,19 @@ main() { # will prefer the system packages, which it can't find later. # removing these packages needs to occur after download via apt, # since apt-get relies on libgcc_s1 and libstdc++6. - dpkg -r --force-depends "${libgcc_packages[@]}" + dpkg -r --force-depends --force-remove-protected "${libgcc_packages[@]}" fi cd /qemu # Install packages root="root-${arch}" - mkdir -p "${root}"/{bin,etc/dropbear,root,sys,dev,proc,sbin,tmp,usr/{bin,sbin},var/log} + mkdir -p "${root}" + # make libraries and binaries available as usrmerge + for d in lib lib64 bin sbin; do + ln -nsd "usr/${d}" "${root}/${d}" + done + mkdir -p "${root}"/{etc/dropbear,root,sys,dev,proc,tmp,usr/{bin,sbin,lib,lib64},var/log} + # install for deb in "${arch}"/*deb; do dpkg -x "${deb}" "${root}"/ done @@ -389,12 +370,6 @@ mount -t 9p -o trans=virtio target /target -oversion=9p2000.u || true exec dropbear -F -E -B EOF - if [[ "${arch}" == "riscv64" ]]; then - # Symlink dynamic loader to /lib/ld-linux-riscv64-lp64d.so.1 - mkdir -p "${root}/lib" - ln -s /usr/lib/riscv64-linux-gnu/ld-linux-riscv64-lp64d.so.1 "${root}/lib/ld-linux-riscv64-lp64d.so.1" - fi - chmod +x "${root}/init" cd "${root}" find . | cpio --create --format='newc' --quiet | gzip >../initrd.gz @@ -410,7 +385,11 @@ EOF # Clean up rm -rf "/qemu/${root}" "/qemu/${arch}" - mv -f /etc/apt/sources.list.bak /etc/apt/sources.list + if [[ -f '/etc/apt/sources.list.bak' ]]; then + mv -f /etc/apt/sources.list.bak /etc/apt/sources.list + else + rm /etc/apt/sources.list + fi mv -f /etc/apt/sources.list.d.bak /etc/apt/sources.list.d if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch diff --git a/docker/mingw.sh b/docker/mingw.sh deleted file mode 100755 index 9dfef0eee..000000000 --- a/docker/mingw.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env bash - -set -x -set -euo pipefail - -# shellcheck disable=SC1091 -. lib.sh - -main() { - # Ubuntu mingw packages for i686 uses sjlj exceptions, but rust target - # i686-pc-windows-gnu uses dwarf exceptions. So we build mingw packages - # that are compatible with rust. - - # Enable source - sed -i 's/# deb-src/deb-src/g' /etc/apt/sources.list - apt-get update - - # Install mingw (with sjlj exceptions) to get the dependencies right - # Later we replace these packages with the new ones - apt-get install --assume-yes --no-install-recommends g++-mingw-w64-i686 - - local dependencies=(build-essential) - while IFS='' read -r dep; do dependencies+=("${dep}"); done < \ - <(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq) - - install_packages "${dependencies[@]}" - - local td - td="$(mktemp -d)" - - pushd "${td}" - - apt-get source gcc-mingw-w64-i686 - pushd gcc-mingw-w64-* - - # We are using dwarf exceptions instead of sjlj - sed -i -e 's/libgcc_s_sjlj-1/libgcc_s_dw2-1/g' debian/gcc-mingw-w64-i686.install.in - - # Only build i686 packages (disable x86_64) - patch -p0 <<'EOF' ---- debian/control.template.ori 2018-03-12 16:25:30.000000000 +0000 -+++ debian/control.template 2018-03-12 16:25:30.000000000 +0000 -@@ -1,7 +1,6 @@ - Package: @@PACKAGE@@-mingw-w64 - Architecture: all - Depends: @@PACKAGE@@-mingw-w64-i686, -- @@PACKAGE@@-mingw-w64-x86-64, - ${misc:Depends} - Recommends: @@RECOMMENDS@@ - Built-Using: gcc-@@VERSION@@ (= ${gcc:Version}) -@@ -32,22 +31,3 @@ - This package contains the @@LANGUAGE@@ compiler, supporting - cross-compiling to 32-bit MinGW-w64 targets. - Build-Profiles: -- --Package: @@PACKAGE@@-mingw-w64-x86-64 --Architecture: any --Depends: @@DEPENDS64@@, -- ${misc:Depends}, -- ${shlibs:Depends} --Suggests: gcc-@@VERSION@@-locales (>= ${local:Version}) --Breaks: @@BREAKS64@@ --Conflicts: @@CONFLICTS64@@ --Replaces: @@REPLACES64@@ --Built-Using: gcc-@@VERSION@@ (= ${gcc:Version}) --Description: GNU @@LANGUAGE@@ compiler for MinGW-w64 targeting Win64 -- MinGW-w64 provides a development and runtime environment for 32- and -- 64-bit (x86 and x64) Windows applications using the Windows API and -- the GNU Compiler Collection (gcc). -- . -- This package contains the @@LANGUAGE@@ compiler, supporting -- cross-compiling to 64-bit MinGW-w64 targets. --Build-Profiles: -EOF - - # Disable build of fortran,objc,obj-c++ and use configure options - # --disable-sjlj-exceptions --with-dwarf2 - patch -p0 <<'EOF' ---- debian/rules.ori 2018-03-12 16:25:30.000000000 +0000 -+++ debian/rules 2018-03-12 16:25:30.000000000 +0000 -@@ -58,7 +58,7 @@ - INSTALL_TARGET := install-gcc - else - # Build the full GCC. -- languages := c,c++,fortran,objc,obj-c++,ada -+ languages := c,c++ - BUILD_TARGET := - INSTALL_TARGET := install install-lto-plugin - endif -@@ -85,7 +85,7 @@ - sed -i 's/@@VERSION@@/$(target_version)/g' debian/control - touch $@ - --targets := i686-w64-mingw32 x86_64-w64-mingw32 -+targets := i686-w64-mingw32 - threads := posix win32 - - # Hardening on the host, none on the target -@@ -220,6 +220,10 @@ - # Enable libatomic - CONFFLAGS += \ - --enable-libatomic -+# Enable dwarf exceptions -+CONFFLAGS += \ -+ --disable-sjlj-exceptions \ -+ --with-dwarf2 - # Enable experimental::filesystem and std::filesystem - CONFFLAGS += \ - --enable-libstdcxx-filesystem-ts=yes -EOF - - # Need symlinks for specific autoconf versions, since it - # attempts to use autoconf2.69 and autom4te2.69. - ln -s /usr/bin/autoconf /usr/bin/autoconf2.69 - ln -s /usr/bin/autom4te /usr/bin/autom4te2.69 - - # Build the modified mingw packages - MAKEFLAGS=--silent dpkg-buildpackage -nc -B --jobs=auto - - # Replace installed mingw packages with the new ones - dpkg -i ../g*-mingw-w64-i686*.deb ../gcc-mingw-w64-base*.deb - - purge_packages - - popd - popd - - rm -rf "${td}" - rm "${0}" - - # Unlink our temporary aliases - unlink /usr/bin/autoconf2.69 - unlink /usr/bin/autom4te2.69 -} - -main "${@}" diff --git a/docker/qemu.sh b/docker/qemu.sh index 9c15c5b7e..afe42372e 100755 --- a/docker/qemu.sh +++ b/docker/qemu.sh @@ -19,7 +19,7 @@ build_static_libffi () { tar --strip-components=1 -xzf "v${version}.tar.gz" ./configure --prefix="$td"/lib --disable-builddir --disable-shared --enable-static make "-j$(nproc)" - install -m 644 ./.libs/libffi.a /usr/local/lib/ + install -m 644 ./.libs/libffi.a /usr/lib/ popd @@ -42,7 +42,7 @@ build_static_libmount () { tar --strip-components=1 -xJf "util-linux-${version_spec}.tar.xz" ./configure --disable-shared --enable-static --without-ncurses make "-j$(nproc)" mount blkid - install -m 644 ./.libs/*.a /usr/local/lib/ + install -m 644 ./.libs/*.a /usr/lib/ popd @@ -58,7 +58,6 @@ build_static_libattr() { pushd "${td}" - set_centos_ulimit yum install -y gettext curl --retry 3 -sSfL "https://download.savannah.nongnu.org/releases/attr/attr-${version}.src.tar.gz" -O @@ -67,7 +66,7 @@ build_static_libattr() { ./configure make "-j$(nproc)" - install -m 644 ./libattr/.libs/libattr.a /usr/local/lib/ + install -m 644 ./libattr/.libs/libattr.a /usr/lib/ yum remove -y gettext @@ -87,7 +86,7 @@ build_static_libcap() { curl --retry 3 -sSfL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${version}.tar.xz" -O tar --strip-components=1 -xJf "libcap-${version}.tar.xz" make "-j$(nproc)" - install -m 644 libcap/libcap.a /usr/local/lib/ + install -m 644 libcap/libcap.a /usr/lib/ popd @@ -106,7 +105,7 @@ build_static_pixman() { tar --strip-components=1 -xzf "pixman-${version}.tar.gz" ./configure make "-j$(nproc)" - install -m 644 ./pixman/.libs/libpixman-1.a /usr/local/lib/ + install -m 644 ./pixman/.libs/libpixman-1.a /usr/lib/ popd @@ -125,7 +124,7 @@ build_static_slirp() { tar -xzf "libslirp-v${version}.tar.gz" meson setup -Ddefault_library=static libslirp-v${version} build ninja -C build - install -m 644 ./build/libslirp.a /usr/local/lib/ + install -m 644 ./build/libslirp.a /usr/lib/ popd @@ -133,7 +132,7 @@ build_static_slirp() { } main() { - local version=5.1.0 + local version=10.1.0 if_centos version=4.2.1 diff --git a/docker/solaris.sh b/docker/solaris.sh index ff4b6598d..d984a4298 100755 --- a/docker/solaris.sh +++ b/docker/solaris.sh @@ -58,7 +58,8 @@ main() { esac apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486 - add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2 main' + # https://apt.dilos.org/dilos is currently down + add-apt-repository -y 'deb https://mirrors.dotsrc.org/mirrors/pub/dilos/apt dilos2 main' dpkg --add-architecture "${apt_arch}" apt-get update apt-get install -y --download-only \ @@ -136,6 +137,26 @@ EOF make install cd .. + # Map old to new symbols. This file is picked up by linker flags in our tests. + # - https://github.com/cross-rs/cross/issues/1599 + # - https://github.com/cross-rs/cross/issues/1730 + cat << '_EOF_' > compat.c +#include + +// Forward declare the existing DilOS functions +extern long __sysconf_xpg5(int); +extern int __xnet_socket(int, int, int); + +// Create strong aliases that the Rust compiler can see +long __sysconf_xpg7(int name) { + return __sysconf_xpg5(name); +} +int __xnet7_socket(int domain, int type, int protocol) { + return __xnet_socket(domain, type, protocol); +} +_EOF_ + "${target}-gcc" -c compat.c -o /compat.o + # clean up popd diff --git a/docker/ubuntu.sources b/docker/ubuntu.sources new file mode 100644 index 000000000..878e66b6f --- /dev/null +++ b/docker/ubuntu.sources @@ -0,0 +1,20 @@ +Types: deb deb-src +URIs: http://security.ubuntu.com/ubuntu +Suites: noble-security +Architectures: amd64 i386 +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +Types: deb deb-src +URIs: http://ports.ubuntu.com/ubuntu-ports +Suites: noble noble-updates noble-backports noble-security +Architectures: arm64 armhf +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +Types: deb deb-src +URIs: http://archive.ubuntu.com/ubuntu +Suites: noble noble-updates noble-backports +Architectures: amd64 i386 +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg diff --git a/docker/wine.sh b/docker/wine.sh index b449e82ea..564dec1d0 100755 --- a/docker/wine.sh +++ b/docker/wine.sh @@ -7,25 +7,20 @@ set -euo pipefail . lib.sh main() { - local version="9.0.0.0~focal-1" - install_packages wget - dpkg --add-architecture i386 # add repository for latest wine version and install from source # hardcode version, since we might want to avoid a version later. - wget -nc https://dl.winehq.org/wine-builds/winehq.key + local version="10.*~noble-1" # workaround for wine server synchronization, see #1035 # we need to ensure the keys are now stored in `/etc/apt/keyrings`, # which were previously stored in `/usr/share/keyrings`, and ensure # our sources list searches for the right location. mkdir -p /etc/apt/keyrings - mv winehq.key /etc/apt/keyrings/winehq-archive.key - - wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources - mv winehq-focal.sources /etc/apt/sources.list.d/ - sed -i s@/usr/share/keyrings/@/etc/apt/keyrings/@ /etc/apt/sources.list.d/winehq-focal.sources || true + curl --retry 3 -sSfL https://dl.winehq.org/wine-builds/winehq.key -o /etc/apt/keyrings/winehq-archive.key + curl --retry 3 -sSfL https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources -o /etc/apt/sources.list.d/winehq-noble.sources + sed -i 's@/usr/share/keyrings/@/etc/apt/keyrings/@' /etc/apt/sources.list.d/winehq-noble.sources # winehq requires all the dependencies to be manually specified # if we're not using the latest version of a given major version. diff --git a/rustfmt.yml b/rustfmt.yml index fdd7eb4b3..daafee72c 100644 --- a/rustfmt.yml +++ b/rustfmt.yml @@ -4,6 +4,6 @@ fn_single_line = true where_single_line = true use_field_init_shorthand = true reorder_impl_items = true -edition = "2021" +edition = "2024" newline_style = "Unix" format_code_in_doc_comments = true diff --git a/src/bin/commands/containers.rs b/src/bin/commands/containers.rs index efc2d7a46..ea7ecd5be 100644 --- a/src/bin/commands/containers.rs +++ b/src/bin/commands/containers.rs @@ -4,7 +4,7 @@ use clap::{Args, Subcommand}; use cross::docker::ImagePlatform; use cross::rustc::{QualifiedToolchain, Toolchain}; use cross::shell::MessageInfo; -use cross::{docker, CommandExt, TargetTriple}; +use cross::{CommandExt, TargetTriple, docker}; use is_terminal::IsTerminal; #[derive(Args, Debug)] diff --git a/src/bin/commands/run.rs b/src/bin/commands/run.rs index 836a90bd0..9bc3e03ad 100644 --- a/src/bin/commands/run.rs +++ b/src/bin/commands/run.rs @@ -2,8 +2,8 @@ use clap::Args as ClapArgs; use cross::config::Config; use cross::shell::{MessageInfo, Verbosity}; use cross::{ - cargo_metadata_with_args, cli::Args, docker, rustc, setup, toml, CommandVariant, CrossSetup, - Target, + CommandVariant, CrossSetup, Target, cargo_metadata_with_args, cli::Args, docker, rustc, setup, + toml, }; use eyre::Context; diff --git a/src/bin/cross-util.rs b/src/bin/cross-util.rs index a90c6f92a..628413cd0 100644 --- a/src/bin/cross-util.rs +++ b/src/bin/cross-util.rs @@ -79,9 +79,7 @@ fn get_container_engine( } macro_rules! get_engine { - ($args:ident, $docker_in_docker:expr, $msg_info: ident) => {{ - get_container_engine($args.engine(), $docker_in_docker, &mut $msg_info) - }}; + ($args:ident, $docker_in_docker:expr, $msg_info: ident) => {{ get_container_engine($args.engine(), $docker_in_docker, &mut $msg_info) }}; } pub fn main() -> cross::Result<()> { diff --git a/src/bin/cross.rs b/src/bin/cross.rs index ba66146fb..4502868d4 100644 --- a/src/bin/cross.rs +++ b/src/bin/cross.rs @@ -6,9 +6,8 @@ use std::{ }; use cross::{ - cargo, cli, rustc, + OutputExt, Subcommand, cargo, cli, rustc, shell::{self, Verbosity}, - OutputExt, Subcommand, }; pub fn main() -> cross::Result<()> { diff --git a/src/build.rs b/src/build.rs index 60f73a505..f6de97638 100644 --- a/src/build.rs +++ b/src/build.rs @@ -24,11 +24,20 @@ fn main() { .write_all(commit_info().as_bytes()) .unwrap(); + // Add "cross_sandboxed" to list of approved cfgs println!("cargo::rustc-check-cfg=cfg(cross_sandboxed)"); + if env::var("CROSS_SANDBOXED").is_ok() { println!("cargo:rustc-cfg=cross_sandboxed"); } println!("cargo:rerun-if-env-changed=CROSS_SANDBOXED"); + + // OCI does not support uppercase characters from orga/owner names + let image = std::env::var("CROSS_IMAGE") + .unwrap_or_else(|_| "ghcr.io/cross-rs".into()) + .to_lowercase(); + + println!("cargo:rustc-env=CROSS_IMAGE_LOWER={image}"); } fn commit_info() -> String { diff --git a/src/cli.rs b/src/cli.rs index 982ebde66..936447eb1 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,12 +1,12 @@ use std::env; use std::path::{Path, PathBuf}; +use crate::Target; use crate::cargo::Subcommand; use crate::errors::Result; -use crate::file::{absolute_path, PathExt}; +use crate::file::{PathExt, absolute_path}; use crate::rustc::TargetList; use crate::shell::{self, MessageInfo}; -use crate::Target; #[derive(Debug)] pub struct Args { diff --git a/src/cross_toml.rs b/src/cross_toml.rs index d0ef58897..0648fde5e 100644 --- a/src/cross_toml.rs +++ b/src/cross_toml.rs @@ -6,11 +6,11 @@ //! [1]: https://github.com/cross-rs/cross/blob/main/docs/config_file.md use crate::config::ConfVal; -use crate::docker::custom::PreBuild; use crate::docker::PossibleImage; +use crate::docker::custom::PreBuild; use crate::shell::MessageInfo; -use crate::{config, errors::*}; use crate::{Target, TargetList}; +use crate::{config, errors::*}; use serde::de::DeserializeOwned; use serde::{Deserialize, Deserializer, Serialize}; use std::collections::{BTreeSet, HashMap}; diff --git a/src/docker/custom.rs b/src/docker/custom.rs index 380eb4b25..8502fca8b 100644 --- a/src/docker/custom.rs +++ b/src/docker/custom.rs @@ -4,12 +4,12 @@ use std::str::FromStr; use crate::docker::{self, DockerOptions, DockerPaths}; use crate::shell::MessageInfo; -use crate::{errors::*, file, CommandExt, ToUtf8}; use crate::{CargoMetadata, TargetTriple}; +use crate::{CommandExt, ToUtf8, errors::*, file}; use super::{ - create_target_dir, get_image_name, path_hash, BuildCommandExt, BuildResultExt, Engine, - ImagePlatform, + BuildCommandExt, BuildResultExt, Engine, ImagePlatform, create_target_dir, get_image_name, + path_hash, }; pub const CROSS_CUSTOM_DOCKERFILE_IMAGE_PREFIX: &str = "localhost/cross-rs/cross-custom-"; diff --git a/src/docker/engine.rs b/src/docker/engine.rs index 0e42cb3f1..12e161b1d 100644 --- a/src/docker/engine.rs +++ b/src/docker/engine.rs @@ -5,7 +5,7 @@ use std::process::Command; use crate::config::bool_from_envvar; use crate::extensions::CommandExt; use crate::shell::MessageInfo; -use crate::{errors::*, OutputExt}; +use crate::{OutputExt, errors::*}; use super::{Architecture, ContainerOs}; @@ -175,7 +175,9 @@ fn is_docker_rootless(ce: &Path, msg_info: &mut MessageInfo) -> bool { fn various_is_rootless_configs() { let var = "CROSS_ROOTLESS_CONTAINER_ENGINE"; let old = env::var(var); - env::remove_var(var); + unsafe { + env::remove_var(var); + } assert!(!is_rootless(EngineType::Docker).unwrap_or(false)); assert!(is_rootless(EngineType::Docker).unwrap_or(true)); @@ -185,27 +187,33 @@ fn various_is_rootless_configs() { assert_eq!(is_rootless(EngineType::PodmanRemote), Some(true)); assert_eq!(is_rootless(EngineType::Other), Some(true)); - env::set_var(var, "0"); + unsafe { + env::set_var(var, "0"); + } assert_eq!(is_rootless(EngineType::Docker), Some(false)); assert_eq!(is_rootless(EngineType::Podman), Some(false)); assert_eq!(is_rootless(EngineType::PodmanRemote), Some(false)); assert_eq!(is_rootless(EngineType::Other), Some(false)); - env::set_var(var, "1"); + unsafe { + env::set_var(var, "1"); + } assert_eq!(is_rootless(EngineType::Docker), Some(true)); assert_eq!(is_rootless(EngineType::Podman), Some(true)); assert_eq!(is_rootless(EngineType::PodmanRemote), Some(true)); assert_eq!(is_rootless(EngineType::Other), Some(true)); - env::set_var(var, "auto"); + unsafe { + env::set_var(var, "auto"); + } assert_eq!(is_rootless(EngineType::Docker), None); assert_eq!(is_rootless(EngineType::Podman), Some(true)); assert_eq!(is_rootless(EngineType::PodmanRemote), Some(true)); assert_eq!(is_rootless(EngineType::Other), Some(true)); match old { - Ok(v) => env::set_var(var, v), - Err(_) => env::remove_var(var), + Ok(v) => unsafe { env::set_var(var, v) }, + Err(_) => unsafe { env::remove_var(var) }, } } diff --git a/src/docker/image.rs b/src/docker/image.rs index 6749fe86d..3e6224b74 100644 --- a/src/docker/image.rs +++ b/src/docker/image.rs @@ -3,10 +3,10 @@ use std::str::FromStr; use serde::{Deserialize, Serialize}; use crate::{ + TargetTriple, docker::{CROSS_IMAGE, DEFAULT_IMAGE_VERSION}, errors::*, shell::MessageInfo, - TargetTriple, }; use super::Engine; @@ -229,8 +229,8 @@ impl std::str::FromStr for ImagePlatform { // [os/arch[/variant]=]toolchain fn from_str(s: &str) -> Result { use serde::de::{ - value::{Error as SerdeError, StrDeserializer}, IntoDeserializer, + value::{Error as SerdeError, StrDeserializer}, }; // Try to match the docker platform string first diff --git a/src/docker/local.rs b/src/docker/local.rs index 80a707db2..572025397 100644 --- a/src/docker/local.rs +++ b/src/docker/local.rs @@ -158,6 +158,7 @@ pub(crate) fn run( // terminate or it may be a known interrupt return status (130, 137, 143). // simpler: just test if the program termination handler was called. // SAFETY: an atomic load. + #[allow(static_mut_refs)] let is_terminated = crate::errors::TERMINATED.load(Ordering::SeqCst); if !is_terminated { ChildContainer::exit_static(); diff --git a/src/docker/mod.rs b/src/docker/mod.rs index def816933..a9dbbc30c 100644 --- a/src/docker/mod.rs +++ b/src/docker/mod.rs @@ -40,6 +40,8 @@ impl ProvidedImage { } pub fn image_name(target: &str, sub: Option<&str>, repository: &str, tag: &str) -> String { + // OCI does not support uppercase characters from orga/owner names + let repository = repository.to_lowercase(); if let Some(sub) = sub { format!("{repository}/{target}:{tag}-{sub}") } else { diff --git a/src/docker/remote.rs b/src/docker/remote.rs index c4f405c3b..f7f0bbe54 100644 --- a/src/docker/remote.rs +++ b/src/docker/remote.rs @@ -9,6 +9,7 @@ use is_terminal::IsTerminal; use super::engine::Engine; use super::shared::*; +use crate::TargetTriple; use crate::config::bool_from_envvar; use crate::errors::Result; use crate::extensions::CommandExt; @@ -16,7 +17,6 @@ use crate::file::{self, PathExt, ToUtf8}; use crate::rustc::{self, QualifiedToolchain, VersionMetaExt}; use crate::shell::MessageInfo; use crate::temp; -use crate::TargetTriple; // prevent further commands from running if we handled // a signal earlier, and the volume is exited. @@ -217,9 +217,8 @@ impl ContainerDataVolume<'_, '_, '_> { ) -> Result<()> { let dirs = &self.toolchain_dirs; let reldst = dirs.cargo_mount_path_relative()?; - let copy_registry = env::var("CROSS_REMOTE_COPY_REGISTRY") - .map(|s| bool_from_envvar(&s)) - .unwrap_or(copy_registry); + let copy_registry = + env::var("CROSS_REMOTE_COPY_REGISTRY").map_or(copy_registry, |s| bool_from_envvar(&s)); self.create_dir(&reldst, mount_prefix, msg_info)?; if copy_registry { @@ -307,7 +306,7 @@ impl ContainerDataVolume<'_, '_, '_> { &temppath.join(rustlib), true, 0, - |e, d| d != 0 || e.file_type().map(|t| !t.is_file()).unwrap_or(true), + |e, d| d != 0 || e.file_type().map_or(true, |t| !t.is_file()), )?; self.copy_files(&temppath.join("lib"), &reldst, mount_prefix, msg_info)?; @@ -442,7 +441,7 @@ fn is_cachedir_tag(path: &Path) -> Result { fn is_cachedir(entry: &fs::DirEntry) -> bool { // avoid any cached directories when copying // see https://bford.info/cachedir/ - if entry.file_type().map(|t| t.is_dir()).unwrap_or(false) { + if entry.file_type().is_ok_and(|t| t.is_dir()) { let path = entry.path().join("CACHEDIR.TAG"); path.exists() && is_cachedir_tag(&path).unwrap_or(false) } else { diff --git a/src/docker/shared.rs b/src/docker/shared.rs index abad682a1..3a7f98400 100644 --- a/src/docker/shared.rs +++ b/src/docker/shared.rs @@ -1,15 +1,15 @@ #![allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER -use super::custom::{Dockerfile, PreBuild}; -use super::image::PossibleImage; use super::Image; use super::PROVIDED_IMAGES; -use super::{engine::*, ProvidedImage}; +use super::custom::{Dockerfile, PreBuild}; +use super::image::PossibleImage; +use super::{ProvidedImage, engine::*}; use crate::cargo::CargoMetadata; use crate::config::Config; use crate::errors::*; use crate::extensions::{CommandExt, SafeCommand}; -use crate::file::{self, write_file, PathExt, ToUtf8}; +use crate::file::{self, PathExt, ToUtf8, write_file}; use crate::id; use crate::rustc::QualifiedToolchain; use crate::shell::{ColorChoice, MessageInfo, Verbosity}; @@ -23,16 +23,10 @@ use std::{env, fs, time}; use rustc_version::Version as RustcVersion; pub use super::custom::CROSS_CUSTOM_DOCKERFILE_IMAGE_PREFIX; -pub const CROSS_IMAGE: &str = { - if let Some(opt) = option_env!("CROSS_IMAGE") { - opt - } else { - "ghcr.io/cross-rs" - } -}; +pub const CROSS_IMAGE: &str = env!("CROSS_IMAGE_LOWER"); // note: this is the most common base image for our images -pub const UBUNTU_BASE: &str = "ubuntu:20.04"; +pub const UBUNTU_BASE: &str = "ubuntu:24.04"; pub const DEFAULT_IMAGE_VERSION: &str = if crate::commit_info().is_empty() { env!("CARGO_PKG_VERSION") } else { @@ -547,6 +541,7 @@ impl ChildContainer { pub fn create(engine: Engine, name: String) -> Result<()> { // SAFETY: guarded by an atomic swap unsafe { + #[allow(static_mut_refs)] if !CHILD_CONTAINER.exists.swap(true, Ordering::SeqCst) { CHILD_CONTAINER.info = Some(ChildContainerInfo { engine, @@ -571,7 +566,10 @@ impl ChildContainer { pub fn exists_static() -> bool { // SAFETY: an atomic load. - unsafe { CHILD_CONTAINER.exists() } + #[allow(static_mut_refs)] + unsafe { + CHILD_CONTAINER.exists() + } } // when the `docker run` command finished. @@ -582,6 +580,7 @@ impl ChildContainer { pub fn exit_static() { // SAFETY: an atomic store. + #[allow(static_mut_refs)] unsafe { CHILD_CONTAINER.exit(); } @@ -608,6 +607,7 @@ impl ChildContainer { pub fn finish_static(is_tty: bool, msg_info: &mut MessageInfo) { // SAFETY: internally guarded by an atomic load. + #[allow(static_mut_refs)] unsafe { CHILD_CONTAINER.finish(is_tty, msg_info); } @@ -667,7 +667,7 @@ pub enum VolumeId { impl VolumeId { pub fn mount(&self, mount_prefix: &str) -> String { match self { - VolumeId::Keep(ref id) => format!("{id}:{mount_prefix}"), + VolumeId::Keep(id) => format!("{id}:{mount_prefix}"), VolumeId::Discard => mount_prefix.to_owned(), } } @@ -1215,11 +1215,7 @@ pub enum GetImageError { } fn get_target_name(target: &Target, uses_zig: bool) -> &str { - if uses_zig { - "zig" - } else { - target.triple() - } + if uses_zig { "zig" } else { target.triple() } } fn get_user_image( @@ -1556,7 +1552,9 @@ mod tests { fn test_docker_userns() { let var = "CROSS_CONTAINER_USER_NAMESPACE"; let old = env::var(var); - env::remove_var(var); + unsafe { + env::remove_var(var); + } let host = "\"engine\" \"--userns\" \"host\"".to_owned(); let custom = "\"engine\" \"--userns\" \"custom\"".to_owned(); @@ -1569,21 +1567,31 @@ mod tests { }; test(&host); - env::set_var(var, "auto"); + unsafe { + env::set_var(var, "auto"); + } test(&host); - env::set_var(var, "none"); + unsafe { + env::set_var(var, "none"); + } test(&none); - env::set_var(var, "host"); + unsafe { + env::set_var(var, "host"); + } test(&host); - env::set_var(var, "custom"); + unsafe { + env::set_var(var, "custom"); + } test(&custom); - match old { - Ok(v) => env::set_var(var, v), - Err(_) => env::remove_var(var), + unsafe { + match old { + Ok(v) => env::set_var(var, v), + Err(_) => env::remove_var(var), + } } } @@ -1642,7 +1650,9 @@ mod tests { let envvars = ["CARGO_HOME", "NIX_STORE"]; for var in envvars { result.push((var, env::var(var).ok())); - env::remove_var(var); + unsafe { + env::remove_var(var); + } } result @@ -1651,7 +1661,9 @@ mod tests { fn reset_env(vars: Vec<(&'static str, Option)>) { for (var, value) in vars { if let Some(value) = value { - env::set_var(var, value); + unsafe { + env::set_var(var, value); + } } } } @@ -1865,7 +1877,9 @@ mod tests { }, }])).unwrap(); let want = MountDetail { - source: PathBuf::from("/var/lib/docker/overlay2/f107af83b37bc0a182d3d2661f3d84684f0fffa1a243566b338a388d5e54bef4/merged"), + source: PathBuf::from( + "/var/lib/docker/overlay2/f107af83b37bc0a182d3d2661f3d84684f0fffa1a243566b338a388d5e54bef4/merged", + ), destination: PathBuf::from("/"), }; assert_eq!(want, actual); diff --git a/src/errors.rs b/src/errors.rs index 0dad33bbb..4fdab33d2 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -19,13 +19,16 @@ pub fn install_panic_hook() -> Result<()> { /// # Safety /// Safe as long as we have single-threaded execution. -unsafe fn termination_handler() { +fn termination_handler() { // we can't warn the user here, since locks aren't signal-safe. // we can delete files, since fdopendir is thread-safe, and // `openat`, `unlinkat`, and `lstat` are signal-safe. // https://man7.org/linux/man-pages/man7/signal-safety.7.html - if !TERMINATED.swap(true, Ordering::SeqCst) && temp::has_tempfiles() { - temp::clean(); + #[allow(static_mut_refs)] + unsafe { + if !TERMINATED.swap(true, Ordering::SeqCst) && temp::has_tempfiles() { + temp::clean(); + } } // tl;dr this is a long explanation to say this is thread-safe. @@ -103,7 +106,9 @@ unsafe fn termination_handler() { // a global CString and `Vec`, respectively. this atomic guard // makes this safe regardless. #[allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER - docker::CHILD_CONTAINER.terminate(); + unsafe { + docker::CHILD_CONTAINER.terminate(); + } // all termination exit codes are 128 + signal code. the exit code is // 130 for Ctrl+C or SIGINT (signal code 2) for linux, macos, and windows. @@ -112,11 +117,9 @@ unsafe fn termination_handler() { pub fn install_termination_hook() -> Result<()> { // SAFETY: safe since single-threaded execution. - unsafe { - signal_hook::low_level::register(signal_hook::consts::SIGINT, || termination_handler()) - } - .map_err(Into::into) - .map(|_| ()) + unsafe { signal_hook::low_level::register(signal_hook::consts::SIGINT, termination_handler) } + .map_err(Into::into) + .map(|_| ()) } #[derive(Debug, thiserror::Error)] diff --git a/src/interpreter.rs b/src/interpreter.rs index 0968093c0..12cc9ddf4 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -1,8 +1,8 @@ use std::path::Path; +use crate::Target; use crate::errors::*; use crate::file; -use crate::Target; /// Checks if the interpreters have been registered in the host system pub fn is_registered(target: &Target) -> Result { diff --git a/src/lib.rs b/src/lib.rs index 26f0ad164..951508787 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,14 +58,14 @@ use rustc::{QualifiedToolchain, Toolchain}; use rustc_version::Channel; use serde::{Deserialize, Serialize, Serializer}; -pub use self::cargo::{cargo_command, cargo_metadata_with_args, CargoMetadata, Subcommand}; +pub use self::cargo::{CargoMetadata, Subcommand, cargo_command, cargo_metadata_with_args}; use self::cross_toml::CrossToml; use self::errors::Context; use self::shell::{MessageInfo, Verbosity}; -pub use self::errors::{install_panic_hook, install_termination_hook, Result}; +pub use self::errors::{Result, install_panic_hook, install_termination_hook}; pub use self::extensions::{CommandExt, OutputExt, SafeCommand}; -pub use self::file::{pretty_path, ToUtf8}; +pub use self::file::{ToUtf8, pretty_path}; pub use self::rustc::{TargetList, VersionMetaExt}; pub const CROSS_LABEL_DOMAIN: &str = "org.cross-rs"; diff --git a/src/rustc.rs b/src/rustc.rs index 14247b986..c7ae40553 100644 --- a/src/rustc.rs +++ b/src/rustc.rs @@ -4,11 +4,11 @@ use std::process::Command; use rustc_version::{Version, VersionMeta}; use serde::Deserialize; +use crate::TargetTriple; use crate::docker::ImagePlatform; use crate::errors::*; -use crate::extensions::{env_program, CommandExt}; +use crate::extensions::{CommandExt, env_program}; use crate::shell::MessageInfo; -use crate::TargetTriple; #[derive(Debug)] pub struct TargetList { diff --git a/src/rustup.rs b/src/rustup.rs index 8d5d7f755..13c475615 100644 --- a/src/rustup.rs +++ b/src/rustup.rs @@ -3,11 +3,11 @@ use std::process::Command; use rustc_version::{Channel, Version}; +use crate::Target; use crate::errors::*; pub use crate::extensions::{CommandExt, OutputExt}; use crate::rustc::QualifiedToolchain; use crate::shell::{MessageInfo, Verbosity}; -use crate::Target; #[derive(Debug)] pub struct AvailableTargets { diff --git a/src/temp.rs b/src/temp.rs index 39ea74d1a..64f05166c 100644 --- a/src/temp.rs +++ b/src/temp.rs @@ -21,7 +21,10 @@ pub fn dir() -> Result { pub(crate) fn has_tempfiles() -> bool { // SAFETY: safe, since we only check if the stack is empty. - unsafe { !FILES.is_empty() || !DIRS.is_empty() } + #[allow(static_mut_refs)] + unsafe { + !FILES.is_empty() || !DIRS.is_empty() + } } /// # Safety @@ -30,8 +33,14 @@ pub(crate) unsafe fn clean() { // don't expose FILES or DIRS outside this module, // so we can only add or remove from the stack using // our wrappers, guaranteeing add/remove in order. - FILES.clear(); - DIRS.clear(); + #[allow(static_mut_refs)] + unsafe { + FILES.clear(); + } + #[allow(static_mut_refs)] + unsafe { + DIRS.clear(); + } } /// # Safety @@ -40,14 +49,23 @@ unsafe fn push_tempfile() -> Result<&'static mut tempfile::NamedTempFile> { let parent = dir()?; fs::create_dir_all(&parent).ok(); let file = tempfile::NamedTempFile::new_in(&parent)?; - FILES.push(file); - Ok(FILES.last_mut().expect("file list should not be empty")) + #[allow(static_mut_refs)] + unsafe { + FILES.push(file); + } + #[allow(static_mut_refs)] + unsafe { + Ok(FILES.last_mut().expect("file list should not be empty")) + } } /// # Safety /// Safe as long as we have single-threaded execution. unsafe fn pop_tempfile() -> Option { - FILES.pop() + #[allow(static_mut_refs)] + unsafe { + FILES.pop() + } } #[derive(Debug)] @@ -60,7 +78,7 @@ impl TempFile { /// Safe as long as we have single-threaded execution. pub unsafe fn new() -> Result { Ok(Self { - file: push_tempfile()?, + file: unsafe { push_tempfile()? }, }) } @@ -89,14 +107,21 @@ unsafe fn push_tempdir() -> Result<&'static Path> { let parent = dir()?; fs::create_dir_all(&parent).ok(); let dir = tempfile::TempDir::new_in(&parent)?; - DIRS.push(dir); - Ok(DIRS.last().expect("should not be empty").path()) + #[allow(static_mut_refs)] + unsafe { + DIRS.push(dir); + } + #[allow(static_mut_refs)] + Ok(unsafe { DIRS.last().expect("should not be empty").path() }) } /// # Safety /// Safe as long as we have single-threaded execution. unsafe fn pop_tempdir() -> Option { - DIRS.pop() + #[allow(static_mut_refs)] + unsafe { + DIRS.pop() + } } #[derive(Debug)] @@ -109,7 +134,7 @@ impl TempDir { /// Safe as long as we have single-threaded execution. pub unsafe fn new() -> Result { Ok(Self { - path: push_tempdir()?, + path: unsafe { push_tempdir()? }, }) } diff --git a/src/tests.rs b/src/tests.rs index d7184bd53..d5251f996 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -9,7 +9,7 @@ use std::{ use once_cell::sync::OnceCell; use rustc_version::VersionMeta; -use crate::{docker::ImagePlatform, rustc::QualifiedToolchain, TargetTriple, ToUtf8}; +use crate::{TargetTriple, ToUtf8, docker::ImagePlatform, rustc::QualifiedToolchain}; static WORKSPACE: OnceCell = OnceCell::new(); @@ -49,7 +49,7 @@ pub fn walk_dir<'a>( #[test] pub fn target_mismatch() { - use crate::{warn_host_version_mismatch, VersionMatch}; + use crate::{VersionMatch, warn_host_version_mismatch}; fn make_meta(input: &str) -> VersionMeta { let mut split = input.split(' '); diff --git a/targets.toml b/targets.toml index 902985038..7d3432d08 100644 --- a/targets.toml +++ b/targets.toml @@ -5,7 +5,7 @@ [[target]] target = "x86_64-apple-darwin" -os = "macos-13" +os = "macos-15-intel" special = true deploy = true @@ -31,7 +31,7 @@ deploy = true [[target]] target = "x86_64-pc-windows-msvc" -os = "windows-2019" +os = "windows-2022" special = true deploy = true @@ -122,7 +122,7 @@ cpp = true dylib = true std = true run = true -runners = "native qemu-user qemu-system" +runners = "qemu-user" [[target]] target = "loongarch64-unknown-linux-gnu" @@ -410,14 +410,12 @@ run = true [[target]] target = "x86_64-pc-windows-gnu" os = "ubuntu-latest" -cpp = true std = true run = true [[target]] target = "i686-pc-windows-gnu" os = "ubuntu-latest" -cpp = true std = true run = true diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index e0386c05c..7b604b55c 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -4,22 +4,22 @@ license = "MIT OR Apache-2.0" name = "xtask" repository = "https://github.com/cross-rs/cross" version = "0.0.0-dev.0" -edition = "2021" +edition = "2024" publish = false [dependencies] cross = { path = "..", features = ["dev"] } -walkdir = "2.3.3" -color-eyre = "0.6.2" -eyre = "0.6.8" -clap = { version = "4.1", features = ["derive", "env"] } -which = { version = "4.2", default-features = false } -serde = { version = "1", features = ["derive"] } -serde_json = "1.0" +walkdir = "2.5.0" +color-eyre = "0.6.5" +eyre = "0.6.12" +clap = { version = "4.5.47", features = ["derive", "env"] } +which = { version = "8.0.0", default-features = false } +serde = { version = "1.0.219", features = ["derive"] } +serde_json = "1.0.143" shell-words = "1.1.0" -toml = "0.7" -once_cell = "1.17" -semver = "1" -chrono = "0.4" -wildmatch = "2.1.1" +toml = "0.9.5" +once_cell = "1.21.3" +semver = "1.0.26" +chrono = "0.4.41" +wildmatch = "2.4.0" diff --git a/xtask/src/build_docker_image.rs b/xtask/src/build_docker_image.rs index c747aba50..0b62d9e53 100644 --- a/xtask/src/build_docker_image.rs +++ b/xtask/src/build_docker_image.rs @@ -1,10 +1,10 @@ use std::fmt::Write; use std::path::Path; +use crate::ImageTarget; use crate::util::{ - cargo_metadata, get_matrix, gha_error, gha_output, gha_print, DEFAULT_PLATFORMS, + DEFAULT_PLATFORMS, cargo_metadata, get_matrix, gha_error, gha_output, gha_print, }; -use crate::ImageTarget; use clap::Args; use cross::docker::{self, BuildCommandExt, BuildResultExt, ImagePlatform, Progress}; use cross::shell::MessageInfo; @@ -126,6 +126,8 @@ pub fn build_docker_image( engine: &docker::Engine, msg_info: &mut MessageInfo, ) -> cross::Result<()> { + // OCI does not support uppercase characters from orga/owner names + let repository = repository.to_lowercase(); let metadata = cargo_metadata(msg_info)?; let version = metadata .get_package("cross") @@ -236,7 +238,9 @@ pub fn build_docker_image( )?), _ => { if push && tag_override.is_none() { - panic!("Refusing to push without tag or branch. Specify a repository and tag with `--repository --tag `") + panic!( + "Refusing to push without tag or branch. Specify a repository and tag with `--repository --tag `" + ) } tags.push(target.image_name(&repository, "local")); } @@ -339,7 +343,9 @@ pub fn build_docker_image( } } if gha { - std::env::set_var("GITHUB_STEP_SUMMARY", job_summary(&results)?); + unsafe { + std::env::set_var("GITHUB_STEP_SUMMARY", job_summary(&results)?); + } } if results.iter().any(|r| r.is_err()) { #[allow(unknown_lints, clippy::manual_try_fold)] diff --git a/xtask/src/changelog.rs b/xtask/src/changelog.rs index 3ea79b396..e1128667b 100644 --- a/xtask/src/changelog.rs +++ b/xtask/src/changelog.rs @@ -5,8 +5,8 @@ use std::fs; use std::path::Path; use crate::util::{project_dir, write_to_string}; -use cross::shell::MessageInfo; use cross::ToUtf8; +use cross::shell::MessageInfo; use chrono::{Datelike, Utc}; use clap::{Args, Subcommand}; @@ -797,7 +797,9 @@ mod tests { let expected = ChangelogEntry::new( IdType::PullRequest(vec![905]), ChangelogContents { - description: s!("added qemu emulation to `i586-unknown-linux-gnu`, `i686-unknown-linux-musl`, and `i586-unknown-linux-gnu`, so they can run on an `x86` CPU, rather than an `x86_64` CPU."), + description: s!( + "added qemu emulation to `i586-unknown-linux-gnu`, `i686-unknown-linux-musl`, and `i586-unknown-linux-gnu`, so they can run on an `x86` CPU, rather than an `x86_64` CPU." + ), issues: vec![], breaking: false, kind: ChangelogType::Added, @@ -808,7 +810,9 @@ mod tests { let expected = ChangelogEntry::new( IdType::PullRequest(vec![869]), ChangelogContents { - description: s!("ensure cargo configuration environment variable flags are passed to the docker container."), + description: s!( + "ensure cargo configuration environment variable flags are passed to the docker container." + ), issues: vec![], breaking: false, kind: ChangelogType::Changed, @@ -819,7 +823,9 @@ mod tests { let expected = ChangelogEntry::new( IdType::PullRequest(vec![905]), ChangelogContents { - description: s!("fixed running dynamically-linked libraries for all musl targets except `x86_64-unknown-linux-musl`."), + description: s!( + "fixed running dynamically-linked libraries for all musl targets except `x86_64-unknown-linux-musl`." + ), issues: vec![], breaking: false, kind: ChangelogType::Fixed, diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 54ae759f9..1a068fa5b 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -3,7 +3,7 @@ mod target_matrix; use crate::util::gha_output; use clap::Subcommand; use cross::shell::Verbosity; -use cross::{cargo_command, CargoMetadata, CommandExt}; +use cross::{CargoMetadata, CommandExt, cargo_command}; #[derive(Subcommand, Debug)] pub enum CiJob { @@ -88,10 +88,12 @@ pub fn ci(args: CiJob, metadata: CargoMetadata) -> cross::Result<()> { let version = semver::Version::parse(&cross_meta.version)?; if ref_type == "tag" { if ref_name.starts_with('v') && ref_name != format!("v{version}") { - eyre::bail!("a version tag was published, but the tag does not match the current version in Cargo.toml"); + eyre::bail!( + "a version tag was published, but the tag does not match the current version in Cargo.toml" + ); } let search = cargo_command() - .args(["search", "--limit", "1"]) + .args(["search", "--color", "never", "--limit", "1"]) .arg("cross") .run_and_get_stdout(&mut Verbosity::Verbose(2).into())?; let (cross, rest) = search diff --git a/xtask/src/ci/target_matrix.rs b/xtask/src/ci/target_matrix.rs index aa9c3cd91..82252311b 100644 --- a/xtask/src/ci/target_matrix.rs +++ b/xtask/src/ci/target_matrix.rs @@ -1,11 +1,11 @@ use std::process::Command; -use clap::builder::{BoolishValueParser, PossibleValuesParser}; use clap::Parser; -use cross::{shell::Verbosity, CommandExt}; +use clap::builder::{BoolishValueParser, PossibleValuesParser}; +use cross::{CommandExt, shell::Verbosity}; use serde::{Deserialize, Serialize}; -use crate::util::{get_matrix, gha_output, gha_print, CiTarget, ImageTarget}; +use crate::util::{CiTarget, ImageTarget, get_matrix, gha_output, gha_print}; #[derive(Parser, Debug)] pub struct TargetMatrix { @@ -465,15 +465,19 @@ mod tests { #[test] fn ensure_filter_works() { let matrix = run(["--dylib", "1"]); - assert!(matrix - .iter() - .any(|t| t.target == "aarch64-unknown-linux-gnu")); + assert!( + matrix + .iter() + .any(|t| t.target == "aarch64-unknown-linux-gnu") + ); assert!(matrix.iter().all(|t| t.target != "thumbv6m-none-eabi")); let matrix = run(["--dylib", "0"]); - assert!(matrix - .iter() - .all(|t| t.target != "aarch64-unknown-linux-gnu")); + assert!( + matrix + .iter() + .all(|t| t.target != "aarch64-unknown-linux-gnu") + ); assert!(matrix.iter().any(|t| t.target == "thumbv6m-none-eabi")); } @@ -494,7 +498,10 @@ mod tests { #[test] fn merge_group() { assert_eq!( - process_merge_group("refs/heads/gh-readonly-queue/main/pr-1375-44011c8854cb2eaac83b173cc323220ccdff18ea").unwrap(), + process_merge_group( + "refs/heads/gh-readonly-queue/main/pr-1375-44011c8854cb2eaac83b173cc323220ccdff18ea" + ) + .unwrap(), "1375" ); } diff --git a/xtask/src/crosstool.rs b/xtask/src/crosstool.rs index 655fd1162..811ac7b1e 100644 --- a/xtask/src/crosstool.rs +++ b/xtask/src/crosstool.rs @@ -5,8 +5,8 @@ use std::path::{Path, PathBuf}; use crate::util::{project_dir, write_to_string}; use clap::Args; -use cross::shell::MessageInfo; use cross::ToUtf8; +use cross::shell::MessageInfo; const DEFAULT_GCC_VERSION: &str = "8.3.0"; const DEFAULT_GLIBC_VERSION: &str = "2.17.0"; diff --git a/xtask/src/hooks.rs b/xtask/src/hooks.rs index 57dcbbe46..c1bcc2296 100644 --- a/xtask/src/hooks.rs +++ b/xtask/src/hooks.rs @@ -4,10 +4,10 @@ use std::path::{Path, PathBuf}; use std::process::Command; use crate::util::{cargo, cargo_metadata, get_channel_prefer_nightly}; -use clap::builder::BoolishValueParser; use clap::Args; -use cross::shell::MessageInfo; +use clap::builder::BoolishValueParser; use cross::CommandExt; +use cross::shell::MessageInfo; use eyre::Context; const CARGO_FLAGS: &[&str] = &["--all-features", "--all-targets", "--workspace"]; diff --git a/xtask/src/main.rs b/xtask/src/main.rs index d8bbf4f9f..b03d90275 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -15,7 +15,7 @@ use clap::{CommandFactory, Parser, Subcommand}; use codegen::Codegen; use cross::docker; use cross::shell::{MessageInfo, Verbosity}; -use util::{cargo_metadata, ImageTarget}; +use util::{ImageTarget, cargo_metadata}; use self::build_docker_image::BuildDockerImage; use self::changelog::Changelog; @@ -84,9 +84,7 @@ fn is_toolchain(toolchain: &str) -> cross::Result { } macro_rules! get_engine { - ($args:ident, $msg_info:ident) => {{ - get_container_engine($args.engine.as_deref(), &mut $msg_info) - }}; + ($args:ident, $msg_info:ident) => {{ get_container_engine($args.engine.as_deref(), &mut $msg_info) }}; } pub fn main() -> cross::Result<()> { diff --git a/xtask/src/target_info.rs b/xtask/src/target_info.rs index 70faaf061..00d4c0ee9 100644 --- a/xtask/src/target_info.rs +++ b/xtask/src/target_info.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use crate::util::{format_repo, pull_image}; use clap::Args; use cross::shell::MessageInfo; -use cross::{docker, CommandExt}; +use cross::{CommandExt, docker}; // Store raw text data in the binary so we don't need a data directory // when extracting all targets, or running our target info script. diff --git a/xtask/src/util.rs b/xtask/src/util.rs index 04f1b8cec..85a97e8c6 100644 --- a/xtask/src/util.rs +++ b/xtask/src/util.rs @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; use std::process::Command; use cross::shell::MessageInfo; -use cross::{docker, CommandExt, ToUtf8}; +use cross::{CommandExt, ToUtf8, docker}; use once_cell::sync::{Lazy, OnceCell}; use serde::Deserialize; @@ -319,7 +319,9 @@ pub fn gha_error(content: &str) { pub fn gha_output(tag: &str, content: &str) -> cross::Result<()> { if content.contains('\n') { // https://github.com/actions/toolkit/issues/403 - eyre::bail!("output `{tag}` contains newlines, consider serializing with json and deserializing in gha with fromJSON()"); + eyre::bail!( + "output `{tag}` contains newlines, consider serializing with json and deserializing in gha with fromJSON()" + ); } write_to_gha_env_file("GITHUB_OUTPUT", &format!("{tag}={content}"))?; Ok(())