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

tachyon: Add support for jpeg, png, more platforms #38119

Merged
merged 1 commit into from Apr 9, 2018

Conversation

timokau
Copy link
Member

@timokau timokau commented Mar 30, 2018

Motivation for this change

Tachyon supports jpeg and png, but those need to be enabled at build time.

I also added some new platforms, I did not test on any platform besides 64 bit linux though. However, since it is supported upstream and I lifted the platform definitions from the (presumably well-tested) sage spkg, there is good reason to believe that they will work.

Pinging maintainer @7c6f434c.

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

-#JPEGLIB= -L/usr/local/lib -ljpeg
+USEJPEG= -DUSEJPEG
+JPEGINC= -I/usr/include
+JPEGLIB= -L/usr/lib -ljpeg
Copy link
Member

Choose a reason for hiding this comment

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

Did you try removing /usr/ mentions? I think we still try to remove things that break non-sandboxed non-NixOS builds if we already touch the corresponding lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

Very good point, changed.

It would probably be even easier to just re-write the Make-config file entirely instead of patching it, but patching it has the advantage of breaking when upstream changes that file.

Copy link
Member

Choose a reason for hiding this comment

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

I think -ljpeg is still needed, though

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 replaced that by setting environment variables in preBuild, which is easier to do conditionally and only requires a single patch.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

The patch doesn't apply

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

Thats weird, I just retried and it builds fine locally.

Hunk #5 is

-RTVI_HOME = /home/staff/cdtaylor/synergy/REL0.0
-RTVIINC = -I../librtvi
-RTVILIB = -L../librtvi -lrtvictrl.appc -letvi_lib_mcos.appc
+# RTVI_HOME = /home/staff/cdtaylor/synergy/REL0.0
+# RTVIINC = -I../librtvi
+# RTVILIB = -L../librtvi -lrtvictrl.appc -letvi_lib_mcos.appc

It would be nice to see that reject file, can you try to reproduce the failure?

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

Nothing weird: a bump has happenned in the master branch.

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

.. and I just talked about the advantage of the patch breaking when the file changes 😁

I rebased on master.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2
shrinking /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2/bin/tachyon
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2/lib  /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2/bin
patching script interpreter paths in /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /tmp/nix-build-tachyon-0.99b2.drv-0 in /nix/store/g38w75zvvvpr112rxgvkk3z639j7zmp2-tachyon-0.99b2...

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

Ah okay I copied the new architectures from the sage spkg, but apparently that also needs a check to the makefile. I'll include that too.

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

(Hopefully) fixed

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

stdenv.isDarwin not just isDarwin

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

Sorry, I thought I tested that change but I must've forgot. Changed.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

@GrahamcOfBorg build tachyon

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 9, 2018
@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 9, 2018
@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: tachyon

Partial log (click to expand)

#include <Carbon/Carbon.h>  /**< Carbon APIs for Multiprocessing */
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Makefile:278: ../compile/macosx-thr/libtachyon/threads.o] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make[1]: *** [Makefile:84: all] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make: *** [Make-arch:933: macosx-thr] Error 2
builder for '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 9, 2018
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2
shrinking /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/bin/tachyon
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/lib  /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/bin
patching script interpreter paths in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /build in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2...

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

/nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2
shrinking /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/bin/tachyon
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/lib  /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2/bin
patching script interpreter paths in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /tmp/nix-build-tachyon-0.99b2.drv-0 in /nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2...

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 9, 2018
@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: tachyon

Partial log (click to expand)

#include <Carbon/Carbon.h>  /**< Carbon APIs for Multiprocessing */
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Makefile:278: ../compile/macosx-thr/libtachyon/threads.o] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make[1]: *** [Makefile:84: all] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make: *** [Make-arch:933: macosx-thr] Error 2
builder for '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 9, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2
shrinking /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2/bin/tachyon
strip is /nix/store/3zq400fri5dv7d30lpxlqm2v9y1iis6j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2/lib  /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2/bin
patching script interpreter paths in /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /build in /nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2...
/nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

these derivations will be built:
  /nix/store/kkf9g73faivwhw7d7dj3r8wmz2lmi2gj-tachyon-0.99b2.drv
waiting for locks or build slots...
/nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

these derivations will be built:
  /nix/store/kkf9g73faivwhw7d7dj3r8wmz2lmi2gj-tachyon-0.99b2.drv
waiting for locks or build slots...
/nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: tachyon

Partial log (click to expand)

#include <Carbon/Carbon.h>  /**< Carbon APIs for Multiprocessing */
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Makefile:278: ../compile/macosx-thr/libtachyon/threads.o] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make[1]: *** [Makefile:84: all] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-tachyon-0.99b2.drv-0/tachyon/unix'
make: *** [Make-arch:933: macosx-thr] Error 2
builder for '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/fipzjraknjwz8zan45mzxrk9v5mf1fbr-tachyon-0.99b2.drv' failed

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

There goes my attempt to clean up a bit. Anyway: apparently, Carbon did not get added correctly…

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

Any idea why that might be? Otherwise I'll just disable the darwin build for now, at least arm works.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

Maybe it is plain Carbon.h or Carbon-${crbonVersion}/Carbon/Carbon.h. But without a macOS instance that might be painful to debug…

@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

I removed the darwin platform while keeping the relevant patches in place (in case somebody with a mac wants to debug it).

By the way, why is it

platforms = with platforms; linux ++ cygwin;

and not

platforms = with platforms; [ linux cygwin ]

?

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

Because linux and cygwin are already lists, and we want a list, not list-of-lists.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 9, 2018

@GrahamcOfBorg eval

@GrahamcOfBorg build tachyon

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

/nix/store/0sfkl0ik52pnnrlg4ycmklqh798f18qz-tachyon-0.99b2

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: tachyon

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tachyon

Partial log (click to expand)

/nix/store/qkb93lp1hasi0g86dll7k3qca8vs9agi-tachyon-0.99b2

@7c6f434c 7c6f434c merged commit b39f539 into NixOS:master Apr 9, 2018
@timokau
Copy link
Member Author

timokau commented Apr 9, 2018

Ah makes sense.

Thanks!

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

3 participants