Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite fails with Rust v1.65.0 #11004

Closed
heftig opened this issue Nov 6, 2022 · 1 comment · Fixed by #11058
Closed

Test suite fails with Rust v1.65.0 #11004

heftig opened this issue Nov 6, 2022 · 1 comment · Fixed by #11058

Comments

@heftig
Copy link
Contributor

heftig commented Nov 6, 2022

The 0.63.0 test suite (./run_tests.py --failfast) fails on Arch Linux since the upgrade to Rust v1.65.0. It seems the Clippy error message got changed from

error: use of a blacklisted/placeholder name `foo`

to

error: use of a disallowed/placeholder name `foo`

Failure log:

=================================== FAILURES ===================================
______________________ AllPlatformTests.test_rust_clippy _______________________
[gw61] linux -- Python 3.10.8 /usr/bin/python3

self = <unittests.allplatformstests.AllPlatformTests testMethod=test_rust_clippy>

    @skip_if_not_language('rust')
    @unittest.skipIf(not shutil.which('clippy-driver'), 'Test requires clippy-driver')
    def test_rust_clippy(self) -> None:
        if self.backend is not Backend.ninja:
            raise unittest.SkipTest('Rust is only supported with ninja currently')
        # When clippy is used, we should get an exception since a variable named
        # "foo" is used, but is on our denylist
        testdir = os.path.join(self.rust_test_dir, '1 basic')
        self.init(testdir, extra_args=['--werror'], override_envvars={'RUSTC': 'clippy-driver'})
        with self.assertRaises(subprocess.CalledProcessError) as cm:
            self.build()
>       self.assertIn('error: use of a blacklisted/placeholder name `foo`', cm.exception.stdout)
E       AssertionError: 'error: use of a blacklisted/placeholder name `foo`' not found in 'ninja explain: deps for \'rust-program\' are missing\nninja explain: rust-program is dirty\nninja explain: deps for \'subdir/rust-program2\' are missing\nninja explain: subdir/rust-program2 is dirty\nninja explain: meson-test-prereq is dirty\nninja explain: output meson-benchmark-prereq of phony edge with no inputs doesn\'t exist\nninja explain: meson-benchmark-prereq is dirty\nninja explain: rust-program is dirty\nninja explain: subdir/rust-program2 is dirty\n[1/2] Compiling Rust source \'../test cases/rust/1 basic/prog.rs\'\nFAILED: rust-program \nclippy-driver -C linker=cc --color=always --crate-type bin -D warnings -g --crate-name rust_program --emit dep-info=rust-program.d --emit link -C lto -o rust-program \'../test cases/rust/1 basic/prog.rs\'\nerror: use of a disallowed/placeholder name `foo`\n --> ../test cases/rust/1 basic/prog.rs:2:9\n  |\n2 |     let foo = "rust compiler is working";\n  |         ^^^\n  |\n  = note: `-D clippy::disallowed-names` implied by `-D warnings`\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names\n\nerror: aborting due to previous error\n\n[2/2] Compiling Rust source \'../test cases/rust/1 basic/subdir/prog.rs\'\nninja: build stopped: subcommand failed.\n'

unittests/allplatformstests.py:4350: AssertionError
----------------------------- Captured stdout call -----------------------------
$ /usr/bin/python3 /build/meson/src/meson-0.64.0rc2/meson.py setup --backend=ninja '/build/meson/src/meson-0.64.0rc2/test cases/rust/1 basic' /build/meson/src/meson-0.64.0rc2/tmpe6s94o2v --prefix /usr --libdir lib --werror
stdout:
The Meson build system
Version: 0.64.0.rc2
Source dir: /build/meson/src/meson-0.64.0rc2/test cases/rust/1 basic
Build dir: /build/meson/src/meson-0.64.0rc2/tmpe6s94o2v
Build type: native build
Project name: rustprog
Project version: undefined
Rust compiler for the host machine: clippy-driver -C linker=cc (clippy-driver rustc 0.1.65)
Rust linker for the host machine: clippy-driver -C linker=cc ld.bfd 2.39.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 2

rustprog undefined

  User defined options
    backend: ninja
    libdir : lib
    prefix : /usr
    werror : True

Found ninja-1.11.1 at /usr/bin/ninja

$ /usr/bin/ninja -w dupbuild=err -d explain
stdout:
ninja explain: deps for 'rust-program' are missing
ninja explain: rust-program is dirty
ninja explain: deps for 'subdir/rust-program2' are missing
ninja explain: subdir/rust-program2 is dirty
ninja explain: meson-test-prereq is dirty
ninja explain: output meson-benchmark-prereq of phony edge with no inputs doesn't exist
ninja explain: meson-benchmark-prereq is dirty
ninja explain: rust-program is dirty
ninja explain: subdir/rust-program2 is dirty
[1/2] Compiling Rust source '../test cases/rust/1 basic/prog.rs'
FAILED: rust-program 
clippy-driver -C linker=cc --color=always --crate-type bin -D warnings -g --crate-name rust_program --emit dep-info=rust-program.d --emit link -C lto -o rust-program '../test cases/rust/1 basic/prog.rs'
error: use of a disallowed/placeholder name `foo`
 --> ../test cases/rust/1 basic/prog.rs:2:9
  |
2 |     let foo = "rust compiler is working";
  |         ^^^
  |
  = note: `-D clippy::disallowed-names` implied by `-D warnings`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names

error: aborting due to previous error

[2/2] Compiling Rust source '../test cases/rust/1 basic/subdir/prog.rs'
ninja: build stopped: subcommand failed.

=============================== warnings summary ===============================
run_unittests.py::AllPlatformTests::test_pkg_config_libdir
  /build/meson/src/meson-0.64.0rc2/unittests/allplatformstests.py:2543: EncodingWarning: 'encoding' argument not specified
    with tempfile.NamedTemporaryFile(mode='w', delete=False) as crossfile:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED run_unittests.py::AllPlatformTests::test_rust_clippy - AssertionError:...
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!
============= 1 failed, 65 passed, 17 skipped, 1 warning in 10.71s =============
Meson build system 0.64.0.rc2 Unit Tests
Total time: 11.012 seconds
@tristan957
Copy link
Contributor

Would you submit a PR :)? Thanks for finding it.

eli-schwartz pushed a commit that referenced this issue Nov 16, 2022
clippy changed output message
fix #11004
nirbheek pushed a commit that referenced this issue Nov 21, 2022
clippy changed output message
fix #11004
nirbheek pushed a commit that referenced this issue Nov 21, 2022
clippy changed output message
fix #11004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants