Coder Social home page Coder Social logo

Comments (8)

mattyg avatar mattyg commented on May 27, 2024 1

Here's a minimal reproduction: https://github.com/mattyg/bug-reproduction-nix-zome-build

Run npm run build:happ and it fails to build on linux x64

Sorry I meant latest 0_2 holonix

Looks like mio is coming in from tokio, which I think is coming in from including holochain test_utils as a dev dependency

from holochain.

mattyg avatar mattyg commented on May 27, 2024 1

Looking at the docs, Cargo makes no promise not to build dev-dependencies with the release flag, it just affects optimisation. I find that incredibly strange but that's what it currently does I think https://doc.rust-lang.org/cargo/commands/cargo-build.html#examples

Holochain wasmer does this to avoid pulling deps into a wasm build, maybe that's a possible solution here? https://github.com/holochain/holochain-wasmer/blob/develop/crates/common/Cargo.toml#L20C57-L20C57

huh bizarre okay thanks I'll try that

though in the rust book it does say dev-dependencies are not compiled for building:

Dev-dependencies are not used when compiling a package for building, but are used for compiling tests, examples, and benchmarks.
https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies

from holochain.

mattyg avatar mattyg commented on May 27, 2024

I wonder if it makes sense to actually build the scaffolded web-app in test to confirm all the build tooling is as expected in holonix:

@test "expected scaffold an example to succeed" {

from holochain.

steveej avatar steveej commented on May 27, 2024

can you share the steps you took to scaffold the happ or alternatively share a git repository?

at first sight i'm confused why mio is pulled in as a dependency for the wasm build, as i understand mio uses system API that is not provided by the wasm32-unknown-unknown target.

from holochain.

ThetaSinner avatar ThetaSinner commented on May 27, 2024

Looking at the docs, Cargo makes no promise not to build dev-dependencies with the release flag, it just affects optimisation. I find that incredibly strange but that's what it currently does I think https://doc.rust-lang.org/cargo/commands/cargo-build.html#examples

Holochain wasmer does this to avoid pulling deps into a wasm build, maybe that's a possible solution here? https://github.com/holochain/holochain-wasmer/blob/develop/crates/common/Cargo.toml#L20C57-L20C57

from holochain.

ThetaSinner avatar ThetaSinner commented on May 27, 2024

Interesting, yes they say different things on different doc pages. The page dedicated to dev-dependencies just says "These dependencies are not propagated to other packages which depend on this package." - https://doc.rust-lang.org/rust-by-example/testing/dev_dependencies.html

I actually wonder though whether this should be a dependency of the coordinator. It would be nice to have the tests live alongside the zome but the tests are actually going to want to depend on the compiled wasm output so it'll be two steps to run them anyway. So it might make sense to have a tests project... It feels a bit untidy to have to do that though, I'd rather it was a choice.

The other possibility is to raise this for clarification with the Rust project because this behavior certainly isn't desirable. It'd be worth checking if this happens in a project that isn't in a workspace before going to them, but otherwise this does seem like at very least a documentation gap.

from holochain.

mattyg avatar mattyg commented on May 27, 2024

Closing since it's definitely not a holonix issue -- I think it's related to some limitations in cargo workspaces.

from holochain.

mattyg avatar mattyg commented on May 27, 2024

I just needed to specify resolver = "2" in the workspace manifest. Added a PR to scaffolder here: holochain/scaffolding#132

from holochain.

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.