-
Notifications
You must be signed in to change notification settings - Fork 98
INF-629: Update common to get split builds #200
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,4 @@ | ||
| { release ? true | ||
| , doClippy ? false | ||
| , doFmt ? false | ||
| , doDoc ? false | ||
| , motoko | ||
| { motoko | ||
| , buildDfinityRustPackage | ||
| , cargo-graph | ||
| , darwin | ||
|
|
@@ -15,7 +11,7 @@ | |
| , dfinity-sdk | ||
| }: | ||
| let | ||
| drv = buildDfinityRustPackage { | ||
| workspace = buildDfinityRustPackage { | ||
| name = "dfinity-sdk-rust"; | ||
| srcDir = ../.; | ||
| regexes = [ | ||
|
|
@@ -26,35 +22,43 @@ let | |
| ".*Cargo\.lock$" | ||
| "^.cargo/config$" | ||
| ]; | ||
| inherit release doClippy doFmt doDoc; | ||
| }; | ||
| in | ||
| drv.overrideAttrs (oldAttrs: { | ||
| DFX_ASSETS = runCommandNoCC "dfx-assets" {} '' | ||
| mkdir -p $out | ||
| cp ${dfinity.nodemanager}/bin/nodemanager $out | ||
| cp ${dfinity.ic-client}/bin/client $out | ||
| cp ${motoko.moc-bin}/bin/moc $out | ||
| cp ${motoko.mo-ide}/bin/mo-ide $out | ||
| cp ${motoko.didc}/bin/didc $out | ||
| cp ${motoko.rts}/rts/mo-rts.wasm $out | ||
| mkdir $out/stdlib && cp -R ${motoko.stdlib}/. $out/stdlib | ||
| mkdir $out/js-user-library && cp -R ${dfinity-sdk.packages.js-user-library}/. $out/js-user-library | ||
| ''; | ||
| workspace' = (workspace // | ||
| { lint = workspace.lint.overrideAttrs (oldAttrs: { | ||
| nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ | ||
| cargo-graph | ||
| graphviz | ||
| ]; | ||
|
|
||
| nativeBuildInputs = oldAttrs.nativeBuildInputs ++ lib.optionals doDoc [ | ||
| cargo-graph | ||
| graphviz | ||
| ]; | ||
| postDoc = oldAttrs.postDoc + '' | ||
| pushd dfx | ||
| cargo graph | dot -Tsvg > ../target/doc/dfx/cargo-graph.svg | ||
| popd | ||
| ''; | ||
|
|
||
| postDoc = oldAttrs.postDoc + '' | ||
| pushd dfx | ||
| cargo graph | dot -Tsvg > ../target/doc/dfx/cargo-graph.svg | ||
| popd | ||
| ''; | ||
| postInstall = oldAttrs.postInstall + '' | ||
| echo "report cargo-graph-dfx $doc dfx/cargo-graph.svg" >> \ | ||
| $doc/nix-support/hydra-build-products | ||
| ''; | ||
| }); | ||
| }); | ||
| in | ||
|
|
||
| postInstall = oldAttrs.postInstall + lib.optionalString doDoc '' | ||
| echo "report cargo-graph-dfx $doc dfx/cargo-graph.svg" >> \ | ||
| $doc/nix-support/hydra-build-products | ||
| ''; | ||
| }) | ||
| # override all derivations and add DFX_ASSETS as an environment variable | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only need
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize that this is separate to the motivation for this PR, but the comment made me think about this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with Paul, we should only add DFX_ASSETS to the rust derivations. |
||
| (lib.mapAttrs (k: drv: | ||
| if !lib.isDerivation drv then drv else | ||
| drv.overrideAttrs (_: { | ||
| DFX_ASSETS = runCommandNoCC "dfx-assets" {} '' | ||
| mkdir -p $out | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we get a bit more context here? I would rather not have to rebuild everything.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you mean? this is the same as before. |
||
| cp ${dfinity.nodemanager}/bin/nodemanager $out | ||
| cp ${dfinity.ic-client}/bin/client $out | ||
| cp ${motoko.moc-bin}/bin/moc $out | ||
| cp ${motoko.mo-ide}/bin/mo-ide $out | ||
| cp ${motoko.didc}/bin/didc $out | ||
| cp ${motoko.rts}/rts/mo-rts.wasm $out | ||
| mkdir $out/stdlib && cp -R ${motoko.stdlib}/. $out/stdlib | ||
| mkdir $out/js-user-library && cp -R ${dfinity-sdk.packages.js-user-library}/. $out/js-user-library | ||
| ''; | ||
| }) | ||
| ) workspace') | ||
| (throw "this argument is used to trigger the functor and shouldn't actually be evaluated.") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eftychis can you clarify? The SDK seem to use cargo graph, which requires graphviz.