Code Monkey home page Code Monkey logo

Comments (9)

osa1 avatar osa1 commented on June 11, 2024

This is not a bug. You need .cabal/share/<your compiler>/criterion-<version>/templates too.

from criterion.

Gabriella439 avatar Gabriella439 commented on June 11, 2024

I think this issue should be re-opened. The bench executable (which wraps criterion in a command-line executable) is running into this same problem:

Gabriella439/bench#12

I would like to be able to distribute a standalone executable, but the baked-in runtime reference to the template file makes the --output option fail when the executable is distributed to another machine that doesn't have criterion installed

from criterion.

RyanGlScott avatar RyanGlScott commented on June 11, 2024

Hm. I think I also share @osa1's opinion that this isn't a bug—or at the very least, the issue lies in Cabal, not criterion.

As you've noted in Gabriella439/bench#12 (comment), criterion uses Cabal's data-files feature to bundle several large files used for criterion's HTML reporting. This means that one cannot simply copy a criterion binary from machine to machine and expect it to work, as the appropriate data-files must also be present on the target machine.

For whatever reason, it seems that brew is not distributing the data-files correctly, leading to the mess in Gabriella439/bench#12. Alas, I cannot offer any advice on how one might fix that, since I know nothing of how brew works internally.

(There are extreme measures one can take to eliminate the use of data-files entirely, such as by embedding the files directly into source code using the file-embed library. But that would massively increase binary sizes—and likely compilation times—so as a result, that's an avenue I'm reluctant to pursue.)

from criterion.

RyanGlScott avatar RyanGlScott commented on June 11, 2024

One way forward here is to adopt the approach that the hyphenation and pandoc take: use file-embed to embed the data-files into the binary when a flag is enabled (pandoc calls this embed_data_files). This would add some complexity, but perhaps it's unavoidable for now, as I'll admit that I can't find a general solution to the data-files problem after doing some searching.

from criterion.

RyanGlScott avatar RyanGlScott commented on June 11, 2024

See #169 for an attempt at implementing the idea in #45 (comment).

from criterion.

RyanGlScott avatar RyanGlScott commented on June 11, 2024

@Gabriel439, can you confirm if the new -fembed-data-files flag works for bench's purposes?

from criterion.

Gabriella439 avatar Gabriella439 commented on June 11, 2024

@RyanGlScott: Yeah, will do. Give me a day or two to test this

from criterion.

Gabriella439 avatar Gabriella439 commented on June 11, 2024

@RyanGlScott: bench users confirmed that the new -fembed-data-files successfully produces a relocatable bench executable: Gabriella439/bench#12 (comment)

Thanks a lot for all of your help! 🙂

from criterion.

RyanGlScott avatar RyanGlScott commented on June 11, 2024

Awesome! I've uploaded criterion-1.2.5.0 to Hackage with these changes.

from criterion.

Related Issues (20)

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.