{"id":24905146,"url":"https://github.com/robo9k/rust-magic-sys","last_synced_at":"2026-04-01T22:32:58.242Z","repository":{"id":24886085,"uuid":"28302170","full_name":"robo9k/rust-magic-sys","owner":"robo9k","description":"Rust declarations crate for the `libmagic` C library","archived":false,"fork":false,"pushed_at":"2026-03-22T00:34:55.000Z","size":226,"stargazers_count":11,"open_issues_count":24,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-22T11:32:41.628Z","etag":null,"topics":["file","libmagic","magic","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robo9k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-12-21T14:31:00.000Z","updated_at":"2026-03-22T00:27:29.000Z","dependencies_parsed_at":"2025-03-17T16:10:47.169Z","dependency_job_id":"fb5cd7bb-c1d2-418a-b1e0-cc306e051335","html_url":"https://github.com/robo9k/rust-magic-sys","commit_stats":{"total_commits":86,"total_committers":3,"mean_commits":"28.666666666666668","dds":"0.37209302325581395","last_synced_commit":"505c30d5c3552bef9c74ed6bc521436a7703e219"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/robo9k/rust-magic-sys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robo9k%2Frust-magic-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robo9k%2Frust-magic-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robo9k%2Frust-magic-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robo9k%2Frust-magic-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robo9k","download_url":"https://codeload.github.com/robo9k/rust-magic-sys/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robo9k%2Frust-magic-sys/sbom","scorecard":{"id":589336,"data":{"date":"2025-08-11","repo":{"name":"github.com/robo9k/rust-magic-sys","commit":"2ab291d4599fe8e458a53f88e7998ca75d3ab38c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.8,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  21 out of  21 GitHub-owned GitHubAction dependencies pinned","Info:  46 out of  46 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build.yml:26","Info: jobLevel 'contents' permission set to 'read': .github/workflows/build.yml:76","Info: jobLevel 'contents' permission set to 'read': .github/workflows/conventional-commits.yml:12","Info: jobLevel 'contents' permission set to 'read': .github/workflows/deny.yml:26","Info: jobLevel 'contents' permission set to 'read': .github/workflows/docs.yml:26","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint.yml:15","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint.yml:37","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint.yml:61","Info: jobLevel 'contents' permission set to 'read': .github/workflows/minver.yml:19","Info: jobLevel 'contents' permission set to 'read': .github/workflows/msrv.yml:19","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test-libmagic-version.yml:13","Warn: jobLevel 'security-events' permission set to 'write': .github/workflows/zizmor.yml:14","Info: found token with 'none' permissions: .github/workflows/build.yml:1","Info: found token with 'none' permissions: .github/workflows/conventional-commits.yml:1","Info: found token with 'none' permissions: .github/workflows/deny.yml:1","Info: found token with 'none' permissions: .github/workflows/docs.yml:1","Info: found token with 'none' permissions: .github/workflows/lint.yml:1","Info: found token with 'none' permissions: .github/workflows/minver.yml:1","Info: found token with 'none' permissions: .github/workflows/msrv.yml:1","Info: found token with 'none' permissions: .github/workflows/release-plz.yml:1","Info: found token with 'none' permissions: .github/workflows/test-libmagic-version.yml:1","Info: found token with 'none' permissions: .github/workflows/zizmor.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: branch 'main' does not require approvers","Warn: codeowners review is not required on branch 'main'","Info: status check found to merge onto on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2018-0015"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T21:25:55.782Z","repository_id":24886085,"created_at":"2025-08-20T21:25:55.782Z","updated_at":"2025-08-20T21:25:55.782Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file","libmagic","magic","rust"],"created_at":"2025-02-01T23:46:51.497Z","updated_at":"2026-04-01T22:32:58.233Z","avatar_url":"https://github.com/robo9k.png","language":"Rust","readme":"rust-magic-sys\n[![build status](https://github.com/robo9k/rust-magic-sys/actions/workflows/build.yml/badge.svg)](https://github.com/robo9k/rust-magic-sys/actions/workflows/build.yml)\n==============\n\n[Rust](https://www.rust-lang.org/f) declarations for [libmagic](https://www.darwinsys.com/file/).\n\n---\n\nThis [cargo -sys package](https://doc.rust-lang.org/cargo/reference/build-scripts.html) provides `libmagic` declarations for e.g. the [`magic` binding](https://crates.io/crates/magic).\n\n\n# Usage\n\n[`magic-sys` is available on crates.io](https://crates.io/crates/magic-sys) so you can use it like this (in your `Cargo.toml`):\n\n```toml\n[dependencies]\nmagic-sys = \"0.4\"\n```\n\nThe `rustdoc` is available on [docs.rs](https://docs.rs/magic-sys).\n\n# Requirements\n\nThis crate requires the `libmagic` C library in version 5.39 or newer.\n\n## libmagic\n\nIf you don't want to configure the build, `libmagic` has to be available in a standard location\nfor either `pkg-config` or `vcpkg`, see [Building](#Building).\n\nOn a Debian based Linux system such as Ubuntu this can be achieved like this:\n```sh\nsudo apt-get install libmagic1 libmagic-dev\n```\n\nOn RHEL/Cent OS, Gentoo and others you will need to install the `file` package.\n\nOn Mac OS X you can use [Homebrew](https://brew.sh/):\n```sh\nbrew install libmagic\n```\n\nFeedback for Windows ([issue #2](https://github.com/robo9k/rust-magic-sys/issues/2)) support is appreciated!\n\nYou can use Microsoft's [`vcpkg`](https://vcpkg.io) via [`cargo-vcpkg`](https://crates.io/crates/cargo-vcpkg):\n```sh\ncargo install cargo-vcpkg\ncargo vcpkg build\n```\nAfterwards, you can `cargo build` etc. your crate as usual.\n\n## Version features\n\nThe `libmagic` API is extended with new backwards-compatible features every now and then.\\\nTo use newly added `libmagic` functionality, you need to use a corresponding `libmagic` version.\n\nYou need to specify your `libmagic` version by activating the matching `magic-sys` feature.\\\nEach API version has a crate feature like \"v5-40\", see [Cargo.toml](Cargo.toml)\\\nIf you use a different version of `libmagic`, adjust your configuration:\n```toml\n[dependencies.magic-sys]\nversion = \"0.3\"\ndefault-features = false\nfeatures = [\"v5-40\"]\n```\nNote that those version features are additive, so \"v5-45\" implies \"v5-44\" and other previous versions.\n\nIf you want to use a newer/different `libmagic` version, you will have to [link it](#Building) accordingly.\n\n# MSRV\n\nThe Minimum Supported Rust Version (MSRV) is Rust 1.64 or higher.\n\nThis version might be changed in the future, but it will be done with a crate version bump.\n\n# Building\n\nTo determine which `libmagic` to link against, this crate uses\n[`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)\nand [`vcpkg`](https://vcpkg.io/).\n\nThe crate does not offer to link a against a bundled `libmagic` version, see [issue #4](https://github.com/robo9k/rust-magic-sys/issues/4).\n\nIn general you can link statically or dynamically against `libmagic`.\n\nWith static linkage your binary/library includes the `libmagic` code and _does not_ have a run-time dependency.\n\nWith dynamic linkage your binary/library _does not_ include the `libmagic` code and _does_ have a run-time dependency on a `libmagic.dll` / `libmagic.so` / `libmagic.dylib` depending on your platform (Windows / Linux / macOS).\\\nYou might have to ship this `libmagic` shared library with your binary/library if you do not expect your users to have a compatible version installed on their system.\n\nYou might want to ship a copy of the default `libmagic` / `file` database with your binary/library if you do not expect your users to have a compatible `libmagic` installed on their system.\n\n## pkg-config\n\nThe `pkg-config` crate feature uses the [`pkg-config` crate](https://docs.rs/pkg-config), so check its documentation for details.\n\nYou can use e.g. the following environment variables:\n- `LIBMAGIC_NO_PKG_CONFIG` if set, will skip `pkg-config`\n- `LIBMAGIC_STATIC` if set, instructs `pkg-config` to link statically\n- `LIBMAGIC_DYNAMIC` if set, instructs `pkg-config` to link dynamically\n\nBy default dynamic linkage is used.\n\n## vcpkg\n\nThe `vcpkg` crate feature uses the [`vcpkg` crate](https://docs.rs/vcpkg), so check its documentation for details.\n\nYou can use e.g. the following environment variables:\n- `VCPKGRS_NO_LIBMAGIC` if set, will skip `vcpkg`\n- `VCPKGRS_DYNAMIC` if set, instructs `vcpkg` to link dynamically\n\nBy default static linkage is used.\n\nYou can use `vcpkg` standalone or by using [`cargo-vcpkg`](https://crates.io/crates/cargo-vcpkg).\n\nIf you do _not_ use `cargo vcpkg build`, you will have to either\n- `vcpkg install libmagic` and set the `VCPKG_ROOT` environment variable for your `vcpkg` root directory\n- `vcpkg integrate install` your `vcpkg` root user-wide\n\n## Override\n\nIf you disable or skip both `pkg-config` and `vcpkg` the `magic-sys` build script will fail.\\\nEspecially linking statically to `libmagic` requires additional libraries that depend on your version and system.\n\nYou can skip the `magic-sys` build script entirely by [overriding it](https://doc.rust-lang.org/cargo/reference/build-scripts.html#overriding-build-scripts).\\\nThis is an option if you want to use neither `pkg-config` nor `vcpkg`.\n\n# License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobo9k%2Frust-magic-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobo9k%2Frust-magic-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobo9k%2Frust-magic-sys/lists"}