Skip to content

Conversation

@nightkr
Copy link
Contributor

@nightkr nightkr commented Jul 26, 2024

Description

24.7.0 breaks the Nix build for a few reasons:

  1. utoipa-swagger-ui now supports file:// URLs (Make SWAGGER_UI_DOWNLOAD_URL support file:// urls juhaku/utoipa#923), so we need to provide a real file path
  2. We now require Go >= 1.22.5, which is not available in the pinned Nixpkgs

This PR fixes 1 directly, and 2 by updating all pinned Nix libraries.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes
# Author
# Reviewer
- [ ] Code contains useful comments
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated
- [ ] Changelog updated
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added

Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

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

I assume you just did a niv update, but if it was something else, would you mind noting it in the description (just so it is stored in the merge commit).

@nightkr
Copy link
Contributor Author

nightkr commented Jul 27, 2024

Yep, 2 was just a niv update.

@nightkr nightkr added this pull request to the merge queue Jul 27, 2024
Merged via the queue into main with commit 3ea3466 Jul 27, 2024
@nightkr nightkr deleted the bugfix/restore-nix-build branch July 27, 2024 12:26
Comment on lines +27 to +31
# 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=";
}}";

Choose a reason for hiding this comment

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

:chefkiss:

# 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

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.

{ code: 13, kind: PermissionDenied, message: "Permission denied" }

Is this something you have faced before? i'd appreciate your thoughts on this.

Copy link
Contributor Author

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).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants