Comments (10)
Okay so the reason that this is happening is super simple, I did it wrong :)
So the stdenv makes Nix use mold
as the linker but it does not make Rust use it. I'm not sure why the way I tested it resulted in a successful build but I'm assuming I got a step wrong somewhere.
A working flake is:
{
description = "Template for Holochain app development";
inputs = {
versions.url = "github:holochain/holochain?dir=versions/weekly";
holochain-flake.url = "github:holochain/holochain";
holochain-flake.inputs.versions.follows = "versions";
nixpkgs.follows = "holochain-flake/nixpkgs";
flake-parts.follows = "holochain-flake/flake-parts";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake
{
inherit inputs;
}
{
systems = builtins.attrNames inputs.holochain-flake.devShells;
perSystem =
{ inputs'
, config
, pkgs
, system
, ...
}: {
devShells.default = pkgs.mkShell.override { stdenv = inputs'.holochain-flake.devShells.holonix.stdenv; } {
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ];
packages = [
pkgs.nodejs-18_x
# more packages go here
];
shellHook = '' export RUSTFLAGS="-C link-arg=-fuse-ld=mold" '';
};
};
};
}
So creating a new shell and using inputsFrom
does not inherit the stdenv, mold
won't be available. Then the shellHook is also necessary to tell Rust to use the provided mold
.
Note that this flake will only work correctly on Linux so it's not really fit for purpose at the moment. It is useful for understanding the missing pieces but that's about it for the moment.
I'll have a think about a reasonable way to put this together. I think an alternative mkShell exposed from this repo might be good so we can customise for the user and the RUSTFLAGS we can set in the holonix shell hook but that's a bit risky for clashes with project settings...
from holochain.
thanks for updating the example repo!
i now have a reproduction of the issue, identified the root cause, and also found a workaround that we can apply to holonix.
the root cause is that holochain's test_utils
feature effectively introduces a dependency on openssl
with the default
feature set, causing it to link against the system's openssl.
openssl v0.10.57
└── openssl feature "default"
└── native-tls v0.2.11
└── native-tls feature "default"
├── hyper-tls v0.5.0
│ └── hyper-tls feature "default"
│ └── reqwest v0.11.17
│ ├── reqwest feature "__tls"
│ │ └── reqwest feature "default-tls"
│ │ └── reqwest feature "default"
│ │ ├── kitsune_p2p_bootstrap v0.2.0-beta-dev.12
│ │ │ ├── kitsune_p2p_bootstrap feature "default"
│ │ │ │ ├── holochain v0.3.0-beta-dev.21
│ │ │ │ │ ├── holochain feature "arbitrary"
│ │ │ │ │ │ └── holochain feature "test_utils"
│ │ │ │ │ │ [dev-dependencies]
│ │ │ │ │ │ └── posts v0.0.1 (/home/steveej/src/others/bug-reproduction-serialize-unit-value/dnas/demo/zomes/coordinator/posts)
│ │ │ │ │ │ └── posts feature "default" (command-line)
a possible workaround to holonix is to add openssl to LD_LIBRARY_PATH
. i'm preparing that workaround in #2942.
from holochain.
fixed by #2942 with a fix to CI regression tests coming in #3048.
@mattyg after a nix flake update
this ought to just work should work for you now too 🙂 please re-open or file a new issue if that's not the case.
from holochain.
It looks like the stdenv
part is being looked at here #2942
from holochain.
i implemented a basic version of switching to mold
on linux in the devShells.
@mattyg please test it on the repo, see the changes here. either me or GitHub are confused as it won't let me create a PR from my branch.
from holochain.
i implemented a basic version of switching to
mold
on linux in the devShells.@mattyg please test it on the repo, see the changes here. either me or GitHub are confused as it won't let me create a PR from my branch.
Thank you! Now the tests build and run but I'm getting this error linking to libssl
/home/matt/Projects/Holochain/bug-reproduction-serialize-unit-value/target/debug/deps/test-fc6f51688c9afa1e: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
from holochain.
i can't reproduce the above. i'm getting seemingly unrelated compiler errors:
error[E0277]: the trait bound `SweetCell: hdk::prelude::Serialize` is not satisfied
--> dnas/demo/zomes/coordinator/posts/tests/test.rs:28:50
|
28 | .call(&alice.zome("posts"), "get_usize", ah)
it'd be great if you could lay out the exact revision of this reop and commands that you use to reproduce the error you're seeing.
from holochain.
sorry i had local changes to the example repo -- pushed
from holochain.
@mattyg would you mind double-checking that https://github.com/steveej/bug-reproduction-nix-zome-build/tree/new-main works as expected for you now?
from holochain.
yep it works now - thank you!
from holochain.
Related Issues (20)
- Release automation can't handle self deps with a version
- Dry run releases are broken due to a missing label HOT 4
- The release automation produces TOML which is not correctly formatted
- A bad return value from a callback crashes the conductor HOT 2
- [Release automation] Fix toml formatting HOT 1
- Release automation dep `crate-util` requires newer Rust version 1.76
- Simplification of the release process HOT 1
- Review of Key Manager Browser Extension HOT 1
- Review of Launcher with Key Management
- (Must have) Run the HoloFuel sweettest test
- Atomic Holonix updates HOT 1
- (Must have) Manual testing, using a happ that we know is reasonably reliable
- (Must have) Leave a conductor running for a longer period of time
- (Nice to have) Automated (or at least semi) testing, maybe with HoloFuel? HOT 1
- (Medium) Wind Tunnel simple baseline HOT 1
- [BUG] Unable to open Database file on Windows 10
- Holochain dependency, dependencies updates HOT 2
- Workflows review 2nd iteration HOT 2
- [Integrity] Write helper to collectively return missing dependencies from must_get calls
- [ENHANCEMENT] Move cached wasms to dedicated folder
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 holochain.