-
Notifications
You must be signed in to change notification settings - Fork 78
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
nixpkgs_package is corrupting binary files #136
Comments
I also tried:
It build perfectly fine, however it seems to disable the check for |
The fact that |
@guibou could you open the two tickets upstream as discussed? Meanwhile, the symlink workaround rendering |
I'm having issue with
|
This closes #136 `repository_ctx` is meant to work on "text" files and does text encoding and decoding, which breaks in the context of a binary file. There is no `cp` API in repository_ctx, as suggested in bazelbuild/bazel#11858, but bazelbuild/bazel#11857 suggested to use this approach with `repository_ctx.file`.
Describe the bug
One of my
nixpkgs_package
rules loads (in the nix file) a binary file. Which ends corrupted when evaluated by nix in the context ofnixpkgs_package
(i.e. after the copy).To Reproduce
Have a binary file directly used in your nix file, something such as:
This file must appear in the
nix_file_deps
or your nixpkgs repository. Observes the failure when uncompressing.Expected behavior
It should not corrupt binaries files.
Environment
Additional context
I tracked the issue to:
https://github.com/tweag/rules_nixpkgs/blob/master/nixpkgs/nixpkgs.bzl#L677
which I extended with the following:
And indeed observed that the checksum are not the same.
Aside, I'm not convinced by the
executable=False
flag of thetemplate
call. It seems to me that a file which is considered executable must keep its bit. I don't know if that's important for nix however.It seems that
template
does not work well with binary files. Unfortunately there is no such things as a simplecopy
function in repository context.I tried the following:
- with an
execute(["cp", ...])
but I ended with a lot of problems due to howcp
behaves with directory versus files or already existing files- with an
symlink
, but issues with existing files.The text was updated successfully, but these errors were encountered: