On Thu, Jul 27, 2023 at 05:45 AM, Randy MacLeod wrote:

> 
> I don't see this in master or master-next yet so see comments below and
> send a slightly updated v2.
> 
> On 2023-07-26 12:25, Yash Shinde wrote:
> 
>> Failed test cases are added to exclude list.
>> Drop
>> meta/recipes-devtools/rust/files/rust-oe-selftest.patch file.
>> 
>> Signed-off-by: Yash Shinde <[email protected]> (
>> [email protected] )
>> ---
>>  meta/lib/oeqa/selftest/cases/rust.py     
>> |  209 +-
>>  .../rust/files/rust-oe-selftest.patch         | 2324
>> -----------------
>>  meta/recipes-devtools/rust/rust-source.inc    |    1 -
>> 
>> 3 files changed, 208 insertions(+), 2326 deletions(-)
>>  delete mode 100644
>> meta/recipes-devtools/rust/files/rust-oe-selftest.patch
> 
> 
> 
> It's good to see the large patch be replaced with a 10x smaller rust.py
> change.
> 
> 
> 
> If this change is acceptable to others, I'd like the commit log to be
> amended to explain
> how to (automatically?) update the exclude list when rust is updated.
> Alternatively
> we could add that to meta/recipes-devtools/rust/README-rust.md
> https://github.com/yoctoproject/poky/blob/master/meta/recipes-devtools/rust/README-rust.md
> 
> 
> 
> 
> Is this a manual process now? Could it be mostly automated?
> 
> 
> 
> Please sort the exclude list alphabetically in v2 so that it's
> easier for people to see what tests are being excluded (see below (*))
> 
> 
> 
> I assume that this commit doesn't change the tests that are run but only
> moves the skipping from being a patch to the exclude list. Please confirm
> and in your v2 commit log, mention that as well as what the current number
> of
> passed and skipped tests.
> 
> 

When updating to a newer version of Rust, it is manually needed to update the 
exclude_list. The tests that fail are observed to work on some versions and 
fail on others.
I have updated the commit log in v2 and also mentioned the testing numbers for 
passed and skipped cases here, 
https://lists.openembedded.org/g/openembedded-core/message/184926

> 
> 
>> diff --git a/meta/lib/oeqa/selftest/cases/rust.py
>> b/meta/lib/oeqa/selftest/cases/rust.py
>> index 7a0fd7033d..abd3ef8314 100644
>> --- a/meta/lib/oeqa/selftest/cases/rust.py
>> +++
>> b/meta/lib/oeqa/selftest/cases/rust.py
>> @@ -70,7 +70,214 @@ class
>> RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>>    
>> # no-fail-fast: Run all tests regardless of failure.
>>              # bless:
>> First runs rustfmt to format the codebase,
>>              # then runs tidy
>> checks.
>> -            testargs = "--exclude tests/rustdoc --exclude
>> src/tools/rust-analyzer  --exclude tests/rustdoc-json  --exclude
>> tests/run-make-fulldeps --exclude src/tools/tidy --exclude
>> src/tools/rustdoc-themes --exclude src/rustdoc-json-types --exclude
>> src/librustdoc --exclude src/doc/unstable-book --exclude src/doc/rustdoc
>> --exclude src/doc/rustc --exclude compiler/rustc --exclude
>> library/panic_abort --exclude library/panic_unwind --exclude
>> src/tools/lint-docs  --exclude tests/rustdoc-js-std --doc --no-fail-fast
>> --bless"
> 
> 
> 
> I think you're doing two things in the 2 lines above and the list below:
> 
> 
> 
> 1. splitting up the testargs into one per line
> 
> 
> 
> 2. adding an exclude list of tests that are know to fail.
> 
> 
> 
> Is that true?
> If so can you use two seperate variables/lists to reflect the different
> intended purpose of each list?
> This should also help in maintaining each list and hopefully the tests
> that are exluded will all have a:
> 
> 
> 
> tests/foo/bar.rs
> 
> 
> 
> format rather than somewhat worrying prefixes like:
> compiler/rustc
> 
> 
> 
> and
> 
> 
> 
> library/panic_abort
> 
> 

The 'compiler/rustc', 'library/panic_abort' and similar other dir paths are the 
part of test exclude_list since they fail during rust build. Actually, the 
'testargs' directly contained the excluded failing test dirs in previous patch 
versions. Thus, added exclude_list as  a separate list for failing test cases 
and dirs which is then added to testargs with other args like '--doc 
--no-fail-fast --bless'.

> 
> 
>> +            exclude_list = """  --exclude tests/run-make
> 
> If python will let you, please split this line like this:
> +            exclude_list = """ 
> +                                
> --exclude tests/run-make
> 
> to separate the variables from the list name to
> make future updates a bit easier.
> 
>> +                                --exclude
>> tests/run-make/pgo-branch-weights/
>> +                               
>> --exclude tests/ui/macros/restricted-shadowing-legacy.rs
>> +                
>> --exclude tests/ui-fulldeps/issue-14021.rs
>> 
>> 
>> 
> 
> 
> 
> ><snip>< -- the middle bits of the long unsorted list.
> 
> 
> 
> 
> 
> 
>> +                                --exclude library/panic_unwind
>> +         
>> --exclude src/tools/lint-docs
>> +                                --exclude
>> tests/rustdoc-js-std"""
> 
> 
> 
> Similarly, if python will let you, put the terminating triple quote on a
> new line with proper identation of course.
> 
> 
> 
> These last two comments are "nice-to-have" so just call me a python newbie
> if that's not possible or is not pythonic!
> 
> 

Modified the patch in v2 accordingly along with alphabetically sorted 
exclude_list.

> 
> 
>> +
>> +            exclude_fail_tests = exclude_list.split("\n")
>> +           
>> exclude_fail_tests = " ".join(exclude_fail_tests)
>> +
>> +            # Add
>> exclude_fail_tests with other test arguments
>> +            testargs = 
>> exclude_fail_tests + " --doc --no-fail-fast --bless"
>>  
>>              # Set
>> path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools.
>>           
>> cmd = " export PATH=%s/recipe-sysroot-native/usr/bin:$PATH;" % rustlibpath
>> diff --git a/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
>> b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
>> 
> 
> 
> 
> 
> ><snip><  -- giant 10x bigger than it needs to be patch
> 
> 
> 
> 
> 
> 
>> -diff --git a/tests/run-make/pointer-auth-link-with-c/Makefile
>> b/tests/run-make/pointer-auth-link-with-c/Makefile
>> -index
>> dffbd303582..5347d0a90f1 100644
>> ----
>> a/tests/run-make/pointer-auth-link-with-c/Makefile
>> -+++
>> b/tests/run-make/pointer-auth-link-with-c/Makefile
>> -@@ -1,3 +1,4 @@
>> -+#
>> ignore-stage1
>> - include ../tools.mk
>> - 
>> - # only-aarch64
>> diff --git
>> a/meta/recipes-devtools/rust/rust-source.inc
>> b/meta/recipes-devtools/rust/rust-source.inc
>> index 8b9199e9ab..4a720e645b
>> 100644
>> --- a/meta/recipes-devtools/rust/rust-source.inc
>> +++
>> b/meta/recipes-devtools/rust/rust-source.inc
>> @@ -6,7 +6,6 @@ SRC_URI += 
>> "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
>> file://0001-Do-not-use-LFS64-on-linux-with-musl.patch;patchdir=${RUSTSRC}
>> \
>>              file://zlib-off64_t.patch;patchdir=${RUSTSRC} \
>>            
>> file://0001-musl-Define-SOCK_SEQPACKET-in-common-place.patch;patchdir=${RUSTSRC}
>> \
>> -            file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \
>>        
>> file://bootstrap_fail.patch;patchdir=${RUSTSRC} \
>>  " (
>> https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;nfile://0001-Do-not-use-LFS64-on-linux-with-musl.patch;patchdir=${RUSTSRC}\file://zlib-off64_t.patch;patchdir=${RUSTSRC}\file://0001-musl-Define-SOCK_SEQPACKET-in-common-place.patch;patchdir=${RUSTSRC}\-file://rust-oe-selftest.patch;patchdir=${RUSTSRC}\file://bootstrap_fail.patch;patchdir=${RUSTSRC}\
>> )
>>  SRC_URI[rust.sha256sum] =
>> "bb8e9c564566b2d3228d95de9063a9254182446a161353f1d843bfbaf5c34639"
>> 
> 
> 
> 
> *
> The sorted list so people (mostly me!) can see what is being skipped.
> I'm tempted to ask about some of the exclusions but I'll leave that for
> another time.
> 
> 
> 
> 
> +                                --exclude compiler/rustc
> ><snip>< -- the middle bits of the long unsorted list.
> 
> 
> 
> 
> +                                --exclude
> tests/ui/simd/target-feature-mixup.rs
> +                                --exclude
> tests/ui/structs-enums/multiple-reprs.rs
> 
> 
> 
> Better, eh?
> 
> 
> 
> Thanks for the quick turn-around on this nice change!
> 
> -- 
> # Randy MacLeod
> # Wind River Linux
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184931): 
https://lists.openembedded.org/g/openembedded-core/message/184931
Mute This Topic: https://lists.openembedded.org/mt/100374212/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to