@@ -599,7 +599,7 @@ pub fn check(root: &Path, cargo: &Path, bless: bool, bad: &mut bool) {
599
599
. other_options ( vec ! [ "--locked" . to_owned( ) ] ) ;
600
600
let metadata = t ! ( cmd. exec( ) ) ;
601
601
602
- check_license_exceptions ( & metadata, exceptions, bad) ;
602
+ check_license_exceptions ( & metadata, workspace , exceptions, bad) ;
603
603
if let Some ( ( crates, permitted_deps) ) = permitted_deps {
604
604
check_permitted_dependencies ( & metadata, workspace, permitted_deps, crates, bad) ;
605
605
}
@@ -730,14 +730,19 @@ fn check_runtime_license_exceptions(metadata: &Metadata, bad: &mut bool) {
730
730
/// Check that all licenses of tool dependencies are in the valid list in `LICENSES`.
731
731
///
732
732
/// Packages listed in `exceptions` are allowed for tools.
733
- fn check_license_exceptions ( metadata : & Metadata , exceptions : & [ ( & str , & str ) ] , bad : & mut bool ) {
733
+ fn check_license_exceptions (
734
+ metadata : & Metadata ,
735
+ workspace : & str ,
736
+ exceptions : & [ ( & str , & str ) ] ,
737
+ bad : & mut bool ,
738
+ ) {
734
739
// Validate the EXCEPTIONS list hasn't changed.
735
740
for ( name, license) in exceptions {
736
741
// Check that the package actually exists.
737
742
if !metadata. packages . iter ( ) . any ( |p| * p. name == * name) {
738
743
tidy_error ! (
739
744
bad,
740
- "could not find exception package `{}`\n \
745
+ "could not find exception package `{}` in workspace `{workspace}` \n \
741
746
Remove from EXCEPTIONS list if it is no longer used.",
742
747
name
743
748
) ;
@@ -753,13 +758,15 @@ fn check_license_exceptions(metadata: &Metadata, exceptions: &[(&str, &str)], ba
753
758
}
754
759
tidy_error ! (
755
760
bad,
756
- "dependency exception `{}` does not declare a license expression" ,
761
+ "dependency exception `{}` in workspace `{workspace}` does not declare a license expression" ,
757
762
pkg. id
758
763
) ;
759
764
}
760
765
Some ( pkg_license) => {
761
766
if pkg_license. as_str ( ) != * license {
762
- println ! ( "dependency exception `{name}` license has changed" ) ;
767
+ println ! (
768
+ "dependency exception `{name}` license in workspace `{workspace}` has changed"
769
+ ) ;
763
770
println ! ( " previously `{license}` now `{pkg_license}`" ) ;
764
771
println ! ( " update EXCEPTIONS for the new license" ) ;
765
772
* bad = true ;
@@ -783,12 +790,21 @@ fn check_license_exceptions(metadata: &Metadata, exceptions: &[(&str, &str)], ba
783
790
let license = match & pkg. license {
784
791
Some ( license) => license,
785
792
None => {
786
- tidy_error ! ( bad, "dependency `{}` does not define a license expression" , pkg. id) ;
793
+ tidy_error ! (
794
+ bad,
795
+ "dependency `{}` in workspace `{workspace}` does not define a license expression" ,
796
+ pkg. id
797
+ ) ;
787
798
continue ;
788
799
}
789
800
} ;
790
801
if !LICENSES . contains ( & license. as_str ( ) ) {
791
- tidy_error ! ( bad, "invalid license `{}` in `{}`" , license, pkg. id) ;
802
+ tidy_error ! (
803
+ bad,
804
+ "invalid license `{}` for package `{}` in workspace `{workspace}`" ,
805
+ license,
806
+ pkg. id
807
+ ) ;
792
808
}
793
809
}
794
810
}
0 commit comments