Comments (9)
This is not a bug. You need .cabal/share/<your compiler>/criterion-<version>/templates
too.
from criterion.
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:
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.
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.
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.
See #169 for an attempt at implementing the idea in #45 (comment).
from criterion.
@Gabriel439, can you confirm if the new -fembed-data-files
flag works for bench
's purposes?
from criterion.
@RyanGlScott: Yeah, will do. Give me a day or two to test this
from criterion.
@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.
Awesome! I've uploaded criterion-1.2.5.0
to Hackage with these changes.
from criterion.
Related Issues (20)
- criterion lower bound on aeson seems to be too loose HOT 3
- Presence of double quotes in benchmark name produces broken HTML report HOT 5
- 0.1.2.0 build failure on Apple Silicon HOT 22
- Log scale discoverability HOT 1
- Criterion/Main/Options.hs:38:48: error: Module ‘Options.Applicative.Help.Pretty’ does not export ‘Ann’ | 38 | import Options.Applicative.Help.Pretty ((.$.), Ann) HOT 5
- Regressions in Config Parameter are Ignored HOT 3
- Support aeson-2 HOT 2
- Is there any way to generate a static output? HOT 3
- Add a variant of runBenchmark which also takes iteration range. HOT 2
- [FR] support benchmarking max memory usage HOT 4
- use performMajorGC HOT 10
- Fails to compile with optparse-applicative-0.17.0.0 HOT 2
- Update tutorial to suggest `v2-`style `cabal` commands
- Avoid only a subset of benchmarks being specialized by SpecConstr. HOT 5
- please document that (and how) criterion runs GC HOT 1
- first benchmark is expensive HOT 5
- please document that `nf` is (contains) an IO action
- Add or migrate to `peakAllocated` HOT 1
- Website is down HOT 7
- Examples directory link is wrong on Hackage Readme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from criterion.