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

Support building putty for windows #44632

Merged
merged 6 commits into from Aug 10, 2018
Merged

Conversation

matthewbauer
Copy link
Member

Motivation for this change

Uses the mingw makefile in putty to build for Windows targets.

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)
  • Fits CONTRIBUTING.md.

This is apparently a typo that has not been fixed.

Also remove unused configureFlags.
@matthewbauer
Copy link
Member Author

@GrahamcOfBorg build pkgsCross.mingw32.putty

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: putty

Partial log (click to expand)

shrinking /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/bin/putty
shrinking /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/bin/plink
shrinking /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/bin/pterm
shrinking /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/bin/puttygen
gzipping man pages under /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/share/man/
strip is /nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70/bin
patching script interpreter paths in /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70
checking for references to /build in /nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70...
/nix/store/c4bcx591az0aplf1m81ij2d2y9c16pk7-putty-0.70

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: putty

Partial log (click to expand)

shrinking /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/bin/puttygen
shrinking /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/bin/psftp
shrinking /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/bin/pscp
shrinking /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/bin/plink
gzipping man pages under /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/share/man/
strip is /nix/store/zrs21zqcchgyabjf4xfimncdq16njizc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70/bin
patching script interpreter paths in /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70
checking for references to /build in /nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70...
/nix/store/767rqz9lqcriyl53k6j5q4gi6amqnc1y-putty-0.70

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pkgsCross.mingw32.putty

Partial log (click to expand)

        -lshell32 -luser32
installing
post-installation fixup
DLLPATH='/nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32/bin:/nix/store/bz5izin8r8h72r3p1vbrgfq90pw9dh67-autoconf-2.69/bin:/nix/store/m6idwq9ysc3fv0y1chrcniwz71ygi5b4-automake-1.16.1/bin:/nix/store/knsignig3d67ylsfy617bnjq36dshhri-halibut-1.2/bin:/nix/store/jri0qzh5f41my6sda8vpj2brn37pjnza-libtool-2.4.6/bin:/nix/store/3175j1w4q33kqkf9x0scg9ixndcgfrcb-gnum4-1.4.18/bin:/nix/store/k15ac8wk8h7r30y6g6z5j6rahc28aanm-perl-5.24.4/bin:/nix/store/9nb3k75y84q4lgjzw52k1sh1i34i7q8j-pkg-config-0.29.2/bin:/nix/store/0gahyl2dnjja8648z17jxf47wlb7vsky-patchelf-0.9/bin:/nix/store/a05f8621chsd3h860v8vfyy0g0wgzy7p-paxctl-0.9/bin:/nix/store/jhs9y3f0gkb11afjpza6a5ppd2h6f06w-i686-pc-mingw32-stage-final-gcc-debug-wrapper-7.3.0/bin:/nix/store/pv9zjzci2jafw36cdb0qml8wsi5hnr2i-i686-pc-mingw32-stage-final-gcc-debug-7.3.0/bin:/nix/store/ssr9dhrp11h4lnr35p05bbqc1ln5004d-coreutils-8.29/bin:/nix/store/ws9x9zlnc52y5qr32rxj6lg7wsywyngf-i686-pc-mingw32-binutils-wrapper-2.30/bin:/nix/store/b3fyjpwhqgpjphcn8dw4v2mzh918glxk-i686-pc-mingw32-binutils-2.30/bin:/nix/store/ssr9dhrp11h4lnr35p05bbqc1ln5004d-coreutils-8.29/bin:/nix/store/ssr9dhrp11h4lnr35p05bbqc1ln5004d-coreutils-8.29/bin:/nix/store/7dvq2phf5520wgn2xqq0hbpq2d5iq82d-findutils-4.6.0/bin:/nix/store/i3vi6bipksggp3y11jf8chv99ac174r5-diffutils-3.6/bin:/nix/store/ms0hpa5af9pgjvkjlac5j07xbs09ssb3-gnused-4.5/bin:/nix/store/hnrdvnnzhrppcxqg14bifnnyy4qy94bf-gnugrep-3.1/bin:/nix/store/khp93ad2sbls28z397kx2k4k7lb786ph-gawk-4.2.1/bin:/nix/store/gncd1vwkz1l16qnvdr09cdvphr5agcz8-gnutar-1.30/bin:/nix/store/m90kmkphajn8pns6a7ypgj284jn6nlwg-gzip-1.9/bin:/nix/store/nm3avgd0n7ipk2xc5s0x5352nylsbhjb-bzip2-1.0.6.0.1-bin/bin:/nix/store/34x9zwhm2c4s1n8rklsgxc878czxnf26-gnumake-4.2.1/bin:/nix/store/6vqgi9d49smsbr2qxra52yhipg0yxf9f-bash-4.4-p23/bin:/nix/store/zr5252g93sb8yjhc7l67x9ggsarx4cma-patch-2.7.6/bin:/nix/store/p4n73z8l1hyyyybsycwbrdry55xlhxvd-xz-5.2.4-bin/bin'
Created 0 DLL link(s) in /nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32/bin
shrinking RPATHs of ELF executables and libraries in /nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32
i686-pc-mingw32-strip is /nix/store/b3fyjpwhqgpjphcn8dw4v2mzh918glxk-i686-pc-mingw32-binutils-2.30/bin/i686-pc-mingw32-strip
stripping (with command i686-pc-mingw32-strip and flags -S) in /nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32/bin
patching script interpreter paths in /nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32
/nix/store/15lkdn4wc30yp0qi7p9zakr5cfcr2i5c-putty-0.70-i686-pc-mingw32

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: pkgsCross.mingw32.putty

