On 13/07/16 05:20, Marc Burns wrote:
Hi all,

I remember this topic came up on the list a while back. I've made a
Docker image of the latest Racket from alpine 3.3 with just musl libc. I
had to monkey patch some Racket internals to get this working, so it
might be badly and subtly broken. Feedback is appreciated!

Dockerfile etc.: https://github.com/m4burns/racket-docker
Docker repo: https://hub.docker.com/r/m4burns/racket/

The size is a little bit of an improvement over Jack Firth's images (35
vs 22 mb). I'm not sure it's worth the uncertainty of using musl instead
of glibc.

Great work!. Just a few comments:
- Install "libffi", "libffi-dev" and add "--enable-libffi" in the configure script. It's always better to use the native libffi instead of the bundled version in Racket. - Change "-O3" to "-O2". O3 could expose compiler bugs and Racket will not perform better (because you're using the jit, not a simple C interpreter). - You could send a pull request with the changes within a special C define. Something like this:

#if defined(__x86_64__)
# define MZ_USE_JIT_X86_64
# define MZ_JIT_USE_MPROTECT
# if !defined(__musl_libc__)
#  define MZ_USE_DWARF_LIBUNWIND
# endif
#endif

Then you could add CPPFLAGS="-D__musl_libc__" to configure instead of patching the files. Unfortunately, musl doesn't define its own name for preprocessor use, so you need to invent your own define.



For reference for Racket developers, the only test which fails with musl and Marc's config is file.rktl:

(#<procedure:directory-exists?> #<path:x/y>) ==> #f
(#<procedure:file-exists?> #<path:x/y/z>) ==> #f
(#<procedure:directory-exists?> #<path:x/y>) ==> #t
(#<procedure:directory-exists?> #<path:x/y>) ==> #f
(#<procedure:directory-exists?> #<path:x/y>) ==> #t
(#<procedure:directory-exists?> #<path:x/y/z>) ==> #t
(#<procedure:directory-exists?> #<path:./x/y>) ==> #f
(#<procedure:file-exists?> #<path:./x/y/z>) ==> #f
(#<procedure:directory-exists?> #<path:./x/y>) ==> #t
(#<procedure:directory-exists?> #<path:./x/y>) ==> #f
(#<procedure:directory-exists?> #<path:./x/y>) ==> #t
(#<procedure:directory-exists?> #<path:./x/y/z>) ==> #t
(#<procedure:directory-exists?> #<path:/var/tmp/check-make-14684309681468430968352/nonesuch/>) ==> #f (make-directory* "z") =e=> "make-directory: cannot make directory\n path: /var/tmp/check-make-14684309681468430968352/nonesuch/z\n system error: No such file or directory; errno=2"
(for ((v (in-directory sub))) v)  =e=> (values #<void>) BUT EXPECTED ERROR
(in-directory (#<path:/var/tmp/in-dir-tmp-dir849/sub>)) ==> (#<path:/var/tmp/in-dir-tmp-dir849/sub>) (#<procedure:exn?> #(struct:exn:fail:filesystem:errno "a" #<continuation-mark-set> (10 . posix))) ==> #t (exn:fail:filesystem:errno "a" (current-continuation-marks) 10) =e=> "exn:fail:filesystem:errno: contract violation\n expected: (cons/c exact-integer? (or/c 'posix 'windows 'gai))\n given: 10" (exn:fail:filesystem:errno "a" (current-continuation-marks) (quote (10 posix))) =e=> "exn:fail:filesystem:errno: contract violation\n expected: (cons/c exact-integer? (or/c 'posix 'windows 'gai))\n given: '(10 posix)" (exn:fail:filesystem:errno "a" (current-continuation-marks) (quote (10))) =e=> "exn:fail:filesystem:errno: contract violation\n expected: (cons/c exact-integer? (or/c 'posix 'windows 'gai))\n given: '(10)" (exn:fail:filesystem:errno "a" (current-continuation-marks) (quote #(10))) =e=> "exn:fail:filesystem:errno: contract violation\n expected: (cons/c exact-integer? (or/c 'posix 'windows 'gai))\n given: '#(10)"
expected an error

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to