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

attr: fix issues with 2.4.48 #53946

Merged
merged 1 commit into from Jan 19, 2019
Merged

attr: fix issues with 2.4.48 #53946

merged 1 commit into from Jan 19, 2019

Conversation

hedning
Copy link
Contributor

@hedning hedning commented Jan 14, 2019

Motivation for this change

Shim to sys/xattr.h and add upstream patch to fix issues with fakechroot.

resolves #53716

Similar to fedora and gentoo:

cc @pbogdan hopefully just symlinking like this should work?

Things done

Built bcachefs-tools (without #53919 which fixes it independently) and things seemed to work.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@hedning
Copy link
Contributor Author

hedning commented Jan 14, 2019

Hmm, not sure why ofborg complains about this, works locally, though perhaps there is a more portable way to refer to libc?

attribute 'dev' missing, at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/pkgs/development/libraries/attr/default.nix:32:13

@dtzWill
Copy link
Member

dtzWill commented Jan 14, 2019

I'd prefer a shim that complains, like what gentoo uses:

https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/attr/files/xattr-shim.h?id=077738eb8a9905827e615ddb1ac2e788337b1291

I don't know much about the change but either it's wrong and should be reverted or it's "right" and non-compliant programs should have their usage flagged or rejected, depending on the reasons for the change. Yes there are grays between but that's why I suggest the gentler shim/warning approach :).

This also avoids propagating the libc dep, although I'm not sure that is ever useful here O:).

@hedning
Copy link
Contributor Author

hedning commented Jan 14, 2019

I'd prefer a shim that complains, like what gentoo uses:

Right, that's cleaner. I added shim inline.

@hedning
Copy link
Contributor Author

hedning commented Jan 14, 2019

Duh, it's part of the stdenv, that explains why stdenv.cc.libc.dev didn't work (and why fetchpatch didn't work, that stymied me quite a while when writing this 😆)

@hedning
Copy link
Contributor Author

hedning commented Jan 14, 2019

I don't know much about the change but either it's wrong and should be reverted or it's "right" and non-compliant programs should have their usage flagged or rejected

Upstream's reasoning (which sounds sane to me, at least since we haven't really seen tons of failures)

Remove <attr/xattr.h> and the syscall wrappers
The xattr syscalls are provided by glibc since ages, so there is no need to use
the indirect system call "syscall" anymore. This removes the need for the
<attr/xattr.h> header; use <sys/xattr.h> instead.

http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38

The syscall wrappers have been partially reverted, which I included as a patch.

@dtzWill
Copy link
Member

dtzWill commented Jan 14, 2019

Thanks for info and updates, generally LGTM!

Just a thought: is the list over on #53716 complete? Maybe it's not worth plumbing the shim/symlink over, and we should instead patch/update the packages in question?

Said a different way: How do we avoid this becoming a permanent workaround? The patch will presumably be noticed when it doesn't apply on next version bump, but not sure how to handle the compatibility header. I suppose it doesn't really hurt anyone/anything .....

@hedning
Copy link
Contributor Author

hedning commented Jan 14, 2019

Just a thought: is the list over on #53716 complete?

No, just random stuff I found while I was looking for something else, though it shouldn't be a huge amount. Full build log search on hydra would be awesome...

... a while later

Scrambled together some shell scripts and got a full list of x86_64-linux packages who's build log contains attr/xattr.h: No such file or directory:

nixpkgs.aide.x86_64-linux
nixpkgs.bcachefs-tools.x86_64-linux
nixpkgs.diod.x86_64-linux
nixpkgs.haskellPackages.xattr.x86_64-linux
nixpkgs.mhddfs.x86_64-linux
nixpkgs.smbnetfs.x86_64-linux

(edit: removed duplicates)

That's not really a lot, so I agree, it's probably better to fix those instead.

Add upstream patch to fix issues with fakechroot.
@hedning
Copy link
Contributor Author

hedning commented Jan 15, 2019

Removed the shim entirely, better to just fix the few packages which fails (close to complete list at #53716, I count 7 remaining failures).

Not sure if the patch is important (though it's upstream, so probably won't hurt). The main motivation from upstream:

Switch back to syscall() for the *xattr system calls. The current
mechanism of forwarding those calls to glibc breaks libraries like
libfakeroot (fakeroot) and libasan (the gcc address sanitizer; gcc
-fsanitize=address).

full commit

@vcunat vcunat merged commit fa565b6 into NixOS:staging Jan 19, 2019
vcunat added a commit that referenced this pull request Jan 19, 2019
@hedning hedning deleted the fix-xattr.h branch October 15, 2019 11:38
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.

None yet

4 participants