Re: [ovs-dev] [PATCH] travis: Fix checks skipping by sparse.

2019-04-25 Thread Ilya Maximets
On 24.04.2019 23:40, Yi-Hung Wei wrote:
> On Wed, Apr 24, 2019 at 6:00 AM Ilya Maximets  wrote:
>>
>> Recent commit in "sparse" broke checking the OVS sources, because
>> 'make' uses '-MD' flag to generate dependencies as a side effect
>> within compilation commands, but "sparse" skips all the build commands
>> that contains '-MD' and friends.
>> Let's revert the bad commit as a workaround before installing "sparse"
>> in TravisCI.
>>
>> Additionally fixed a false-positive:
>> ./lib/bitmap.h:64:29: error: shift too big (64) for type unsigned long
>>
>> CC: Yi-Hung Wei 
>> Fixes: 879e8238dfdf ("travis: Update sparse git repo")
>> Signed-off-by: Ilya Maximets 
>> ---
>>  .travis/linux-prepare.sh | 9 -
>>  lib/bitmap.h | 2 +-
>>  2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
>> index 50189c421..d41799e3e 100755
>> --- a/.travis/linux-prepare.sh
>> +++ b/.travis/linux-prepare.sh
>> @@ -8,7 +8,14 @@ set -ev
>>  # environments claim to have LLVM (llvm-config exists and works) but
>>  # linking against it fails.
>>  git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
>> -cd sparse && make -j4 HAVE_LLVM= install && cd ..
>> +cd sparse
>> +# Commit bb1bf748580d ("cgcc: gendeps for -MM, -MD & -MMD too") makes
>> +# sparse ignore almost all source files, because 'make' uses '-MD' to
>> +# generate dependencies as a side effect within compilation commands.
>> +git revert bb1bf748580d --no-commit
>> +git diff HEAD
>> +make -j4 HAVE_LLVM= install
>> +cd ..
>>
>>  pip install --disable-pip-version-check --user six flake8 hacking
>>  pip install --user --upgrade docutils
>> diff --git a/lib/bitmap.h b/lib/bitmap.h
>> index eb469339e..0b62066c6 100644
> Hi Ilya,
> 
> Thanks for figuring out the issue.  Instead of reverting that faulty
> commit, how about let's use the latest release of sparse?  In this
> way, we do not need to worry too much about the latest spare
> development, and we will use the next sparse release when we have
> tested it.
> 
> That faulty commit is in spare v0.6.1-rc1 and afterwards.  So, maybe
> we can checkout v0.6.0 tag and use it for Jarvis? How do you think?
> 

Hi.
I thought about this before sending the patch. The concern I have is that
"sparse" is not that actively developed project without specified release
process. It could take years for them to release a new minor version.
At the same time development is contiguous. i.e. we could get a big
number of new patches in "sparse" without even a minor release version change.
For example, between v0.5.0 and v0.5.1 passed 3.5 years with ~400 commits.
In general, I hope that issue will be fixed in a near future and we'll
be able to just drop this workaround.

Best regards, Ilya Maximets.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] travis: Fix checks skipping by sparse.

2019-04-24 Thread Yi-Hung Wei
On Wed, Apr 24, 2019 at 6:00 AM Ilya Maximets  wrote:
>
> Recent commit in "sparse" broke checking the OVS sources, because
> 'make' uses '-MD' flag to generate dependencies as a side effect
> within compilation commands, but "sparse" skips all the build commands
> that contains '-MD' and friends.
> Let's revert the bad commit as a workaround before installing "sparse"
> in TravisCI.
>
> Additionally fixed a false-positive:
> ./lib/bitmap.h:64:29: error: shift too big (64) for type unsigned long
>
> CC: Yi-Hung Wei 
> Fixes: 879e8238dfdf ("travis: Update sparse git repo")
> Signed-off-by: Ilya Maximets 
> ---
>  .travis/linux-prepare.sh | 9 -
>  lib/bitmap.h | 2 +-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
> index 50189c421..d41799e3e 100755
> --- a/.travis/linux-prepare.sh
> +++ b/.travis/linux-prepare.sh
> @@ -8,7 +8,14 @@ set -ev
>  # environments claim to have LLVM (llvm-config exists and works) but
>  # linking against it fails.
>  git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
> -cd sparse && make -j4 HAVE_LLVM= install && cd ..
> +cd sparse
> +# Commit bb1bf748580d ("cgcc: gendeps for -MM, -MD & -MMD too") makes
> +# sparse ignore almost all source files, because 'make' uses '-MD' to
> +# generate dependencies as a side effect within compilation commands.
> +git revert bb1bf748580d --no-commit
> +git diff HEAD
> +make -j4 HAVE_LLVM= install
> +cd ..
>
>  pip install --disable-pip-version-check --user six flake8 hacking
>  pip install --user --upgrade docutils
> diff --git a/lib/bitmap.h b/lib/bitmap.h
> index eb469339e..0b62066c6 100644
Hi Ilya,

Thanks for figuring out the issue.  Instead of reverting that faulty
commit, how about let's use the latest release of sparse?  In this
way, we do not need to worry too much about the latest spare
development, and we will use the next sparse release when we have
tested it.

That faulty commit is in spare v0.6.1-rc1 and afterwards.  So, maybe
we can checkout v0.6.0 tag and use it for Jarvis? How do you think?

Thanks,

-Yi-Hung
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] travis: Fix checks skipping by sparse.

2019-04-24 Thread Ben Pfaff
On Wed, Apr 24, 2019 at 04:00:22PM +0300, Ilya Maximets wrote:
> Recent commit in "sparse" broke checking the OVS sources, because
> 'make' uses '-MD' flag to generate dependencies as a side effect
> within compilation commands, but "sparse" skips all the build commands
> that contains '-MD' and friends.
> Let's revert the bad commit as a workaround before installing "sparse"
> in TravisCI.
> 
> Additionally fixed a false-positive:
> ./lib/bitmap.h:64:29: error: shift too big (64) for type unsigned long
> 
> CC: Yi-Hung Wei 
> Fixes: 879e8238dfdf ("travis: Update sparse git repo")
> Signed-off-by: Ilya Maximets 

Thanks.

If upstream sparse doesn't fix this in a reasonable amount of time, then
we should probably add a note to the installation guide mentioning this
fix, so that developers know to take advantage of it too.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] travis: Fix checks skipping by sparse.

2019-04-24 Thread Ilya Maximets
Recent commit in "sparse" broke checking the OVS sources, because
'make' uses '-MD' flag to generate dependencies as a side effect
within compilation commands, but "sparse" skips all the build commands
that contains '-MD' and friends.
Let's revert the bad commit as a workaround before installing "sparse"
in TravisCI.

Additionally fixed a false-positive:
./lib/bitmap.h:64:29: error: shift too big (64) for type unsigned long

CC: Yi-Hung Wei 
Fixes: 879e8238dfdf ("travis: Update sparse git repo")
Signed-off-by: Ilya Maximets 
---
 .travis/linux-prepare.sh | 9 -
 lib/bitmap.h | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
index 50189c421..d41799e3e 100755
--- a/.travis/linux-prepare.sh
+++ b/.travis/linux-prepare.sh
@@ -8,7 +8,14 @@ set -ev
 # environments claim to have LLVM (llvm-config exists and works) but
 # linking against it fails.
 git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
-cd sparse && make -j4 HAVE_LLVM= install && cd ..
+cd sparse
+# Commit bb1bf748580d ("cgcc: gendeps for -MM, -MD & -MMD too") makes
+# sparse ignore almost all source files, because 'make' uses '-MD' to
+# generate dependencies as a side effect within compilation commands.
+git revert bb1bf748580d --no-commit
+git diff HEAD
+make -j4 HAVE_LLVM= install
+cd ..
 
 pip install --disable-pip-version-check --user six flake8 hacking
 pip install --user --upgrade docutils
diff --git a/lib/bitmap.h b/lib/bitmap.h
index eb469339e..0b62066c6 100644
--- a/lib/bitmap.h
+++ b/lib/bitmap.h
@@ -61,7 +61,7 @@ bitmap_init1(unsigned long *bitmap, size_t n_bits)
 
 memset(bitmap, 0xff, n_bytes);
 if (r_bits) {
-bitmap[n_longs - 1] >>= BITMAP_ULONG_BITS - r_bits;
+bitmap[n_longs - 1] = (1UL << r_bits) - 1;
 }
 return bitmap;
 }
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev