NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.65k stars 13.8k forks source link

bladerf fails to build #108585

Closed eduardosm closed 3 years ago

eduardosm commented 3 years ago

Describe the bug

libbladeRF fails to build on the nixos-unstable channel and latest master:

/build/source/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c: In function 'bladerf1_open':
/build/source/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c:841:38: error: implicit conversion from 'enum <anonymous>' to 'enum <anonymous>' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wenum-conversion-Werror=enum-conversion8;;]
  841 |     dev->flash_arch->status          = STATE_UNINITIALIZED;
      |                                      ^

Notify maintainers

@Mic92 @pSub

Mic92 commented 3 years ago

Cannot reproduce this in master. I am on fb44e40f2a90d91081c0f437f667d6674d04fdbb. Was this fixed in 0a65d1c52d8c828e783b647d7c47b16cc7a0c7e6 ?

eduardosm commented 3 years ago

I have just tried on dfd01824, here is a full log: build-log.txt

iblech commented 3 years ago

Can also confirm that the build fails on 44c443a7a602e7752641aac21e4ad17061761290.

iblech commented 3 years ago

This appears to me a genuine error in the source. Live bladerf1.c:841 (and also bladerf2.c:283) reference STATE_UNINITIALIZED, but it should be STATUS_UNINITIALIZED. With -Werror, we stop the build on purpose. Luckily the typo is not of further consequence, since both values are numerically the same (both zero). I will try to report this to upstream.

iblech commented 3 years ago

Oh nice, this has already been fixed in upstream master (in 163425d48a3b7d8c100d7295220d3648c050d0dd from last May to be precise), but there isn't yet a new release containing a fix. I'll prepare a pull request cherrypicking this patch. Be aware though that I cannot test libbladeRF (in fact I don't even know what it is about :-)).

Mic92 commented 3 years ago

@iblech, maybe also add NIX_CFLAGS_COMPILE = [ "-Wno-error" ];. This options is meant for development where there is control over the compiler, but in nixpkgs we want to update gcc without breaking half the packages due to warnings.

iblech commented 3 years ago

I see, thank you for the suggestion! Generally I'm in favor of -Werror, but your argument is quite reasonable. I'll force-push in a second.