Partial log (click to expand)

building of '/nix/store/qjdpgn7yb3yy0rl8izzicmm8y2zqbydy-i686-pc-mingw32-stage-static-gcc-debug-7.3.0.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/vpmkgy44adafd5j7s0143nfqwxgi798q-i686-pc-mingw32-stage-static-gcc-debug-wrapper-7.3.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3j1mvjwix68z2zwb9l48ijsz8qfzlhg5-stdenv-linux.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s0azwwikrzipdpv33bqj47hgld4m2jzr-mingw-w64-5.0.4-i686-pc-mingw32.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/8hzswb136pmjxdwrlk1jx3x1hsczhagq-i686-pc-mingw32-binutils-wrapper-2.30.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vdyynaxdrwy8gpqgq423kjzz9sgr90mz-i686-pc-mingw32-stage-final-gcc-debug-7.3.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/h6x7q34br6rkw6w4ap0dzwmr6qngy36s-i686-pc-mingw32-stage-final-gcc-debug-wrapper-7.3.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/qrvrw7fkfkg7bdcvnz84vvj8qkrcf599-stdenv-linux.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/r8sz8rhqj9jslj5aaxg4lvl40sk86i4s-putty-0.70-i686-pc-mingw32.drv': 1 dependencies couldn't be built
error: build of '/nix/store/r8sz8rhqj9jslj5aaxg4lvl40sk86i4s-putty-0.70-i686-pc-mingw32.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: pkgsCross.mingw32.putty

Partial log (click to expand)

        testbn.o tree234.o version.o winmisc.o -ladvapi32 -lcomdlg32 \
        -lgdi32 -limm32 -lole32 -lshell32 -luser32
