-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
cargo-lock translator attempting to build packages outside of requirment for rust package #265
Comments
This behaviour makes sense to me, because what you are basically telling dream2nix to do is that it should use the |
Couldn't this cause impure builds to occur when the user attempts to do a pure build? |
No, impure builds aren't a thing in dream2nix. We only have impure translation. Building shouldn't matter here since this is only about translators. |
@yusdacra's solution makes more sense (especially for nix flake show, not displaying all the projects in a source tree seems like a bad idea), I was wondering if a warning should be displayed if a fallback translator has to be selected? |
I think this is a good idea, we could probably display a warning and then say something like "to disable this warning, don't apply your translator settings to these projects by setting |
I think we should not silently ignore what the users specified. This might lead to unexpected behavior elsewhere. Also I think that it is a valid use case to specify a translator which is not detected as compatible. Maybe there is a problem in the auto-detection, and the user wants to force override. I think we should fix it in the cargo-lok translator itself. It could check if a cargo.lock exists and if not, error out recommending to use the cargo-toml translator instead. |
We can add an error message in |
In the error message we could suggest to set {
filter = project: project.relPath == "some/path";
project.translator = [cargo-toml];
} This whole project settings API was a quick hack and is bad. We should replace it. Potentially while migrating to the module system. As an intermediary improvement, we could refactor just the |
Attempting to build:
Results in this error:
Attaching a debugger to the build process and checking what package is being built by viewing "projectTree.files" shows a package without a cargo lock is being built.
Furthermore this package isn't part of the dependencies for nushell and instead looks to be used as a sample of some sort (https://github.com/nushell/nushell/tree/main/samples/wasm).
I believe this is something to do with the discoverer loading all directories that contain a cargo.toml, however as the cargo-lock translator only expects dirs with both a cargo.toml and a cargo.lock it fails.
The text was updated successfully, but these errors were encountered: