lambdacube3d / lambdacube-ir Goto Github PK
View Code? Open in Web Editor NEWLambdaCube 3D intermediate representation of 3D graphics pipelines. See:
LambdaCube 3D intermediate representation of 3D graphics pipelines. See:
First sympthom:
Preprocessing executable 'ddl-generate' for ddl-0.1.0.0...
Generate.hs:13:8:
Could not find module ‘System.FilePath’
It is a member of the hidden package ‘filepath-1.4.0.0@filep_KsGE6pHE5eZHSN90ZVax6A’.
Perhaps you need to add ‘filepath’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
After adding filepath
to ddl.cabal
:
Linking dist/build/ddl-generate/ddl-generate ...
setup-Simple-Cabal-1.22.4.0-x86_64-linux-ghc-7.10.2: LICENSE: does not exist
cabal: Error: some packages failed to install:
ddl-0.1.0.0 failed during the final install step. The exception was:
ExitFailure 1
After adding LICENSE file it compiles and installs.
Building on Nix currently fails due to old dependencies no longer tracked on Nixpkgs:
Configuring lambdacube-ir-0.3.0.1...
CallStack (from HasCallStack):
$, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1024:20 in Cabal-3.2.1.0:Distribution.Simple.Configure
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:477:12 in Cabal-3.2.1.0:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.2.1.0:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.2.1.0:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.2.1.0:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.2.1.0:Distribution.Simple
defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing or private dependencies:
aeson >=0.9 && <0.12,
base >=4.8 && <4.10,
containers ==0.5.*,
vector ==0.11.*
builder for '/nix/store/znsy8jxgydi9z0gxzk9g5dnq5ys6p1br-lambdacube-ir-0.3.0.1.drv' failed with exit code 1
It looks like the packages aeson
, base
, containers
and vector
are too old to be built by Nix.
09:51 <foo> okay yeah that's quite old dependencies
09:51 <me> foo: I guess this error means that the lambdacube-ir package is "broken" in that it incorrectly specifies its dependences (or something?)
09:52 <foo> me: it adds dependency constraints which are incompatible with what we have in nixpkgs
09:52 <foo> we don't do constraint solving, but provide one standard version per package (following stackage usually)
09:52 <foo> this makes haskellPackages manageable, but also means we can't really build old, unmaintained packages without hassle
So using a certain shell.nix was able to force it to build anyway:
let
pkgs = import <nixpkgs> { overlays = [(self: super:
{
haskellPackages = super.haskell.packages.ghc8107.extend (selfHS: superHS: {
# custom git packages here
lambdacube-ir = pkgs.haskell.lib.doJailbreak superHS.lambdacube-ir;
});
})];
};
in
(pkgs.haskellPackages.callCabal2nix "lcube" ./. {}).env.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [
pkgs.ghostscript
pkgs.entr
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.ghcide
pkgs.haskellPackages.haskell-language-server
pkgs.haskellPackages.hlint
];
})
But then it fails due to some error related to Semigroup:
Preprocessing library for lambdacube-ir-0.3.0.1..
Building library for lambdacube-ir-0.3.0.1..
[1 of 5] Compiling LambdaCube.Linear ( src/LambdaCube/Linear.hs, dist/build/LambdaCube/Linear.o, dist/build/LambdaCube/Linear.dyn_o )
[2 of 5] Compiling LambdaCube.IR ( src/LambdaCube/IR.hs, dist/build/LambdaCube/IR.o, dist/build/LambdaCube/IR.dyn_o )
[3 of 5] Compiling LambdaCube.Mesh ( src/LambdaCube/Mesh.hs, dist/build/LambdaCube/Mesh.o, dist/build/LambdaCube/Mesh.dyn_o )
[4 of 5] Compiling LambdaCube.PipelineSchema ( src/LambdaCube/PipelineSchema.hs, dist/build/LambdaCube/PipelineSchema.o, dist/build/LambdaCube/PipelineSchema.dyn_o )
[5 of 5] Compiling LambdaCube.PipelineSchemaUtil ( src/LambdaCube/PipelineSchemaUtil.hs, dist/build/LambdaCube/PipelineSchemaUtil.o, dist/build/LambdaCube/PipelineSchemaUtil.dyn_o )
src/LambdaCube/PipelineSchemaUtil.hs:17:10: error:
• No instance for (Semigroup PipelineSchema)
arising from the superclasses of an instance declaration
• In the instance declaration for ‘Monoid PipelineSchema’
|
17 | instance Monoid PipelineSchema where
| ^^^^^^^^^^^^^^^^^^^^^
builder for '/nix/store/3sj0pcch67chicsz9xss7630pczlnci9-lambdacube-ir-0.3.0.1.drv' failed with exit code 1
cannot build derivation '/nix/store/l0f2xjkzrq9yv2svywbflbmy3xg5f4d9-ghc-8.10.7-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/l0f2xjkzrq9yv2svywbflbmy3xg5f4d9-ghc-8.10.7-with-packages.drv' failed
Is it that lambdacube is simply targetting too old of a Haskell?
[5 of 5] Compiling LambdaCube.PipelineSchemaUtil ( src/LambdaCube/PipelineSchemaUtil.hs, dist/build/LambdaCube/PipelineSchemaUtil.o )
src/LambdaCube/PipelineSchemaUtil.hs:17:10: error:
• No instance for (Semigroup PipelineSchema)
arising from the superclasses of an instance declaration
• In the instance declaration for ‘Monoid PipelineSchema’
|
17 | instance Monoid PipelineSchema where
| ^^^^^^^^^^^^^^^^^^^^^
Reproducing test case (paste in editor.html to see the error):
makeFrame (time :: Float)
(texture :: Texture)
(prims :: PrimitiveStream Triangle (Vec 4 Float, Vec 3 Float, Vec 3 Float))
= imageFrame ((emptyColorImage (V4 0 0 0.4 1)))
`overlay`
prims
& mapPrimitives (\(p,n,uvw) -> (p, V2 uvw%x (1 - uvw%y) ))
& mapPrimitives (\(x) -> x)
& rasterizePrimitives (TriangleCtx CullBack PolygonFill NoOffset LastVertex) ((Smooth))
& mapFragments (\((uv)) -> ((texture2D (Sampler PointFilter MirroredRepeat texture) uv)))
& accumulateWith ((ColorOp NoBlending (V4 True True True True)))
main = renderFrame $
makeFrame (Uniform "time")
(Texture2DSlot "diffuseTexture")
(fetch "objects" (Attribute "position", Attribute "normal", Attribute "uvw"))
The relevant part is mapPrimitives (\(x) -> x)
. I'm sure this code is wrong, but the error message isn't helping me understand why.
Windows 7 x64, stack, lts-5.6
Demo project: https://github.com/NCrashed/lambdacube-ir-test
C:\dev\lambdacube-ir-test>stack install
lambdacube-ir-0.3.0.0: configure
lambdacube-ir-0.3.0.0: build
-- While building package lambdacube-ir-0.3.0.0 using:
C:\Users\NCrashed\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\setup-Simple-Cabal-1.22.5.0-ghc-7.10.3.exe --builddir=.stack-work\dist\2672c1f3 build lib:lambdacube-ir --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: C:\dev\lambdacube-ir-test\.stack-work\logs\lambdacube-ir-0.3.0.0.log
Configuring lambdacube-ir-0.3.0.0...
Preprocessing library lambdacube-ir-0.3.0.0...
C:\dev\lambdacube-ir-test\.stack-work\downloaded\49271ab6b07bb73a383c47dda35bb993ee26fd87176abc3e1bdc08c5badc4fc8\lambdacube-ir.haskell\src\LambdaCube\IR.hs:1:1:
File name does not match module name:
Saw: `Main'
Expected: `LambdaCube.IR'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.