Skip to content
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

mkDummySrc: fix handling when src is already filtered #47

Merged
merged 2 commits into from
Jun 30, 2022
Merged

Conversation

ipetkov
Copy link
Owner

@ipetkov ipetkov commented Jun 30, 2022

Fixes #46


cargoTomlsBase = uncleanSrcBasePath;
inherit (uncleanFiles) cargoTomls;

cleanSrc =
let
adjustPaths = builtins.map (p: removePrefix uncleanSrcBasePath (toString p));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in saying that this was added in 4f2b1c4 but wasn't actually used (I'm assuming it was just leftover from an iteration of that commit)?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I think I was iterating on whether to make the filter on the next line as its own variable, but it looks like it was never used (since Nix is lazy it just ignores unused input 🤷 )

then src.origSrc
else src;

uncleanSrcBasePath = (toString origSrc) + "/";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is done to forcefully evaluate the source derivation? Wouldn't this already be evaluated in the call to findCargoFiles?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good enough intuitive understanding of how Nix treats paths and strings (and coercing between the two) to explain why this is needed... I did try taking it out and a bunch of tests failed so it's load bearing at some capacity 😅

Copy link

@winterqt winterqt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works, thanks!

@ipetkov ipetkov merged commit c850d8c into master Jun 30, 2022
@ipetkov ipetkov deleted the dummy-fix branch June 30, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mkDummySrc doesn't behave well with manually filtered source
2 participants