I ran raco-cross (installed on racket cs 8.0 [does this cause trouble for racket cs < 8.2 or is it fine because host and target are both bc?]) to run exe and dist:
;; install dependencies raco cross --workspace /tmp/todays-snapshot --target i386-win32 --vm bc pkg install ;; create exe raco cross --workspace /tmp/todays-snapshot --target i386-win32 --vm bc exe myapp.rkt ;; create dist raco cross --workspace /tmp/todays-snapshot --target i386-win32 --vm bc dist myapp-i386-win32-bc myapp.exe >> Cross configuration Target: i386-win32 Host: x86_64-linux Version: 8.0 VM: bc Workspace: /tmp/todays-snapshot On windows: 1. I had to add the lib subfolder in the dist to the path (else the exe would not find the dlls in there). 2. Copy the dlls from /tmp/todays-snapshot/i386-win32-bc/lib/ to the lib subfolder. [I also tried `raco exe --embed-dlls` but then the libs from 2. are missing from the executable, do I need to run future raco-cross at version cs 8.2 so that this part works, or could I use bc to make it work?] After that the program ran for a bit allowed me to select a directory and then crashed with an exception, probably this is a bug in my application that is windows specific. I need to check that. I also tried the utah snapshots but they don't have i386 builds and the windows7 vm is 32bit, I might also test with 64bit windows10 vm, I am currently downloading it. https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (in case other people need the link to the test vms, they are for ie testing but you can test other things with it) Anyways so far the experience has been quite good compared to my tries without raco-cross maybe a year ago. schle...@gmail.com schrieb am Samstag, 15. Mai 2021 um 01:44:11 UTC+2: > This is like being a child, waking up and realizing its christmas (and > easter at the same time), > thank you for working on this, I will test out this shiny new toy/gift > (meant in the best possible way). > > Because I am on linux, I will try to cross compile to windows (time to > dust off my windows vm for testing ;)) > > Matthew Flatt schrieb am Donnerstag, 13. Mai 2021 um 17:54:40 UTC+2: > >> While `raco exe` in v8.1 very nearly supports cross-builds of Racket >> executables[*], it's not easy to pass the right flags and set up the >> needed target-platform distributions. >> >> The `raco cross` command provided by the new "raco-cross" package wraps >> Racket tools to simplify all of that management. For example, >> >> raco cross --target x86_64-linux --vm bc exe example.rkt >> >> is like running >> >> raco exe example.rkt >> >> but it cross-builds for x86_64 Linux. That build process involves >> downloading a minimal racket tarball for the target platform, >> installing "compiler-lib" there, downloading a matching minimal build >> of Racket for the host platform, and then running the host Racket in >> cross-build mode with installed target distribution --- but, again, >> `raco cross` takes care of all that. >> >> Just like using `raco exe` on Linux, the generated executable won't >> actually work on other machines until you package it in a distribution >> using `raco dist`: >> >> raco cross --target x86_64-linux --vm bc dist example-dist example >> >> Naturally, this second invocation of `raco cross` for the same target >> uses the installations prepared by the first `raco cross`, so it's >> relatively fast. >> >> >> I expect that `raco cross` will become more useful after the v8.2 >> release, which will repair cross-compilation for CS executables and >> executables with native libraries (like GUI executables). Meanwhile, >> it's possible to use `raco cross` with snapshot builds, but you have to >> point it at a snapshot site; see the documentation for more >> information. >> >> >> Because juggling multiple installations and versions is a lot of the >> work for cross-compilation, `raco cross` can also be a way to get to a >> different version of Racket in minimal form. For example, >> >> raco cross --version 8.0 racket >> >> starts a Racket v8.0 prompt. (The `racket` command is treated specially >> by `raco cross`. All other commands are prefixed by `raco`.) >> >> >> For more information see >> >> https://docs.racket-lang.org/raco-cross/index.html >> >> >> [*] Running a cross-built CS executable fails at the very last step of >> startup, and that's due to an expander bug for handling top-level >> `begin` forms compiled in machine-independent form. We didn't >> detect this problem before, because it wasn't part of Bogdan's use >> case for cross builds, and because cross-compilation was painful >> enough that we didn't actually try other cases. >> > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/58d4b968-1bd5-4bbe-b37f-8440a86b350dn%40googlegroups.com.