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

hy: 0.15 -> 0.16 #57882

Merged
merged 3 commits into from May 1, 2019
Merged

hy: 0.15 -> 0.16 #57882

merged 3 commits into from May 1, 2019

Conversation

nixy
Copy link
Contributor

@nixy nixy commented Mar 18, 2019

This updates the package versions for hy and brings it up to the latest release 0.16.

The binary generated by this doesn't work right now:

+$ hy --version
hy 0.16.0
+$ hy
Traceback (most recent call last):
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/bin/.hy-wrapped", line 11, in <module>
    sys.exit(hy_main())
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/cmdline.py", line 589, in hy_main
    sys.exit(cmdline_handler("hy", sys.argv))
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/cmdline.py", line 583, in cmdline_handler
    return run_repl(spy=options.spy, output_fn=options.repl_output_fn)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/cmdline.py", line 428, in run_repl
    hr = HyREPL(**kwargs)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/cmdline.py", line 236, in __init__
    self.hy_compiler = HyASTCompiler(self.module)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/compiler.py", line 385, in __init__
    load_macros(self.module)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/macros.py", line 233, in load_macros
    builtin_mod = importlib.import_module(builtin_mod_name)
  File "/nix/store/ih03q5vi6kj278l4jk4kh41lqyagzzdi-python-2.7.15/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/importer.py", line 247, in load_module
    self.exec_module(mod, fullname=fullname)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/importer.py", line 212, in exec_module
    code = self.get_code(fullname)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/importer.py", line 322, in get_code
    self.code = self.byte_compile_hy(fullname)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/importer.py", line 294, in byte_compile_hy
    hyc_compile(code, module=fullname)
  File "/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/importer.py", line 471, in hyc_compile
    delete=False)
  File "/nix/store/ih03q5vi6kj278l4jk4kh41lqyagzzdi-python-2.7.15/lib/python2.7/tempfile.py", line 475, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/nix/store/ih03q5vi6kj278l4jk4kh41lqyagzzdi-python-2.7.15/lib/python2.7/tempfile.py", line 244, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 30] Read-only file system: '/nix/store/0abkjfdd1yrbqs9lvq59bcjqb729qfpc-hy-0.16.0/lib/python2.7/site-packages/hy/core/tmpSNeY30'

It looks like due to changes made in 0.16 it is now attempting to hy compile itself from the directory the file is located in to the same directory. This won't work for Nix as the /nix store is intended as a read-only filesystem. This will need either a patch or an upstream change to address.

@dotlambda I had this work sitting for a while, but hadn't gotten around to working on a patch for this behavior. You expressed interest in this in another thread so I thought I'd share.

I will likely get back around to this later this week and take a swing at patching it.

Motivation for this change

Update hy to most recent version, share work in progress.

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.

@dotlambda
Copy link
Member

I'd recommend reporting this upstream.

@nixy
Copy link
Contributor Author

nixy commented Apr 2, 2019

The following PR to hy should resolve this:

hylang/hy#1767

@nixy
Copy link
Contributor Author

nixy commented Apr 13, 2019

@FRidh This has been updated to work in upstream and I'm applying the patch in Nix till their next release.

I believe this should be good now as the binary works as intended

@nixy nixy changed the title [WIP] hy: 0.15 -> 0.16 hy: 0.15 -> 0.16 Apr 13, 2019
@FRidh
Copy link
Member

FRidh commented Apr 13, 2019

typically we prefer to fetch a patch instead of including it in the Nixpkgs source tree.

@c0bw3b
Copy link
Contributor

c0bw3b commented May 1, 2019

@GrahamcOfBorg eval

@c0bw3b
Copy link
Contributor

c0bw3b commented May 1, 2019

@GrahamcOfBorg build hy

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

6 participants