installing
post-installation fixup
DLLPATH='/nix/store/wfx38d4hrd4ppvnlhcaic7gkcksrkz2n-putty-0.70-i686-pc-mingw32/bin:/nix/store/zragjx1apgldmjsdlgpnmlwf1gx4pl88-autoconf-2.69/bin:/nix/store/b0yfwr97y5wqjy2jgqnq3m1k5y9bnv8q-automake-1.16.1/bin:/nix/store/jlz6dlir0511b7b03qqxlpr0q4ckq1cb-halibut-1.2/bin:/nix/store/2bfd9m1f0nz0b212mcqdl8wkgh9f2r8r-libtool-2.4.6/bin:/nix/store/kgj704l1wn273rm5dhbks8b0s7z9a14g-gnum4-1.4.18/bin:/nix/store/r6x03hk2mssx2jbi0zpaazbv02q3hprw-perl-5.24.4/bin:/nix/store/ddzivgm83cycm2dmhra96fldb4283zm6-pkg-config-0.29.2/bin:/nix/store/v036cazv7vcks527p8vsz5pbqbic8k46-i686-pc-mingw32-stage-final-gcc-debug-wrapper-7.3.0/bin:/nix/store/kq2bm4hfvpahkqkmxglh0zlagk1j92nl-i686-pc-mingw32-stage-final-gcc-debug-7.3.0/bin:/nix/store/gv40kn2pfzwmqzwlinl18qr3464xs83m-coreutils-8.29/bin:/nix/store/3xdifq8hr5slais66ccjmb86d1b8h9j1-i686-pc-mingw32-binutils-wrapper-2.30/bin:/nix/store/dh4v81hy3y6lqx0xalgnf0m908gickfy-i686-pc-mingw32-binutils-2.30/bin:/nix/store/gv40kn2pfzwmqzwlinl18qr3464xs83m-coreutils-8.29/bin:/nix/store/gv40kn2pfzwmqzwlinl18qr3464xs83m-coreutils-8.29/bin:/nix/store/az3761vhgy54q4vj96dcjpy2va07gl51-findutils-4.6.0/bin:/nix/store/6lvphcv88qh040pwxpsg691a38172paj-diffutils-3.6/bin:/nix/store/fx35p5m5cwrphmlfynwgr238rm751v7y-gnused-4.5/bin:/nix/store/6y9axzzq6mgp0y9l9amrxcnzhrgl4aps-gnugrep-3.1/bin:/nix/store/rlwfsqqqhpqcnpm7bs7gr3mszzwjdw26-gawk-4.2.1/bin:/nix/store/1jh65gr9qp6fsdlgrmsjlhgmmfw0s5zi-gnutar-1.30/bin:/nix/store/73ar0h0bjinvi94njf2kdxbmm4pjc804-gzip-1.9/bin:/nix/store/a4qx380vqqpcxays528ji6qmq36lj9qx-bzip2-1.0.6.0.1-bin/bin:/nix/store/6jbc3m2n4dnb72a6igixw5qs11f1hjz1-gnumake-4.2.1/bin:/nix/store/qb76s7s3p6pnsi7082sjfc7rb64f3s6a-bash-4.4-p23/bin:/nix/store/kfx43w09h4pvz1wlcvnq7gls3hxz6ng5-patch-2.7.6/bin:/nix/store/08r9c6vcpy0mis8a5bp0h4xbja6r1fd9-xz-5.2.4-bin/bin'
Created 0 DLL link(s) in /nix/store/wfx38d4hrd4ppvnlhcaic7gkcksrkz2n-putty-0.70-i686-pc-mingw32/bin
i686-pc-mingw32-strip is /nix/store/dh4v81hy3y6lqx0xalgnf0m908gickfy-i686-pc-mingw32-binutils-2.30/bin/i686-pc-mingw32-strip
stripping (with command i686-pc-mingw32-strip and flags -S) in /nix/store/wfx38d4hrd4ppvnlhcaic7gkcksrkz2n-putty-0.70-i686-pc-mingw32/bin
patching script interpreter paths in /nix/store/wfx38d4hrd4ppvnlhcaic7gkcksrkz2n-putty-0.70-i686-pc-mingw32
/nix/store/wfx38d4hrd4ppvnlhcaic7gkcksrkz2n-putty-0.70-i686-pc-mingw32

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: putty

Partial log (click to expand)

mv -f $depbase.Tpo $depbase.Po
./../unix/gtkcomm.c:41:10: fatal error: 'gdk/gdkx.h' file not found
#include <gdk/gdkx.h>
         ^~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:1517: unix/gtkcomm.o] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-putty-0.70.drv-0/putty-0.70/unix'
make: *** [Makefile:1095: all] Error 2
builder for '/nix/store/iicjqpk0ls3jic3112zf6vspia0phk6m-putty-0.70.drv' failed with exit code 2
error: build of '/nix/store/iicjqpk0ls3jic3112zf6vspia0phk6m-putty-0.70.drv' failed

@Mic92
Copy link
Member

Mic92 commented Aug 8, 2018

At which point Microsoft will hire Nix people? 😏

@@ -1,7 +1,15 @@
{ stdenv, callPackage }:
{ stdenv, callPackage, lib, fetchurl }:
Copy link
Member

Choose a reason for hiding this comment

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

it looks like callPackage is not needed anymore

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

good stuff! I have also the nullsoft installer packaged somewhere to windows packages could be more easily redistributed

@matthewbauer
Copy link
Member Author

matthewbauer commented Aug 8, 2018

Haha... well putty is still free software! I want to get to the point where all of the Windows apps I use can be built from Nix expressions.

@Ericson2314
Copy link
Member

Ericson2314 commented Aug 8, 2018

CC @angerman is the bootstrapping still OK (until we can do the C++ stuff at least)?

@@ -0,0 +1,29 @@
{ newScope, crossLibcStdenv }: let
Copy link
Member

Choose a reason for hiding this comment

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

FWIW darwin's went in pkgs/top-level/darwin-packages.nix but used to be in pkgs/os-specific/darwin/default.nix. I'm not sure which I like better; I think @LnL7 made the switch?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer this way just for the shorter file paths. Also top-level is starting to get crowded.

Copy link
Member

Choose a reason for hiding this comment

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

I moved darwin = { ... }; from all-packages to a separate file, I don't think there was a default.nix. Almost every package set points to a pkgs/top-level/<foo>-packages.nix so I think that's better for consistency's sake.

Copy link
Contributor

@angerman angerman left a comment

Choose a reason for hiding this comment

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

Shouldn’t mingwrt be called msvcrt for consistency?

configureFlags = [
"--enable-idl"
"--enable-secure-api"
];
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m pretty sure we want to al least retain the secure-api. Otherwise this will result in frequent missing symbol issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

These weren't being used - only name & src are inherited in the derivation below. We can add them back though.

WINBOOL IsPlatformNT() {
OSVERSIONINFOA oi = { 0 };

- oi.dwOSVersionInfoSize = sizeof (osvi);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we do this? A comment in the source would be nice. Lest the next one reading this will be puzzling over this...

Copy link
Member Author

Choose a reason for hiding this comment

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

@angerman
Copy link
Contributor

angerman commented Aug 9, 2018

@zimbatm I’ve got a nsis.nix as well that even builds the crosscompiling version (to run makensis on Linux)

‘platforms.windows’ includes all windows platforms. Should prefer this
to using assertions.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: putty

Partial log (click to expand)

shrinking /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/bin/putty
shrinking /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/bin/plink
shrinking /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/bin/pterm
shrinking /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/bin/puttygen
gzipping man pages under /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/share/man/
strip is /nix/store/gpc2wld1s0c6qzx9326cwn1wcx29xzsj-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70/bin
patching script interpreter paths in /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70
checking for references to /build in /nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70...
/nix/store/8c9j6vvbp35qhav77zgdy5sp7111pp60-putty-0.70

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: putty

Partial log (click to expand)

mv -f $depbase.Tpo $depbase.Po
./../unix/gtkcomm.c:41:10: fatal error: 'gdk/gdkx.h' file not found
#include <gdk/gdkx.h>
         ^~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:1517: unix/gtkcomm.o] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-putty-0.70.drv-0/putty-0.70/unix'
make: *** [Makefile:1095: all] Error 2
builder for '/nix/store/yadkjq4qhgagiivjm0g89dc9x0pxhpxm-putty-0.70.drv' failed with exit code 2
error: build of '/nix/store/yadkjq4qhgagiivjm0g89dc9x0pxhpxm-putty-0.70.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: putty

Partial log (click to expand)

shrinking /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/bin/puttygen
shrinking /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/bin/psftp
shrinking /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/bin/pscp
shrinking /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/bin/plink
gzipping man pages under /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/share/man/
strip is /nix/store/ah0va6j4cnwj9nx4j6rwcfc8nh785jwm-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70/bin
patching script interpreter paths in /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70
checking for references to /build in /nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70...
/nix/store/z5v364za2z8gf5hwb2wcqq718za2dq2c-putty-0.70

@matthewbauer matthewbauer merged commit fca6cdc into NixOS:master Aug 10, 2018
@bjornfor
Copy link
Contributor

@angerman: Based on this comment, would you mind sharing/upstreaming makensis?

@matthewbauer matthewbauer deleted the putty branch February 22, 2019 04:26
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

8 participants