Skip to content

Comments

libpcap: move dev things to extra output#170415

Merged
SuperSandro2000 merged 1 commit intoNixOS:stagingfrom
SuperSandro2000:libpcap
May 5, 2022
Merged

libpcap: move dev things to extra output#170415
SuperSandro2000 merged 1 commit intoNixOS:stagingfrom
SuperSandro2000:libpcap

Conversation

@SuperSandro2000
Copy link
Member

Description of changes

@jtojnar I wanted to move things to dev output but that causes a reference loop between bin/pcap-config and the other dev things. Should I move the script to dev, too or leave it like it is?

$ tree result*
 result
├──  bin
│   └──  pcap-config
├──  include
│   ├──  pcap
│   │   ├──  bluetooth.h
│   │   ├──  bpf.h
│   │   ├──  can_socketcan.h
│   │   ├──  compiler-tests.h
│   │   ├──  dlt.h
│   │   ├──  funcattrs.h
│   │   ├──  ipnet.h
│   │   ├──  namedb.h
│   │   ├──  nflog.h
│   │   ├──  pcap-inttypes.h
│   │   ├──  pcap.h
│   │   ├──  sll.h
│   │   ├──  socket.h
│   │   ├──  usb.h
│   │   └──  vlan.h
│   ├──  pcap-bpf.h
│   ├──  pcap-namedb.h
│   └──  pcap.h
├──  lib
│   └──  pkgconfig
│       └──  libpcap.pc
├──  nix-support
│   └──  propagated-build-inputs
└──  share
    └──  man
        ├──  man1
        │   └──  pcap-config.1.gz
        ├──  man3
        │   ├──  pcap.3pcap.gz
        │   ├──  pcap_activate.3pcap.gz
        │   ├──  pcap_breakloop.3pcap.gz
        │   ├──  pcap_can_set_rfmon.3pcap.gz
        │   ├──  pcap_close.3pcap.gz
        │   ├──  pcap_compile.3pcap.gz
        │   ├──  pcap_create.3pcap.gz
        │   ├──  pcap_datalink.3pcap.gz
        │   ├──  pcap_datalink_name_to_val.3pcap.gz
        │   ├──  pcap_datalink_val_to_description.3pcap.gz
        │   ├──  pcap_datalink_val_to_description_or_dlt.3pcap.gz
        │   ├──  pcap_datalink_val_to_name.3pcap.gz
        │   ├──  pcap_dispatch.3pcap.gz
        │   ├──  pcap_dump.3pcap.gz
        │   ├──  pcap_dump_close.3pcap.gz
        │   ├──  pcap_dump_file.3pcap.gz
        │   ├──  pcap_dump_flush.3pcap.gz
        │   ├──  pcap_dump_fopen.3pcap.gz
        │   ├──  pcap_dump_ftell.3pcap.gz
        │   ├──  pcap_dump_open.3pcap.gz
        │   ├──  pcap_file.3pcap.gz
        │   ├──  pcap_fileno.3pcap.gz
        │   ├──  pcap_findalldevs.3pcap.gz
        │   ├──  pcap_fopen_offline.3pcap.gz
        │   ├──  pcap_fopen_offline_with_tstamp_precision.3pcap.gz
        │   ├──  pcap_free_datalinks.3pcap.gz
        │   ├──  pcap_free_tstamp_types.3pcap.gz
        │   ├──  pcap_freealldevs.3pcap.gz
        │   ├──  pcap_freecode.3pcap.gz
        │   ├──  pcap_get_required_select_timeout.3pcap.gz
        │   ├──  pcap_get_selectable_fd.3pcap.gz
        │   ├──  pcap_get_tstamp_precision.3pcap.gz
        │   ├──  pcap_geterr.3pcap.gz
        │   ├──  pcap_getnonblock.3pcap.gz
        │   ├──  pcap_init.3pcap.gz
        │   ├──  pcap_inject.3pcap.gz
        │   ├──  pcap_is_swapped.3pcap.gz
        │   ├──  pcap_lib_version.3pcap.gz
        │   ├──  pcap_list_datalinks.3pcap.gz
        │   ├──  pcap_list_tstamp_types.3pcap.gz
        │   ├──  pcap_lookupdev.3pcap.gz
        │   ├──  pcap_lookupnet.3pcap.gz
        │   ├──  pcap_loop.3pcap.gz
        │   ├──  pcap_major_version.3pcap.gz
        │   ├──  pcap_minor_version.3pcap.gz
        │   ├──  pcap_next.3pcap.gz
        │   ├──  pcap_next_ex.3pcap.gz
        │   ├──  pcap_offline_filter.3pcap.gz
        │   ├──  pcap_open_dead.3pcap.gz
        │   ├──  pcap_open_dead_with_tstamp_precision.3pcap.gz
        │   ├──  pcap_open_live.3pcap.gz
        │   ├──  pcap_open_offline.3pcap.gz
        │   ├──  pcap_open_offline_with_tstamp_precision.3pcap.gz
        │   ├──  pcap_perror.3pcap.gz
        │   ├──  pcap_sendpacket.3pcap.gz
        │   ├──  pcap_set_buffer_size.3pcap.gz
        │   ├──  pcap_set_datalink.3pcap.gz
        │   ├──  pcap_set_immediate_mode.3pcap.gz
        │   ├──  pcap_set_promisc.3pcap.gz
        │   ├──  pcap_set_protocol_linux.3pcap.gz
        │   ├──  pcap_set_rfmon.3pcap.gz
        │   ├──  pcap_set_snaplen.3pcap.gz
        │   ├──  pcap_set_timeout.3pcap.gz
        │   ├──  pcap_set_tstamp_precision.3pcap.gz
        │   ├──  pcap_set_tstamp_type.3pcap.gz
        │   ├──  pcap_setdirection.3pcap.gz
        │   ├──  pcap_setfilter.3pcap.gz
        │   ├──  pcap_setnonblock.3pcap.gz
        │   ├──  pcap_snapshot.3pcap.gz
        │   ├──  pcap_stats.3pcap.gz
        │   ├──  pcap_statustostr.3pcap.gz
        │   ├──  pcap_strerror.3pcap.gz
        │   ├──  pcap_tstamp_type_name_to_val.3pcap.gz
        │   ├──  pcap_tstamp_type_val_to_description.3pcap.gz
        │   └──  pcap_tstamp_type_val_to_name.3pcap.gz
        ├──  man5
        │   └──  pcap-savefile.5.gz
        └──  man7
            ├──  pcap-filter.7.gz
            ├──  pcap-linktype.7.gz
            └──  pcap-tstamp.7.gz
 result-lib
└──  lib
    ├──  libpcap.a
    ├──  libpcap.so
    ├──  libpcap.so.1
    └──  libpcap.so.1.10.1
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@SuperSandro2000 SuperSandro2000 requested a review from jtojnar April 26, 2022 12:50
@ofborg ofborg bot requested a review from fpletz April 26, 2022 13:06
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 26, 2022
@jtojnar
Copy link
Member

jtojnar commented Apr 26, 2022

pcap-config is a config tool script (basically a self-contained pkg-config predecessor) so it definitely belongs to dev output. Just make sure it still contains the right paths after the move.

@SuperSandro2000
Copy link
Member Author

Done

@SuperSandro2000 SuperSandro2000 changed the base branch from master to staging April 27, 2022 14:31
Copy link
Member

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pcap-config output seems to still be correct.

@SuperSandro2000 SuperSandro2000 merged commit 19d7d64 into NixOS:staging May 5, 2022
@SuperSandro2000 SuperSandro2000 deleted the libpcap branch May 5, 2022 23:13
@SuperSandro2000
Copy link
Member Author

I am looking into that.

@SuperSandro2000
Copy link
Member Author

I don't think libpcap has proper support for multiple outputs and instead of patching every user I am going to revert this PR.

@jtojnar
Copy link
Member

jtojnar commented May 16, 2022

That is weird, both the pcap-config and the pkg-config file actually seem to print correct values, so that sounds like the consumers are at fault. But reverting for now is probably the easiest approach.

@jtojnar
Copy link
Member

jtojnar commented May 16, 2022

Yeah, e.g. in pmacct, we are explicitly setting incorrect header directory:

"--with-pcap-includes=${libpcap}/include"

Even though the project should be able to find it automatically:

https://github.com/pmacct/pmacct/blob/6001e57ed316b9e0a441b724df0e22c64649c78f/configure.ac#L246

@SuperSandro2000
Copy link
Member Author

tcpreplay assumes that the header files and libs are relative to each other https://github.com/appneta/tcpreplay/blob/master/configure.ac#L650-L677=

I don't really want to patch every user of libpcap or do I have the time right now.

@jtojnar
Copy link
Member

jtojnar commented May 16, 2022

Even that should support pcap-config: https://github.com/appneta/tcpreplay/blob/09f07748dcabe3d58961f123f31dd0f75198a389/configure.ac?rgh-link-date=2022-05-16T19%3A48%3A02Z#L500-L501

It does not look like the packages are especially critical so we could leave them for ZHF or their maintainers to fix them.

@vcunat
Copy link
Member

vcunat commented May 16, 2022

It's not visible here, but I merged the revert PR #173297 in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants