rust icon indicating copy to clipboard operation
rust copied to clipboard

Migrate `run-make/c-link-to-rust-staticlib` to `rmake`

Open Oneirical opened this issue 1 month ago • 3 comments

Part of #121876.

r? @jieyouxu

Oneirical avatar May 11 '24 21:05 Oneirical

Some changes occurred in run-make tests.

cc @jieyouxu

rustbot avatar May 11 '24 21:05 rustbot

Unless there's a good reason for ignore-freebsd, we can try to land this port without that ignore that see if it fails in full build. Let me know if there's a good reason for that ignore, or remove that ignore and we can try to merge.

@rustbot author

jieyouxu avatar May 13 '24 10:05 jieyouxu

Ignore statement removed.

and we can try to merge.

Would it be pertinent to follow the "try builds" section in this page to force the CI to use FreeBSD, and see what happens?

@rustbot review

Oneirical avatar May 14 '24 02:05 Oneirical

Yes please give this PR a try on a FreeBSD CI job if possible

jieyouxu avatar May 14 '24 02:05 jieyouxu

@bors rollup=iffy

jieyouxu avatar May 14 '24 02:05 jieyouxu

You'll want to follow this https://rustc-dev-guide.rust-lang.org/tests/ci.html?highlight=CI#testing-with-ci not the infra page

jieyouxu avatar May 14 '24 02:05 jieyouxu

The job dist-x86_64-freebsd failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  DOC_ARTIFACT_NAME: doc-125027-abfcd0db
  AWS_ACCESS_KEY_ID: 
  AWS_SECRET_ACCESS_KEY: 
##[endgroup]
cp: cannot stat 'obj/build/metrics.json': No such file or directory
##[error]Process completed with exit code 1.

rust-log-analyzer avatar May 14 '24 03:05 rust-log-analyzer

Looks like the FreeBSD ignore was there for a reason. Ignore statement restored.

Though, looking at the logs, the build passed, it's just the upload of artifacts which failed? Does this have anything to do with the test?

Oneirical avatar May 14 '24 03:05 Oneirical

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Getting action download info
Download action repository 'msys2/[email protected]' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea)
Download action repository 'actions/checkout@v4' (SHA:0ad4b8fadaa221de15dcec353f45205ec38ea70b)
Download action repository 'actions/upload-artifact@v4' (SHA:65462800fd760344b1a7b4382951275a0abb4808)
Complete job name: PR - mingw-check-tidy
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \
    && pip3 install virtualenv
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---

#12 [5/8] COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
#12 DONE 0.0s

#13 [6/8] RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt     && pip3 install virtualenv
#13 0.476   Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
#13 0.497 Collecting boolean-py==4.0
#13 0.504   Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
#13 0.522 Collecting chardet==5.1.0
---
#13 3.752 Building wheels for collected packages: reuse
#13 3.753   Building wheel for reuse (pyproject.toml): started
#13 4.083   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 4.084   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#13 4.084   Stored in directory: /tmp/pip-ephem-wheel-cache-vxmhv0f5/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#13 4.087 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#13 4.108   Attempting uninstall: setuptools
#13 4.109     Found existing installation: setuptools 59.6.0
#13 4.110     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#13 4.110     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#13 4.110     Can't uninstall 'setuptools'. No files were found to uninstall.
#13 4.790 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0
#13 4.791 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 5.328 Collecting virtualenv
#13 5.384   Downloading virtualenv-20.26.2-py3-none-any.whl (3.9 MB)
#13 5.525      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 28.3 MB/s eta 0:00:00
#13 5.578 Collecting platformdirs<5,>=3.9.1
#13 5.586   Downloading platformdirs-4.2.1-py3-none-any.whl (17 kB)
#13 5.606 Collecting distlib<1,>=0.3.7
#13 5.614   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 5.662 Collecting filelock<4,>=3.12.2
#13 5.669   Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
#13 5.669   Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
#13 5.757 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 5.922 Successfully installed distlib-0.3.8 filelock-3.14.0 platformdirs-4.2.1 virtualenv-20.26.2
#13 DONE 6.0s

#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k:      176064 kB
DirectMap2M:     7163904 kB
DirectMap1G:    11534336 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
    Finished `dev` profile [unoptimized] target(s) in 0.03s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/9105c57b7f6623310e33f3ee7e48a3114e5190a7/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-9105c57b7f6623310e33f3ee7e48a3114e5190a7-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
   Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
    Finished `release` profile [optimized] target(s) in 26.60s
##[endgroup]
fmt check
##[error]Diff in /checkout/tests/run-make/c-link-to-rust-staticlib/rmake.rs at line 8:
 
 fn main() {
 fn main() {
-    rustc().input("foo.rs")
-        .run();
+    rustc().input("foo.rs").run();
     cc().input("bar.c")
         .input(static_lib("foo"))
         .out_exe("bar")
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/tests/run-make/stdin-rustc/rmake.rs" "/checkout/tests/run-make/core-no-fp-fmt-parse/rmake.rs" "/checkout/tests/run-make/wasm-spurious-import/rmake.rs" "/checkout/tests/run-make/repr128-dwarf/rmake.rs" "/checkout/tests/run-make/exit-code/rmake.rs" "/checkout/tests/run-make/wasm-stringify-ints-small/rmake.rs" "/checkout/tests/run-make/alloc-no-rc/rmake.rs" "/checkout/tests/run-make/c-link-to-rust-staticlib/rmake.rs" "/checkout/tests/run-make/wasm-abi/rmake.rs" "/checkout/tests/run-make/rust-lld/rmake.rs" "/checkout/tests/run-make/rustdoc-target-spec-json-path/rmake.rs" "/checkout/tests/run-make/rustdoc-map-file/rmake.rs" "/checkout/tests/run-make/wasm-symbols-not-exported/rmake.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Tue May 14 03:52:39 UTC 2024
  network time: Tue, 14 May 2024 03:52:39 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

rust-log-analyzer avatar May 14 '24 03:05 rust-log-analyzer

:umbrella: The latest upstream changes (presumably #125026) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar May 14 '24 08:05 bors

Looks like the FreeBSD ignore was there for a reason. Ignore statement restored.

Though, looking at the logs, the build passed, it's just the upload of artifacts which failed? Does this have anything to do with the test?

CI looks unrelated, can you remove the ignore-freebsd? We'll try merging without ignore-freebsd

jieyouxu avatar May 14 '24 11:05 jieyouxu

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

  • e60d8dc34aaedb0231249f1da7410f27d60d36ed

rustbot avatar May 14 '24 20:05 rustbot

You'll probably have to rebase :3

jieyouxu avatar May 14 '24 20:05 jieyouxu

You'll probably have to rebase :3

Yep, I accidentally clicked the wrong button on the Github website while looking at the merge conflict. In order to avoid a repeat of The Incident, I'll go get access to my laptop in a bit and amend that merge.

Oneirical avatar May 14 '24 20:05 Oneirical

GitHub's merge UI is almost always a trap. I just do merge conflict resolution offline.

jieyouxu avatar May 14 '24 20:05 jieyouxu

Can you remove //@ ignore-freebsd and squash the commits into one? After that I can r+.

jieyouxu avatar May 14 '24 20:05 jieyouxu

Eyy, disaster averted. Who needs courses on how to use Git when you have the Rust repository as your personal mad scientist sandbox?

Should be ready for r+ when CI is green.

Oneirical avatar May 14 '24 20:05 Oneirical

Let us give arbitrary try jobs a try (heh)

@bors try

jieyouxu avatar May 14 '24 20:05 jieyouxu

:hourglass: Trying commit b1e5e5161a2ef27852aab40cf3472187bdda5fee with merge bb99ac56df05c0b1af9ab7e1d78a9ddd98705f46...

bors avatar May 14 '24 20:05 bors

:sunny: Try build successful - checks-actions Build commit: bb99ac56df05c0b1af9ab7e1d78a9ddd98705f46 (bb99ac56df05c0b1af9ab7e1d78a9ddd98705f46)

bors avatar May 14 '24 21:05 bors

@bors r+

jieyouxu avatar May 14 '24 21:05 jieyouxu

:pushpin: Commit b1e5e5161a2ef27852aab40cf3472187bdda5fee has been approved by jieyouxu

It is now in the queue for this repository.

bors avatar May 14 '24 21:05 bors

:hourglass: Testing commit b1e5e5161a2ef27852aab40cf3472187bdda5fee with merge 5107b5c1d090a37c9d6629e9ec9ddf37d2e6100a...

bors avatar May 14 '24 23:05 bors

:broken_heart: Test failed - checks-actions

bors avatar May 14 '24 23:05 bors

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING] core::build_steps::tool::ToolBuild { compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu }, target: aarch64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "" } -- 24.077
[TIMING] core::build_steps::tool::Tidy { compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu }, target: aarch64-unknown-linux-gnu } -- 0.004
fmt check
##[error]Diff in /checkout/tests/run-make/c-link-to-rust-staticlib/rmake.rs at line 8:
 fn main() {
 fn main() {
     rustc().input("foo.rs").run();
-    cc().input("bar.c")
-        .input(static_lib("foo"))
-        .out_exe("bar")
-        .args(&extra_c_flags())
-        .run();
+    cc().input("bar.c").input(static_lib("foo")).out_exe("bar").args(&extra_c_flags()).run();
     run("bar");
     fs::remove_file(static_lib("foo"));
     run("bar");
Running `"/checkout/obj/build/aarch64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/tests/run-make/c-link-to-rust-staticlib/rmake.rs" "/checkout/tests/run-make/rustdoc-target-spec-json-path/rmake.rs" "/checkout/tests/run-make/wasm-symbols-not-imported/rmake.rs" "/checkout/tests/run-make/wasm-symbols-different-module/rmake.rs" "/checkout/tests/run-make/rustdoc-error-lines/rmake.rs" "/checkout/tests/run-make/cross-lang-lto-riscv-abi/rmake.rs" "/checkout/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs" "/checkout/tests/run-make/wasm-symbols-not-exported/rmake.rs" "/checkout/tests/run-make/rustdoc-map-file/rmake.rs" "/checkout/tests/run-make/alloc-no-oom-handling/rmake.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Tue May 14 23:08:47 UTC 2024
  network time: Tue, 14 May 2024 23:08:47 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

rust-log-analyzer avatar May 14 '24 23:05 rust-log-analyzer

@bors r+ rollup

jieyouxu avatar May 15 '24 05:05 jieyouxu

:pushpin: Commit 91a3f04a3f9d6927e09c5ca6e57d337255cf1886 has been approved by jieyouxu

It is now in the queue for this repository.

bors avatar May 15 '24 05:05 bors