-
-
Notifications
You must be signed in to change notification settings - Fork 3
Restore broken Nix build #311
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,20 +24,11 @@ | |
| }; | ||
| utoipa-swagger-ui = attrs: rec { | ||
| # utoipa-swagger-ui tries to redownload swagger-ui, which is blocked by Nix's sandboxing | ||
| # so we download it instead, and put it where it expects to be cached | ||
| preConfigure = | ||
| let | ||
| swaggerUi = pkgs.fetchurl { | ||
| url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.3.zip"; | ||
| hash = "sha256-zrb8feuuDzt/g6y7Tucfh+Y2BWZov0soyNPR5LBqKx4="; | ||
| }; | ||
| in '' | ||
| mkdir -p target/build/utoipa-swagger-ui.out | ||
| ln -s "${swaggerUi}" target/build/utoipa-swagger-ui.out/swagger-ui.zip | ||
| ''; | ||
| # Build script only supports fetching from HTTP, not file URLs | ||
| # Last path element decides the cache key, which we rely on above | ||
| SWAGGER_UI_DOWNLOAD_URL = "file:///invalid-path/swagger-ui.zip"; | ||
| # so we download it instead, and tell it to use that | ||
| SWAGGER_UI_DOWNLOAD_URL = "file://${pkgs.fetchurl { | ||
| url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.3.zip"; | ||
| hash = "sha256-zrb8feuuDzt/g6y7Tucfh+Y2BWZov0soyNPR5LBqKx4="; | ||
| }}"; | ||
|
Comment on lines
+27
to
+31
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. :chefkiss: |
||
| }; | ||
| }; | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@nightkr this happens to solve my problem as well. But i am currently facing a situation where nix throws this error when trying to copy the zip file to the target build folder.
Is this something you have faced before? i'd appreciate your thoughts on this.
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.
As in the Nix daemon itself throws the error, or build.rs does? Can't say it's something I recognize immediately, but if I were you I'd try to patch utoipa-swagger-ui's build.rs to dump out the environment (what absolute path is it writing to, who's it running as, how much of the path exists, what're the permissions like, etc etc etc).
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.
yes the build.rs does throws this during the nix build. and yes i can identify the various environment related details. Except i'm new to nix and i don't know if i actually can modify the permissions so the build passes. but i'll research more on it. thanks for your prompt response.