-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
naersk rewrites Cargo.toml
to something unparseable
#263
Comments
https://github.com/nix-community/naersk/blob/master/builtins/to-toml.nix#L51-L53 It seems like this is the bug: it’s incorrect to just [[workspace.metadata.dylint.libraries]]
path = "examples/*/*" |
I see - thanks for investigating, I'll try fixing it 🙂 |
As implementing full TOML serializer in Nix is complicated and further bugs may arise, maybe there is value in providing |
I ran into this too: [package.metadata.generate-rpm]
assets = [
{ source = "target/release/xn--ts9h", dest = "/usr/bin/🥺", mode = "6755"},
{ source = "README.md", dest = "/usr/share/doc/🥺/README", mode = "644", doc = true},
{ source = "LICENSE", dest = "/usr/share/doc/🥺/LICENSE", mode = "644", doc = true},
{ source = "🥺.8", dest = "/usr/share/man/man8/🥺.8", mode = "644", doc = true},
] Amazingly the emoji is NOT the issue! |
Chiming in to the issue train, this is preventing us from compiling Leptos (in a workspace): Original [[workspace.metadata.leptos]]
## Workspace config
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle
name = "proto"
# Executable for the webserver
bin-package = "proto-web"
lib-package = "proto-front"
# ... Processed: metadata = { leptos = [ {"assets-dir":"public","bin-default-features":false,"bin-features":["ssr"],"bin-package":"huawei-pro
to-web","browserquery":"defaults","end2end-cmd":"npx playwright test","env":"DEV","lib-default-features":false,"lib-features":["hydrate"],"
lib-package":"huawei-proto-front","name":"huawei-proto","reload-port":3001,"site-addr":"127.0.0.1:3000","site-pkg-dir":"pkg","site-root":"t
arget/huawei-proto","tailwind-config-file":"./frontend/huawei-proto-front/tailwind.config.js","tailwind-input-file":"./frontend/huawei-prot
o-front/tailwind.css"} ] } I'm relatively new to the codebase. Why are we having a rewriting of |
Naersk (and Crane as well, IIRC) have a two-step build process: first they build all of the dependencies (and cache the output), and later they build the actual application (utilizing prebuilt dependencies from the previous step); this allows for faster incremental rebuilds, since more frequently it's the user's application code that changes, not its dependencies. This two-step approach requires generating a stripped version of the original Cargo.toml - i.e. if one is trying to build:
... what Naersk builds first is just:
... i.e. without any I'll try to take a look some time this week, but for a hotfix, you can tell Naersk not to generate prebuilt dependencies:
|
got this same issue when trying to package probe-rs: {
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
probe-rs = {
url = "github:probe-rs/probe-rs";
flake = false;
};
};
outputs = { self, flake-utils, naersk, nixpkgs, probe-rs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) {
inherit system;
};
naersk' = pkgs.callPackage naersk {};
in rec {
# For `nix build` & `nix run`:
defaultPackage = naersk'.buildPackage {
src = probe-rs;
};
# For `nix develop`:
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo ];
};
}
);
}
|
I tried to install
dylint
with these packages:I get this error:
Indeed, TOML in
dummy-src
looks like this:While the actual TOML from the repo is correct:
The text was updated successfully, but these errors were encountered: