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

sct: fix segfault when DISPLAY is empty, clean up derivation #29801

Merged
merged 1 commit into from Sep 26, 2017

Conversation

lukateras
Copy link
Member

@lukateras lukateras commented Sep 26, 2017

Motivation for this change
  • patchPhase that is now redundant (libXint is not present in source code anymore: it was the unknown small change that was described in derivation comments)
  • meta.license, meta.homepage not set
  • gcc was explicitly used instead of cc

sct segfaults when DISPLAY environment variable is empty:

$ DISPLAY= sct
segmentation fault

This patch fixes that. Now it just exits with error code 1.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

# failed builds as the checksum had changed.
# The checksum is updated for now, however, this is unpractical and potentially unsafe
# so any future changes might warrant a fork of the (feature complete) project.
# The code is under public domain.
Copy link
Member

Choose a reason for hiding this comment

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

can you keep this comment.

Copy link
Member Author

@lukateras lukateras Sep 26, 2017

Choose a reason for hiding this comment

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

There are several problems with this comment:

  • The code is in public domain is now in metadata.
  • The change that has been made is not unknown and basically incorporates patchPhase that I've also removed.
  • Digest change is not potentially unsafe, that's misleading. It can only result in failed builds.

Also I'd argue that it's overly verbose. Keep in mind that sct.c hasn't been updated for a year and a half and probably never will be. The discussion (#17163) is mentioned in 62ba6b0 and is easily retrievable in case if needed.

Copy link
Member

@Mic92 Mic92 Sep 26, 2017

Choose a reason for hiding this comment

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

Can we host this file somewhere else, where it won't be changed (gist)? Otherwise it will break nixpkgs.

Copy link
Member Author

@lukateras lukateras Sep 26, 2017

Choose a reason for hiding this comment

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

@Mic92 This was already decided in #17163. Author (one of OpenBSD commiters, tedu@) knows that several distros rely on this file being unchanged, and probably didn't anticipated this when he had changed the file previously. I could have made https://web.archive.org copy and link to it, but unfortunately author's website uses a custom TLS certificate and https://web.archive.org can't archive when certificate is not valid/not in cert store.

};
phases = ["patchPhase" "buildPhase" "installPhase"];
patchPhase = ''
sed -re "/Xlibint/d" ${src} > sct.c
Copy link
Member

Choose a reason for hiding this comment

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

This one is no longer necessary?

Copy link
Member Author

@lukateras lukateras Sep 26, 2017

Choose a reason for hiding this comment

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

No longer necessary.

Incorporating this patch was the unknown change that the comment has mentioned.

Copy link
Member

Choose a reason for hiding this comment

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

ok. I was not aware of this change.

@Mic92 Mic92 merged commit 21abe34 into NixOS:master Sep 26, 2017
@lukateras
Copy link
Member Author

Thanks!

@lukateras lukateras deleted the sct/patch-segfault branch September 26, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants