* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
@ 2022-01-05 9:37 ` Marie-Joseph
2022-01-06 8:03 ` [PR PATCH] [Updated] " Marie-Joseph
` (24 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-05 9:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1005525059
Comment:
I was afraid this would fail a couple tests, but this is just embarrassing. And I forgot to lint! I always forget to lint...
It may be a day or two before I can get to this, but I will.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PR PATCH] [Updated] racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
2022-01-05 9:37 ` Marie-Joseph
@ 2022-01-06 8:03 ` Marie-Joseph
2022-01-06 8:05 ` Marie-Joseph
` (23 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-06 8:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]
There is an updated pull request by Marie-Joseph against master on the void-packages repository
https://github.com/Marie-Joseph/void-packages racket
https://github.com/void-linux/void-packages/pull/34853
racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* put documentation behind a switch (builds fine, takes too long for CI)
#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for these architectures:
- aarch64-musl - native and cross
- x86_64-musl - native
### Notes
Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress.
I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I used local documentation heavily, so this is important to me.)
A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-racket-34853.patch --]
[-- Type: text/x-diff, Size: 3476 bytes --]
From 86c917a3adcacfbb5e7dbe2b2ddec3bf5153c0eb Mon Sep 17 00:00:00 2001
From: jts <jtsims@pm.me>
Date: Tue, 4 Jan 2022 21:18:42 +0000
Subject: [PATCH] racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's ChezScheme support)
* remove unneeded musl deps
* put documentation behind a switch (builds fine, takes too long)
---
srcpkgs/racket/template | 64 ++++++++++++++++++++++++++---------------
1 file changed, 41 insertions(+), 23 deletions(-)
diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template
index fa837398b7c9..28f9d8c4cc50 100644
--- a/srcpkgs/racket/template
+++ b/srcpkgs/racket/template
@@ -1,10 +1,12 @@
# Template file for 'racket'
pkgname=racket
version=8.3
-revision=1
+revision=2
+archs="~mips* ~ppc*"
+wrksrc=${pkgname}-${version}
build_wrksrc=src
build_style=gnu-configure
-configure_args="--enable-useprefix --disable-docs"
+configure_args="--enable-useprefix $(vopt_enable docs)"
hostmakedepends="gsfonts"
makedepends="sqlite-devel gtk+3-devel"
depends="gtk+3 libssl1.1"
@@ -15,28 +17,43 @@ homepage="http://racket-lang.org/"
distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz"
checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457
nostrip=yes
-nocross=yes
+
+build_options="docs"
+desc_option_docs="Build documentation. Disabled by default for time."
if [ "$CROSS_BUILD" ]; then
- configure_args+=" --enable-racket=/usr/bin/racket"
+ _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}"
+
+ configure_args+=" --enable-racket=/usr/bin/racket
+ --enable-scheme=${_chezscheme_path}"
hostmakedepends+=" racket sqlite-devel"
-fi
-case "$XBPS_TARGET_MACHINE" in
-ppc*)
- broken="hangs or segfaults";;
-*-musl)
- makedepends+=" libucontext-devel";;
-esac
-
-pre_configure() {
- case "$XBPS_TARGET_MACHINE" in
- *-musl)
- export CFLAGS+=" -D_GNU_SOURCE"
- export LIBS+=" -lucontext"
- ;;
- esac
-}
+ # Build ChezScheme for the host so we can use it to build Racket
+ # Using "--enable-racket=auto" above selects the wrong compiler toolchain
+ pre_build() {
+ # Make sure we don't get lost
+ _correct_position=$(pwd)
+ cd ${_chezscheme_path}/ChezScheme
+
+ # If this builds the wrong arch, Racket's automatic
+ # arch detection for the ChezScheme build has failed.
+ # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System"
+ # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types"
+ # for the "machine-type" variable that needs to be passed to rktboot/main.rkt
+ racket rktboot/main.rkt
+ # Make sure Chez builds natively
+ env CC="gcc" \
+ AR="ar" \
+ ARFLAGS="rc" \
+ RANLIB="ranlib" \
+ CFLAGS="-m64 -O2 -D_REENTRANT -pthread" \
+ -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \
+ ./configure --disable-curses --disable-x11
+ make
+
+ cd ${_correct_position}
+ }
+fi
post_install() {
vlicense LICENSE-libscheme.txt
@@ -47,9 +64,10 @@ racket-doc_package() {
short_desc+=" - documentation"
depends="racket>=${version}_${revision}"
pkg_install() {
- # Remove once --disable-doc can be removed
- echo "Documentation currently not available." \
- > ${DESTDIR}/usr/share/doc/racket/no-doc.txt
+ if [ ! "$build_option_docs" ]; then
+ echo "Build using xbps-src with '-o docs' for documentation." \
+ > ${DESTDIR}/usr/share/doc/racket/no-doc.txt
+ fi
vmove usr/share/doc/racket
}
}
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
2022-01-05 9:37 ` Marie-Joseph
2022-01-06 8:03 ` [PR PATCH] [Updated] " Marie-Joseph
@ 2022-01-06 8:05 ` Marie-Joseph
2022-01-06 12:05 ` Marie-Joseph
` (22 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-06 8:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006359952
Comment:
Hmm, don't put comments after lines of commands broken up over multiple lines... Also do as the instructions say and build *exactly* what you commit, not just what you commit minus comments...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (2 preceding siblings ...)
2022-01-06 8:05 ` Marie-Joseph
@ 2022-01-06 12:05 ` Marie-Joseph
2022-01-06 12:26 ` ericonr
` (21 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-06 12:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006528461
Comment:
I'm tempted to try CI with PPC 32-bit enabled, but I feel like that's probably wasteful of resources. It shouldn't fail, I just didn't want to build half of a userland to find out.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (3 preceding siblings ...)
2022-01-06 12:05 ` Marie-Joseph
@ 2022-01-06 12:26 ` ericonr
2022-01-09 16:38 ` leahneukirchen
` (20 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: ericonr @ 2022-01-06 12:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006544637
Comment:
You can try using void-ppc's repos, if you want. But regardless, it's also being deprecated there.
I will try to review this soon, thanks for the nice work!
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (4 preceding siblings ...)
2022-01-06 12:26 ` ericonr
@ 2022-01-09 16:38 ` leahneukirchen
2022-01-09 17:14 ` q66
` (19 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: leahneukirchen @ 2022-01-09 16:38 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 182 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008332676
Comment:
So ucontext isn't needed anymore?
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (5 preceding siblings ...)
2022-01-09 16:38 ` leahneukirchen
@ 2022-01-09 17:14 ` q66
2022-01-09 17:15 ` q66
` (18 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-09 17:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338438
Comment:
the archs pattern is bad, it does not work this way in xbps-src (arch passes as long as there is at least one entry that matches)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (6 preceding siblings ...)
2022-01-09 17:14 ` q66
@ 2022-01-09 17:15 ` q66
2022-01-09 17:16 ` q66
` (17 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-09 17:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 313 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338438
Comment:
the archs pattern is bad, it does not work this way in xbps-src (arch passes as long as there is at least one entry that matches - i.e. ppc would match as it matches not mips)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (7 preceding siblings ...)
2022-01-09 17:15 ` q66
@ 2022-01-09 17:16 ` q66
2022-01-09 17:24 ` leahneukirchen
` (16 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-09 17:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338755
Comment:
is chez scheme known to work on any ppc arches? if yes, then it should not be disabled this way
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (8 preceding siblings ...)
2022-01-09 17:16 ` q66
@ 2022-01-09 17:24 ` leahneukirchen
2022-01-09 17:40 ` q66
` (15 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: leahneukirchen @ 2022-01-09 17:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 177 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008340034
Comment:
The manual mentions ppc32le.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (9 preceding siblings ...)
2022-01-09 17:24 ` leahneukirchen
@ 2022-01-09 17:40 ` q66
2022-01-09 17:45 ` q66
` (14 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-09 17:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008342568
Comment:
i think "le" probably means "linux environment" or something along those lines here, rather than "little endian" :p
nevertheless, it appears to be missing the boot files anyway
so the archs should be set only for those that ship those files, rather than excluding
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (10 preceding siblings ...)
2022-01-09 17:40 ` q66
@ 2022-01-09 17:45 ` q66
2022-01-09 18:02 ` leahneukirchen
` (13 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-09 17:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008342568
Comment:
i think "le" probably means "linux environment" or something along those lines here, rather than "little endian" :p
nevertheless, it appears to be missing the boot files anyway
so the archs should be set only for those that ship those files, rather than excluding (i.e. sth like `x86_64* aarch64* i686* arm*`)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (11 preceding siblings ...)
2022-01-09 17:45 ` q66
@ 2022-01-09 18:02 ` leahneukirchen
2022-01-10 22:43 ` Marie-Joseph
` (12 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: leahneukirchen @ 2022-01-09 18:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 261 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008346242
Comment:
Aha, https://github.com/cisco/ChezScheme/blob/2077454566b0a845ee5804806c4ac94ad80984fd/s/ppc32le.def#L44
Yes.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (12 preceding siblings ...)
2022-01-09 18:02 ` leahneukirchen
@ 2022-01-10 22:43 ` Marie-Joseph
2022-01-10 22:49 ` Marie-Joseph
` (11 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-10 22:43 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 621 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009420032
Comment:
> So ucontext isn't needed anymore?
Apparently not, see https://github.com/racket/racket/issues/4100#issuecomment-1003784010
> the archs pattern is bad
It seems to work for CI, but I'll change it to be safe
> [ppc] should not be disabled this way
How should it be disabled? As I mentioned, the only reason I disabled it is build time. If that's not an issue, I can turn it back on (though only for 32-bit big-endian versions because that's what Chez supports)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (13 preceding siblings ...)
2022-01-10 22:43 ` Marie-Joseph
@ 2022-01-10 22:49 ` Marie-Joseph
2022-01-10 22:55 ` Marie-Joseph
` (10 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-10 22:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009423150
Comment:
Also, wrt boot files, if you mean Chez Scheme boot files, those are generated by `racket rktboot/main.rkt`. It does other things, if I'm not mistaken, but among them is doing that.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (14 preceding siblings ...)
2022-01-10 22:49 ` Marie-Joseph
@ 2022-01-10 22:55 ` Marie-Joseph
2022-01-10 23:07 ` Marie-Joseph
` (9 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-10 22:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009423150
Comment:
Also, wrt boot files, if you mean Chez Scheme boot files, those are generated by `racket rktboot/main.rkt`. It does other things, if I'm not mistaken, but among them is doing that. This is among the numerous differences between Cisco's Chez and Racket's Chez: https://github.com/racket/ChezScheme (at the bottom of the README)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (15 preceding siblings ...)
2022-01-10 22:55 ` Marie-Joseph
@ 2022-01-10 23:07 ` Marie-Joseph
2022-01-10 23:13 ` Marie-Joseph
` (8 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-10 23:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009434203
Comment:
I just noticed that in line 49, that `-m64` flag only gets by CI because cross builds use 64-bit hosts. That'll be changed to `-m${XBPS_WORDSIZE}`.
If anyone notices other things like that in the values passed to `env`, please let me know. I literally just copied the env passed to configure in the default build and changed the libraries and binaries to host versions (so instead of eg aarch64-musl-gcc it's just gcc, etc).
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (16 preceding siblings ...)
2022-01-10 23:07 ` Marie-Joseph
@ 2022-01-10 23:13 ` Marie-Joseph
2022-01-14 1:03 ` Marie-Joseph
` (7 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-10 23:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 660 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009420032
Comment:
> So ucontext isn't needed anymore?
Apparently not, see https://github.com/racket/racket/issues/4100#issuecomment-1003784010
> the archs pattern is bad
I'll change it. Why does it work for CI? (Trying to gain insights into xbps-src where I can!)
> [ppc] should not be disabled this way
How should it be disabled? As I mentioned, the only reason I disabled it is build time. If that's not an issue, I can turn it back on (though only for 32-bit big-endian versions because that's what Chez supports)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (17 preceding siblings ...)
2022-01-10 23:13 ` Marie-Joseph
@ 2022-01-14 1:03 ` Marie-Joseph
2022-01-14 2:41 ` q66
` (6 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-14 1:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1012656068
Comment:
@q66 just waiting on your feedback RE ppc to make changes. Specifically, whether or not I should enable the ppc arch (but not ppc-musl, I see now from void-ppc) and, if not, how I should disable it.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (18 preceding siblings ...)
2022-01-14 1:03 ` Marie-Joseph
@ 2022-01-14 2:41 ` q66
2022-01-14 8:21 ` [PR PATCH] [Updated] " Marie-Joseph
` (5 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: q66 @ 2022-01-14 2:41 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1012698419
Comment:
you should do what I said, i.e. `x86_64* aarch64* i686* arm*`
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PR PATCH] [Updated] racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (19 preceding siblings ...)
2022-01-14 2:41 ` q66
@ 2022-01-14 8:21 ` Marie-Joseph
2022-01-14 8:25 ` Marie-Joseph
` (4 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-14 8:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
There is an updated pull request by Marie-Joseph against master on the void-packages repository
https://github.com/Marie-Joseph/void-packages racket
https://github.com/void-linux/void-packages/pull/34853
racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* put documentation behind a switch (builds fine, takes too long for CI)
#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for these architectures:
- aarch64-musl - native and cross
- x86_64-musl - native
### Notes
Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress.
I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.)
A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-racket-34853.patch --]
[-- Type: text/x-diff, Size: 3191 bytes --]
From 00a92e144304204a3166ce5b8db4d0f7dc4b3cf0 Mon Sep 17 00:00:00 2001
From: jts <jtsims@pm.me>
Date: Tue, 4 Jan 2022 21:18:42 +0000
Subject: [PATCH] racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* enable documentation
---
srcpkgs/racket/template | 55 ++++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template
index fa837398b7c9..7123be16bc97 100644
--- a/srcpkgs/racket/template
+++ b/srcpkgs/racket/template
@@ -1,10 +1,12 @@
# Template file for 'racket'
pkgname=racket
version=8.3
-revision=1
+revision=2
+archs="aarch64* armv6* armv7* i686* x86_64*"
+wrksrc=${pkgname}-${version}
build_wrksrc=src
build_style=gnu-configure
-configure_args="--enable-useprefix --disable-docs"
+configure_args="--enable-useprefix"
hostmakedepends="gsfonts"
makedepends="sqlite-devel gtk+3-devel"
depends="gtk+3 libssl1.1"
@@ -15,28 +17,40 @@ homepage="http://racket-lang.org/"
distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz"
checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457
nostrip=yes
-nocross=yes
if [ "$CROSS_BUILD" ]; then
- configure_args+=" --enable-racket=/usr/bin/racket"
+ _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}"
+
+ configure_args+=" --enable-racket=/usr/bin/racket
+ --enable-scheme=${_chezscheme_path}"
hostmakedepends+=" racket sqlite-devel"
-fi
-case "$XBPS_TARGET_MACHINE" in
-ppc*)
- broken="hangs or segfaults";;
-*-musl)
- makedepends+=" libucontext-devel";;
-esac
+ # Build ChezScheme for the host so we can use it to build Racket
+ # Using "--enable-racket=auto" above selects the wrong compiler toolchain
+ pre_build() {
+ # Make sure we don't get lost
+ _correct_position=$(pwd)
+ cd ${_chezscheme_path}/ChezScheme
-pre_configure() {
- case "$XBPS_TARGET_MACHINE" in
- *-musl)
- export CFLAGS+=" -D_GNU_SOURCE"
- export LIBS+=" -lucontext"
- ;;
- esac
-}
+ # If this builds the wrong arch, Racket's automatic
+ # arch detection for the ChezScheme build has failed.
+ # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System"
+ # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types"
+ # for the "machine-type" variable that needs to be passed to rktboot/main.rkt
+ racket rktboot/main.rkt
+ # Make sure Chez builds natively
+ env CC="gcc" \
+ AR="ar" \
+ ARFLAGS="rc" \
+ RANLIB="ranlib" \
+ CFLAGS="-m${XBPS_WORDSIZE} -O2 -D_REENTRANT -pthread" \
+ -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \
+ ./configure --disable-curses --disable-x11
+ make
+
+ cd ${_correct_position}
+ }
+fi
post_install() {
vlicense LICENSE-libscheme.txt
@@ -47,9 +61,6 @@ racket-doc_package() {
short_desc+=" - documentation"
depends="racket>=${version}_${revision}"
pkg_install() {
- # Remove once --disable-doc can be removed
- echo "Documentation currently not available." \
- > ${DESTDIR}/usr/share/doc/racket/no-doc.txt
vmove usr/share/doc/racket
}
}
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PR PATCH] [Updated] racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (20 preceding siblings ...)
2022-01-14 8:21 ` [PR PATCH] [Updated] " Marie-Joseph
@ 2022-01-14 8:25 ` Marie-Joseph
2022-01-14 16:46 ` leahneukirchen
` (3 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-14 8:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
There is an updated pull request by Marie-Joseph against master on the void-packages repository
https://github.com/Marie-Joseph/void-packages racket
https://github.com/void-linux/void-packages/pull/34853
racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* put documentation behind a switch (builds fine, takes too long for CI)
#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for these architectures:
- aarch64-musl - native and cross
- x86_64-musl - native
### Notes
Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress.
I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.)
A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-racket-34853.patch --]
[-- Type: text/x-diff, Size: 3191 bytes --]
From 2aaf9a1971466a1b789b3975cce9a81f920249a7 Mon Sep 17 00:00:00 2001
From: jts <jtsims@pm.me>
Date: Tue, 4 Jan 2022 21:18:42 +0000
Subject: [PATCH] racket: re-enable cross-compilation
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* enable documentation
---
srcpkgs/racket/template | 55 ++++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template
index fa837398b7c9..7123be16bc97 100644
--- a/srcpkgs/racket/template
+++ b/srcpkgs/racket/template
@@ -1,10 +1,12 @@
# Template file for 'racket'
pkgname=racket
version=8.3
-revision=1
+revision=2
+archs="aarch64* armv6* armv7* i686* x86_64*"
+wrksrc=${pkgname}-${version}
build_wrksrc=src
build_style=gnu-configure
-configure_args="--enable-useprefix --disable-docs"
+configure_args="--enable-useprefix"
hostmakedepends="gsfonts"
makedepends="sqlite-devel gtk+3-devel"
depends="gtk+3 libssl1.1"
@@ -15,28 +17,40 @@ homepage="http://racket-lang.org/"
distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz"
checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457
nostrip=yes
-nocross=yes
if [ "$CROSS_BUILD" ]; then
- configure_args+=" --enable-racket=/usr/bin/racket"
+ _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}"
+
+ configure_args+=" --enable-racket=/usr/bin/racket
+ --enable-scheme=${_chezscheme_path}"
hostmakedepends+=" racket sqlite-devel"
-fi
-case "$XBPS_TARGET_MACHINE" in
-ppc*)
- broken="hangs or segfaults";;
-*-musl)
- makedepends+=" libucontext-devel";;
-esac
+ # Build ChezScheme for the host so we can use it to build Racket
+ # Using "--enable-racket=auto" above selects the wrong compiler toolchain
+ pre_build() {
+ # Make sure we don't get lost
+ _correct_position=$(pwd)
+ cd ${_chezscheme_path}/ChezScheme
-pre_configure() {
- case "$XBPS_TARGET_MACHINE" in
- *-musl)
- export CFLAGS+=" -D_GNU_SOURCE"
- export LIBS+=" -lucontext"
- ;;
- esac
-}
+ # If this builds the wrong arch, Racket's automatic
+ # arch detection for the ChezScheme build has failed.
+ # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System"
+ # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types"
+ # for the "machine-type" variable that needs to be passed to rktboot/main.rkt
+ racket rktboot/main.rkt
+ # Make sure Chez builds natively
+ env CC="gcc" \
+ AR="ar" \
+ ARFLAGS="rc" \
+ RANLIB="ranlib" \
+ CFLAGS="-m${XBPS_WORDSIZE} -O2 -D_REENTRANT -pthread" \
+ -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \
+ ./configure --disable-curses --disable-x11
+ make
+
+ cd ${_correct_position}
+ }
+fi
post_install() {
vlicense LICENSE-libscheme.txt
@@ -47,9 +61,6 @@ racket-doc_package() {
short_desc+=" - documentation"
depends="racket>=${version}_${revision}"
pkg_install() {
- # Remove once --disable-doc can be removed
- echo "Documentation currently not available." \
- > ${DESTDIR}/usr/share/doc/racket/no-doc.txt
vmove usr/share/doc/racket
}
}
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (21 preceding siblings ...)
2022-01-14 8:25 ` Marie-Joseph
@ 2022-01-14 16:46 ` leahneukirchen
2022-01-15 6:53 ` Marie-Joseph
` (2 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: leahneukirchen @ 2022-01-14 16:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013286270
Comment:
Looks pretty good, but i'm worried about all the Pango warnings in the logs. Can you verify the generated images have text?
Perhaps liberation-fonts-ttf or something is needed.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (22 preceding siblings ...)
2022-01-14 16:46 ` leahneukirchen
@ 2022-01-15 6:53 ` Marie-Joseph
2022-01-15 6:56 ` Marie-Joseph
2022-01-16 14:37 ` [PR PATCH] [Merged]: " leahneukirchen
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-15 6:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 207 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013627024
Comment:
I am using them and can confirm they have text and images :)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (23 preceding siblings ...)
2022-01-15 6:53 ` Marie-Joseph
@ 2022-01-15 6:56 ` Marie-Joseph
2022-01-16 14:37 ` [PR PATCH] [Merged]: " leahneukirchen
25 siblings, 0 replies; 27+ messages in thread
From: Marie-Joseph @ 2022-01-15 6:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 315 bytes --]
New comment by Marie-Joseph on void-packages repository
https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013627024
Comment:
I am using them and can confirm they have text and images. It may be using fallback fonts, though. I'll try adding some font dependencies and see if that helps, though.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PR PATCH] [Merged]: racket: re-enable cross-compilation
2022-01-04 21:28 [PR PATCH] racket: re-enable cross-compilation Marie-Joseph
` (24 preceding siblings ...)
2022-01-15 6:56 ` Marie-Joseph
@ 2022-01-16 14:37 ` leahneukirchen
25 siblings, 0 replies; 27+ messages in thread
From: leahneukirchen @ 2022-01-16 14:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]
There's a merged pull request on the void-packages repository
racket: re-enable cross-compilation
https://github.com/void-linux/void-packages/pull/34853
Description:
* remove nocross
* expound precise arch support (based on Racket's Chez Scheme support)
* remove unneeded musl deps
* put documentation behind a switch (builds fine, takes too long for CI)
#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for these architectures:
- aarch64-musl - native and cross
- x86_64-musl - native
### Notes
Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress.
I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.)
^ permalink raw reply [flat|nested] 27+ messages in thread