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

Fix some rust issues #223

Merged
merged 2 commits into from
Aug 11, 2022
Merged

Fix some rust issues #223

merged 2 commits into from
Aug 11, 2022

Conversation

yusdacra
Copy link
Member

@yusdacra yusdacra commented Aug 1, 2022

This works on #219

@yusdacra
Copy link
Member Author

yusdacra commented Aug 4, 2022

So while I was trying to implement support for duplicated versions, I came across to rust-lang/cargo#10310. The package in question has duplicated versions of a dependency in it's lockfile which cargo vendor does not support, and by extension the vendor directory hierarchy does not also support it. Either upstream needs to fix this (faster) or we wait until cargo supports this (probably going to take some time considering the issue is still open...).

@DavHau
Copy link
Member

DavHau commented Aug 9, 2022

Quick question before I review this. Is this PR just working around an upstream issue or does it actually fix bugs on our side? We should probably not increase complexity on our side if this is an upstream issue.

@yusdacra
Copy link
Member Author

yusdacra commented Aug 9, 2022

Quick question before I review this. Is this PR just working around an upstream issue or does it actually fix bugs on our side? We should probably not increase complexity on our side if this is an upstream issue.

This PR only fixes bugs on our side. I made an issue on upstream that should handle the issue I mentioned.

@@ -251,6 +251,7 @@ in let
builder,
builderArgs,
fetchedSources,
sourceRoot,
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be removed. It isn't used by the builders. Also I think that we should change the way we handle relative path sources. I think we should always pass the root source as src and then set sourceRoot of mkDerivation. The unpackPhase will then switch to the correct subdir. That would allow packages to always refer to files in parent directories without issues. Some nodejs builds currently crash because sub-projects want to access files of parent projects in order to build.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is used by the Rust builders with this PR, to be able to get the full project repository so path dependencies work properly. Before it would only capture the path dependency directory, which will break if the path dependency depends on other path dependencies that are in a parent directory. We could remove this fine if we removed the builtins.path usage for path depedencies, but I think that would cause regressions?

Copy link
Member

Choose a reason for hiding this comment

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

True. This is a trade-off situation that should be carefully thought through.
The isolation of sources gives us better incremental builds, but it also breaks some builds. We should probably provide the user with the choice to turn this on or off, and have the default on the safer side which is probably not to do source isolation. At least for nodejs that would be the case. Maybe the default can be different from subsystem to subsystem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree. I think we should have different functions for getting an isolated path vs a non-isolated path. And then the builder can decide which one to use.

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.

2 participants