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

slang: respect TERMINFO_DIRS and ignore FHS paths #50976

Merged
merged 1 commit into from May 15, 2019

Conversation

lheckemann
Copy link
Member

Motivation for this change

Makes whiptail, nmtui and others work correctly in nonstandard terminals like alacritty.

cc @tilpner who was complaining about this not working, @Fuuzetsu maintainer

Things done
  • 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.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: slang

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/59nq44126cssddj3qd8aqmaj32y1c64g-slang-2.3.2-man
gzipping man pages under /nix/store/59nq44126cssddj3qd8aqmaj32y1c64g-slang-2.3.2-man/share/man/
strip is /nix/store/6dpnd5aniypn8124mmy8f88s4mq2zl07-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/59nq44126cssddj3qd8aqmaj32y1c64g-slang-2.3.2-man
checking for references to /build in /nix/store/59nq44126cssddj3qd8aqmaj32y1c64g-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/6y7bbsjich08iiplg272wdck13z8nlkk-slang-2.3.2-doc
strip is /nix/store/6dpnd5aniypn8124mmy8f88s4mq2zl07-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/6y7bbsjich08iiplg272wdck13z8nlkk-slang-2.3.2-doc
checking for references to /build in /nix/store/6y7bbsjich08iiplg272wdck13z8nlkk-slang-2.3.2-doc...
/nix/store/vz0y6yz2kkvpihw9ccwidh9w1vm82qmf-slang-2.3.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: slang

Partial log (click to expand)

checking for references to /build in /nix/store/7bmrss337sq9grcs1y9drhqvkxkg2qny-slang-2.3.2-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/pn62wzbfb7jxhdx76swxb8fd3r0q08mw-slang-2.3.2-man
gzipping man pages under /nix/store/pn62wzbfb7jxhdx76swxb8fd3r0q08mw-slang-2.3.2-man/share/man/
strip is /nix/store/rpbg8gmqxhz8g61p1plz5d2srs84pvmv-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/pn62wzbfb7jxhdx76swxb8fd3r0q08mw-slang-2.3.2-man
checking for references to /build in /nix/store/pn62wzbfb7jxhdx76swxb8fd3r0q08mw-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/sgs8rgklimblamqcwvs4zycrxps81qmy-slang-2.3.2-doc
strip is /nix/store/rpbg8gmqxhz8g61p1plz5d2srs84pvmv-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/sgs8rgklimblamqcwvs4zycrxps81qmy-slang-2.3.2-doc
checking for references to /build in /nix/store/sgs8rgklimblamqcwvs4zycrxps81qmy-slang-2.3.2-doc...

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: slang

Partial log (click to expand)

patching script interpreter paths in /nix/store/c2d0nrjn63rlvyh233xyczf07sp3i2zr-slang-2.3.2
strip is /nix/store/rk3p99jbj4idl3dkkg1rxja5gz0qgs98-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/sshza93lrn4hsk6p89phmqw82xdpccfg-slang-2.3.2-dev/lib
patching script interpreter paths in /nix/store/sshza93lrn4hsk6p89phmqw82xdpccfg-slang-2.3.2-dev
gzipping man pages under /nix/store/dn6pvlp4v4ppdd0ygdd90jlw617236dj-slang-2.3.2-man/share/man/
strip is /nix/store/rk3p99jbj4idl3dkkg1rxja5gz0qgs98-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/dn6pvlp4v4ppdd0ygdd90jlw617236dj-slang-2.3.2-man
strip is /nix/store/rk3p99jbj4idl3dkkg1rxja5gz0qgs98-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/98cx6vxwlbxshpa001i7zsic8jrwbsih-slang-2.3.2-doc
/nix/store/c2d0nrjn63rlvyh233xyczf07sp3i2zr-slang-2.3.2

@lheckemann lheckemann changed the base branch from master to staging November 24, 2018 09:27
@lheckemann
Copy link
Member Author

Rebased on staging due to linux mass-rebuild.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: slang

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man
gzipping man pages under /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man/share/man/
strip is /nix/store/br51frm28n8n85bs9wrcx6g8rpa42ain-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man
checking for references to /build/ in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc
strip is /nix/store/br51frm28n8n85bs9wrcx6g8rpa42ain-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc
checking for references to /build/ in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc...
/nix/store/96vynix7j75vz6gnyazwyplvnyap5mmc-slang-2.3.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: slang

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man
gzipping man pages under /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man/share/man/
strip is /nix/store/yyx28sl7a9n4xs9f82v0llpvrmryanan-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man
checking for references to /build/ in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc
strip is /nix/store/yyx28sl7a9n4xs9f82v0llpvrmryanan-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc
checking for references to /build/ in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc...
/nix/store/ps8pjb2f365ic63ck721skw6sc5kqry0-slang-2.3.2

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: slang

Partial log (click to expand)

cannot build derivation '/nix/store/q2xzzdrk5f3aamplvv81isrzh5k5930x-clang-5.0.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ns60bj3pm5hy9z30882l0j5sw90yvp3v-compiler-rt-5.0.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/nyyjs5lbq9w2mgvvc29di4b780qzgp7a-cctools-binutils-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/nx05yjf0hk158jxpvhfdq9jca8awjhlm-cctools-binutils-darwin-wrapper.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/48d7s7x8qxyxyk6i36cy0xqf5a4jvxpg-clang-wrapper-5.0.2.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/l7wd296rqa1sj137x2nixmhxj2l00j6d-stdenv-darwin.drv': 7 dependencies couldn't be built
cannot build derivation '/nix/store/jmxff2mvgai4h5z7x1rnd4gnjrfbjcvy-libpng-apng-1.6.35.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vkki0aqnj5rn8z53bmjld8p225488zpl-readline-6.3p08.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9djzbwzykgx4ganv9n9w0i0ac49gcsw7-slang-2.3.2.drv': 3 dependencies couldn't be built
error: build of '/nix/store/9djzbwzykgx4ganv9n9w0i0ac49gcsw7-slang-2.3.2.drv' failed

@matthewbauer
Copy link
Member

matthewbauer commented Nov 24, 2018

I wonder if anyone needs those FHS paths? On NixOS they don't exist, but on some Nix systems they could be useful. I suppose we can just have everyone that needs it set them in TERMINFO_DIRS.

@lheckemann
Copy link
Member Author

It's possible that someone might need them. If they do, I suggest adding them to TERMINFO_DIRS in their env, which gets them searched. Not removing them from the source makes it impossible to achieve the purer behaviour, while removing them doesn't completely prevent host system terminfo from being detected, so I'm not in favour of adding them back.

@lheckemann
Copy link
Member Author

Documented this rationale in the commit message.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: slang

Partial log (click to expand)

checking for references to /build/ in /nix/store/p2nnjr1bdxsk8p5f2sd7l8fcj8pdynkr-slang-2.3.2-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man
gzipping man pages under /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man/share/man/
strip is /nix/store/br51frm28n8n85bs9wrcx6g8rpa42ain-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man
checking for references to /build/ in /nix/store/5fj1ki0sa2ya2valw567lgislrblmq2g-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc
strip is /nix/store/br51frm28n8n85bs9wrcx6g8rpa42ain-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc
checking for references to /build/ in /nix/store/ck43lhfrkrdfw7jr1vhadfpd76vp6rqb-slang-2.3.2-doc...

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: slang

Partial log (click to expand)

cannot build derivation '/nix/store/q3gwc91h86yyy4ys70rrp0ca69lnjbiv-cctools-binutils-darwin-wrapper.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/z2lfrq3dv13gq1c1fkbca1x4fw79igk3-libkrb5-1.15.2.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/wr98xw08ssdpbchmhi7871cks004w6s0-clang-wrapper-5.0.2.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/1kg4pi9ymhj3bvb1asjh85v8blcfxd3v-curl-7.62.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/w6ckf8k7iaz5ws675pynhaq4n89b930b-swift-corefoundation.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/sijmp11f8rsv5bxf250qiqvbkmzqjv7g-stdenv-darwin.drv': 24 dependencies couldn't be built
cannot build derivation '/nix/store/wimfy49zi4bv4hp6j7p0rqfcxbbi4h1l-libpng-apng-1.6.35.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/y4392m7jllwnhirg8z9f6azc9y0r3w60-readline-6.3p08.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/9lr6dl2niqs1lxbqa2ag8ism0qhg3vm8-slang-2.3.2.drv': 7 dependencies couldn't be built
error: build of '/nix/store/9lr6dl2niqs1lxbqa2ag8ism0qhg3vm8-slang-2.3.2.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: slang

Partial log (click to expand)

checking for references to /build/ in /nix/store/m8lnslsq45zaip9mxal2j8p2h9dmxz5j-slang-2.3.2-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man
gzipping man pages under /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man/share/man/
strip is /nix/store/yyx28sl7a9n4xs9f82v0llpvrmryanan-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man
checking for references to /build/ in /nix/store/nsnb7bzw3wf6s114n89zhh3df1lfbdpl-slang-2.3.2-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc
strip is /nix/store/yyx28sl7a9n4xs9f82v0llpvrmryanan-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc
checking for references to /build/ in /nix/store/gcr1k3z6frp3i38ijkc6d4wv1zm4z8i1-slang-2.3.2-doc...

@lheckemann
Copy link
Member Author

Darwin failure seems to be unrelated to my changes, looks like resource exhaustion or something on the build machine.

@Mic92
Copy link
Member

Mic92 commented Nov 26, 2018

Can you try to get the TERMINFO_DIRS patch upstream?

@lheckemann
Copy link
Member Author

I can, but don't have the time currently. I'm fairly sure upstream won't accept it as is since it's quite a break from their coding standards (whatever they may be) and likely disregards some compatibility issues which we don't care about because we don't run on obscure unix platforms.

@Mic92
Copy link
Member

Mic92 commented Nov 26, 2018

well TERMINFO_DIRS is also useful on unix systems.

@Mic92
Copy link
Member

Mic92 commented Nov 26, 2018

I have sent it to the author.

@lheckemann
Copy link
Member Author

I meant compatibility as in portability of the C code, not appropriateness of the behaviour. Thanks though!

@Mic92
Copy link
Member

Mic92 commented Nov 30, 2018

I got a response today. TERMINFO_DIRS is now supported by slang!

I added the patch to pre2.3.3-5. Thanks, --John

@lheckemann
Copy link
Member Author

Oh nice, thanks!

@lheckemann
Copy link
Member Author

Maybe one day a version with the fix will be released 🤣

@Mic92
Copy link
Member

Mic92 commented Apr 30, 2019

We could also just pull their patch in this case.

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

5 participants