Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to compile with default_features=false #2734

Open
glfmn opened this issue Dec 31, 2024 · 2 comments
Open

Failure to compile with default_features=false #2734

glfmn opened this issue Dec 31, 2024 · 2 comments

Comments

@glfmn
Copy link

glfmn commented Dec 31, 2024

I am trying to use scryer_prolog as a library within an application, but I wanted to do so with some measure of sandboxing. As one of the features is called http so I tried disabling the default features, but I have run into this compile error. Given the dependency line:

[dependencies.scryer-prolog]
version = "^0.9.4"
default-features = false

Compiling produces the following error:

   Compiling scryer-prolog v0.9.4
error[E0433]: failed to resolve: use of undeclared crate or module `hostname`
    --> /home/user.cargo/registry/src/index.crates.io-6f17d22bba15001f/scryer-prolog-0.9.4/src/machine/system_calls.rs:1773:27
     |
1773 |         if let Ok(host) = hostname::get() {
     |                           ^^^^^^^^ use of undeclared crate or module `hostname`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `scryer-prolog` (lib) due to 1 previous error

Adding the hostname feature resolves the compile error.

@bakaq
Copy link
Contributor

bakaq commented Dec 31, 2024

Which commit are you compiling? This was supposed to be fixed in #2581.

@bakaq
Copy link
Contributor

bakaq commented Dec 31, 2024

Oh, you are using it as a dependency! In that case 0.9.4 does indeed still have this problem. I can't see a solution apart from waiting for the next release (which still seems a bit far because it will be big, specially for the library use case) or using Scryer Prolog as a git dependency with a commit after #2581.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants