Giter Site home page Giter Site logo

bsd-pidfile-rs's People

Contributors

andrewshadura avatar asomers avatar d1plo1d avatar mart-bogdan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

d1plo1d asomers

bsd-pidfile-rs's Issues

Get `undefined reference` when attempting to cross compile for the Raspberry Pi (armhf)

pidfile-rs is working great for me on x64 but now trying to cross-compile it to armhf I get the following error:

  = note: /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /home/d1plo1d/git_repos/teg/target/armv7-unknown-linux-gnueabihf/debug/deps/libpidfile_rs-aa73a5ed2abdce1e.rlib(pidfile_rs-aa73a5ed2abdce1e.pidfile_rs.c101mk4m-cgu.0.rcgu.o): in function `pidfile_rs::Pidfile::new':
          /home/d1plo1d/.cargo/registry/src/github.com-1ecc6299db9ec823/pidfile-rs-0.1.0/src/lib.rs:124: undefined reference to `pidfile_open'
          /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /home/d1plo1d/git_repos/teg/target/armv7-unknown-linux-gnueabihf/debug/deps/libpidfile_rs-aa73a5ed2abdce1e.rlib(pidfile_rs-aa73a5ed2abdce1e.pidfile_rs.c101mk4m-cgu.0.rcgu.o): in function `pidfile_rs::Pidfile::write':
          /home/d1plo1d/.cargo/registry/src/github.com-1ecc6299db9ec823/pidfile-rs-0.1.0/src/lib.rs:156: undefined reference to `pidfile_write'
          /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /home/d1plo1d/git_repos/teg/target/armv7-unknown-linux-gnueabihf/debug/deps/libpidfile_rs-aa73a5ed2abdce1e.rlib(pidfile_rs-aa73a5ed2abdce1e.pidfile_rs.c101mk4m-cgu.0.rcgu.o): in function `<pidfile_rs::Pidfile as core::ops::drop::Drop>::drop':
          /home/d1plo1d/.cargo/registry/src/github.com-1ecc6299db9ec823/pidfile-rs-0.1.0/src/lib.rs:183: undefined reference to `pidfile_remove'
          collect2: error: ld returned 1 exit status

I've installed the armhf version of libbsd-dev via sudo apt-get install libbsd-dev:armhf. Is there any thing else I should need to do to get pidfile-rs to find pidfile_remove?

pidfile-rs does not compile on FreeBSD 14.0-CURRENT

I'm experiencing the following problem when building inputplug, which depends on pidfile-rs:

     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=pidfile_rs CARGO_MANIFEST_DIR=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/inputplug-0.4.0/cargo-crates/pidfile-rs-0.1.0 CARGO_PKG_AUTHORS='Andrej Shadura <[email protected]>' CARGO_PKG_DESCRIPTION='Rust wrapper for pidfile_* functions from libbsd/libutil' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=pidfile-rs CARGO_PKG_REPOSITORY='https://github.com/andrewshadura/bsd-pidfile-rs' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/release/deps:/usr/local/lib' OUT_DIR=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/build/pidfile-rs-4a0c082080fb3980/out /usr/local/bin/rustc --crate-name pidfile_rs --edition=2018 /usr/home/0mp/f/freebsd-ports/x11/inputplug/work/inputplug-0.4.0/cargo-crates/pidfile-rs-0.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C embed-bitcode=no -C metadata=f8dda4b370c013ce -C extra-filename=-f8dda4b370c013ce --out-dir /usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/deps -L dependency=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/release/deps --extern libc=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/deps/liblibc-ffc6aeb0c2ffa66a.rmeta --extern log=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/deps/liblog-7bfef7ff243dec93.rmeta --extern thiserror=/usr/home/0mp/f/freebsd-ports/x11/inputplug/work/target/x86_64-unknown-freebsd/release/deps/libthiserror-9e73a75cc7ea590e.rmeta --cap-lints warn -C link-arg=-fstack-protector-strong`
error[E0308]: mismatched types
   --> /usr/home/0mp/f/freebsd-ports/x11/inputplug/work/inputplug-0.4.0/cargo-crates/pidfile-rs-0.1.0/src/lib.rs:124:55
    |
124 |                     bsd_pidfile_open(c_path.as_ptr(), permissions.mode(), &mut old_pid)
    |                                                       ^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
    |
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
    |
124 |                     bsd_pidfile_open(c_path.as_ptr(), permissions.mode().try_into().unwrap(), &mut old_pid)
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `pidfile-rs`

Could it be that pidfile-rs is using a wrong type here?

Please let me know if I can provide any debugging information.

I'm running this on FreeBSD 14.0-CURRENT on adm64 hardware. Rust version: rustc 1.55.0-nightly (32c9b7b09 2021-07-21).

Needs CI

This project could benefit from some CI testing. For testing on both FreeBSD and Linux, the easiest platform to use is Cirrus. If you agree, then follow the instructions at https://cirrus-ci.org/guide/quick-start/ but stop when you get to "Post-Installation" and I'll submit a config file.

Installing libutil after failing a cargo build results in missing headers

Observed Behaviour

On Ubuntu 20.04 installing sudo apt install libutil-freebsd-dev after trying to run cargo build resulted in a long error containing the following:

ld.lld: error: undefined symbol: pidfile_open

My guess is that the cargo build process was not failing early enough so it thought that pidfile-rs was successfully installed despite the missing header files (libutil was not installed on the first cargo build).

Expected Behaviour

It would be helpful if this could fail earlier in the build process so that cargo doesn't assume a successful build of pidfile-rs when libutil is missing.

Work Arounds

If anyone else encounters this issue the solution is to install libutil-freebsd-dev and then run cargo clean -p pidfile-rs. After that your builds should succeed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.