Giter Club home page Giter Club logo

Comments (7)

zoranbosnjak avatar zoranbosnjak commented on August 31, 2024 2

It looks like libfuse3.buildinfo.in is not picked by the build process. I could make it compile (via nix) if I hardcode the version in the cabal file (at the end of the library section) like this:

  cc-options:          "-DFUSE_USE_VERSION=31"

This works, however I don't like the version number being duplicated.

Another approach I was trying was to change the Setup.hs file, like this:

-main = defaultMain
+main = defaultMainWithHooks autoconfUserHooks

but then it complains with the message:

Setup: configure script not found.

... which I could fix by storing configure file to the repository. I don't think it's a good idea either.

@peti, I am kindly ask you for your advice again. How to fix the nix-build problem properly in this case?

The tests still fail however, so the nix build is not successfull unless I disable the tests. But this is unrelated problem.

from haskell-libfuse3.

modotte avatar modotte commented on August 31, 2024 1

@zoranbosnjak

Hello! I'm not a nix user myself but I'm interested in trying to figure this out too (as the error is identical to my stack building failure issue).

I decided to install nix a few hours ago and I came to a similar obstacle as well.

However, I found there's a Nix's feature that allows you to run autoreconf at build time.

Anyways, I managed to build the package from the source using nix-build shell.nix by replacing these two file contents below.

Setup.hs

import Distribution.Simple
main = defaultMainWithHooks autoconfUserHooks

shell.nix

{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:

let

  inherit (nixpkgs) pkgs;

  f = { autoreconfHook, pkg-config, mkDerivation, base, bytestring, clock
      , criterion, directory, filepath, fuse3, hspec, lib, process, resourcet
      , temporary, time, unix
      }:
      mkDerivation {
        pname = "libfuse3";
        version = "0.1.2.0";
        src = ./.;
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
          base bytestring clock resourcet time unix
        ];
        libraryPkgconfigDepends = [ fuse3 ];
        testHaskellDepends = [
          base bytestring directory filepath hspec process temporary unix
        ];
        benchmarkHaskellDepends = [ base bytestring criterion unix ];
        description = "A Haskell binding for libfuse-3.x";
        license = lib.licenses.mit;
      };

  haskellPackages = if compiler == "default"
                       then pkgs.haskellPackages
                       else pkgs.haskell.packages.${compiler};

  variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;

  drv = variant (haskellPackages.callPackage f {});
in

  #if pkgs.lib.inNixShell then drv.env else drv
  drv.overrideAttrs (attrs: {
    nativeBuildInputs = [ pkgs.autoreconfHook pkgs.pkg-config ];
  })

The test failure still persists however as mentioned, and I'm not sure if this workaround is an ideal solution to the problem, but it's there if anyone else wanna try building it.

from haskell-libfuse3.

matil019 avatar matil019 commented on August 31, 2024

Nice to meet you!

Thank you for your report and I'm sorry for your trouble. I was not aware of the nixpkgs failure out there.

The error message indicates that the C macro FUSE_USE_VERSION is not defined to a certain value. libfuse (the C library) requires it. In this package, it is defined with cc-options in libfuse3.buildinfo, which is generated from the template libfuse3.buildinfo.in by the command autoreconf -fiv ./configure.

So, as you have confirmed, you have to run autoreconf -fiv (v is optional, by the way). Cabal runs ./configure automatically to generate these files. I'm afraid I'm not familiar with nix, so I don't know how to make it work with nixpkgs.

FYI, the value of FUSE_USE_VERSION we use is 31, defined in configure.ac#L12.

EDIT: I confused ./configure with autoreconf.

from haskell-libfuse3.

peti avatar peti commented on August 31, 2024

The Cabal file you distribute advertises the build of this package as Simple even though it's clearly not. The proper build type is Configure.

from haskell-libfuse3.

matil019 avatar matil019 commented on August 31, 2024

It's specified as Configure. Am I missing something?

from haskell-libfuse3.

peti avatar peti commented on August 31, 2024

Oh, okay. Sorry, I was confused by the message that said running autoreconf -i would fix the build, but in fact that's not the problem the Nix build was having.

from haskell-libfuse3.

matil019 avatar matil019 commented on August 31, 2024

I was wrong 🤦 I meant ./configure, not autoreconf -i. I just confirmed that I can build from a fresh sdist with cabal v2-build without manual autoreconf -fiv. Cabal runs ./configure automatically as expected. Then perhaps the cause is libfuse, the C library this package binds to, being missing? This is just a speculation because I can't find the error log of that Nix build.

from haskell-libfuse3.

Related Issues (2)

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.