Patch "kbuild: rust_is_available: normalize version matching" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kbuild: rust_is_available: normalize version matching

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kbuild-rust_is_available-normalize-version-matching.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 742a0a6e0934029a04ef02bfa0652313321fba70
Author: Miguel Ojeda <ojeda@xxxxxxxxxx>
Date:   Fri Jun 16 02:16:28 2023 +0200

    kbuild: rust_is_available: normalize version matching
    
    [ Upstream commit 7cd6a3e1f94bab4f2a3425e06f70ab13eb8190d4 ]
    
    In order to match the version string, `sed` is used in a couple
    cases, and `grep` and `head` in a couple others.
    
    Make the script more consistent and easier to understand by
    using the same method, `sed`, for all of them.
    
    This makes the version matching also a bit more strict for
    the changed cases, since the strings `rustc ` and `bindgen `
    will now be required, which should be fine since `rustc`
    complains if one attempts to call it with another program
    name, and `bindgen` uses a hardcoded string.
    
    In addition, clarify why one of the existing `sed` commands
    does not provide an address like the others.
    
    Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Reviewed-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
    Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230616001631.463536-9-ojeda@xxxxxxxxxx
    Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
    Stable-dep-of: 5ce86c6c8613 ("rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
index 7a925d2b20fc7..db4519945f534 100755
--- a/scripts/rust_is_available.sh
+++ b/scripts/rust_is_available.sh
@@ -40,8 +40,7 @@ fi
 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
 rust_compiler_version=$( \
 	LC_ALL=C "$RUSTC" --version 2>/dev/null \
-		| head -n 1 \
-		| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
+		| sed -nE '1s:.*rustc ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
 )
 rust_compiler_min_version=$($min_tool_version rustc)
 rust_compiler_cversion=$(get_canonical_version $rust_compiler_version)
@@ -67,8 +66,7 @@ fi
 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
 rust_bindings_generator_version=$( \
 	LC_ALL=C "$BINDGEN" --version 2>/dev/null \
-		| head -n 1 \
-		| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
+		| sed -nE '1s:.*bindgen ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
 )
 rust_bindings_generator_min_version=$($min_tool_version bindgen)
 rust_bindings_generator_cversion=$(get_canonical_version $rust_bindings_generator_version)
@@ -110,6 +108,9 @@ fi
 
 # `bindgen` returned successfully, thus use the output to check that the version
 # of the `libclang` found by the Rust bindings generator is suitable.
+#
+# Unlike other version checks, note that this one does not necessarily appear
+# in the first line of the output, thus no `sed` address is provided.
 bindgen_libclang_version=$( \
 	echo "$bindgen_libclang_output" \
 		| sed -nE 's:.*clang version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux