changelog shortlog graph tags branches files raw help

Mercurial > infra / changeset: build scripts

changeset 16: 87dd4724adfb
parent 15: 17a70918610c
child 17: aac1cf6cf2bb
author: ellis <ellis@rwest.io>
date: Mon, 27 Nov 2023 23:47:58 -0500
files: makefile scripts/build-emacs.sh scripts/bundle-dir.sh scripts/get-emacs.sh scripts/get-rocksdb.sh scripts/get-rust.sh
description: build scripts
     1.1--- a/makefile	Mon Nov 27 22:33:13 2023 -0500
     1.2+++ b/makefile	Mon Nov 27 23:47:58 2023 -0500
     1.3@@ -5,6 +5,8 @@
     1.4 ROCKSDB_VERSION:=main
     1.5 SBCL_VERSION:=main
     1.6 RUST_VERSION:=main
     1.7+B:=build
     1.8+D:=dist
     1.9 SRC:=comp
    1.10 SHELL=/bin/sh
    1.11 UNAME=$(shell uname)
    1.12@@ -17,7 +19,7 @@
    1.13 
    1.14 all:linux emacs rocksdb sbcl rust code virt dist;
    1.15 
    1.16-clean:linux-clean code-clean dist-clean;
    1.17+clean:clean-linux clean-code clean-dist;
    1.18 
    1.19 ### Linux
    1.20 LINUX_TARGET:=linux-$(LINUX_VERSION)
    1.21@@ -30,17 +32,30 @@
    1.22 	cd build && unxz $@.tar.xz && tar -xvf $@.tar $(LINUX_TARGET)
    1.23 linux-config:$(LINUX_TARGET);
    1.24 	cd build/$< && make mrproper -j && zcat /proc/config.gz > .config && yes N | make localmodconfig
    1.25-linux-clean::;rm -rf build/$(LINUX_TARGET)*
    1.26+clean-linux::;rm -rf build/$(LINUX_TARGET)*
    1.27 
    1.28 ### Emacs
    1.29-EMACS_TARGET:=emacs-$(EMACS_VERSION)
    1.30+EMACS_TARGET:=build/src/emacs-$(EMACS_VERSION)
    1.31+EMACS_DIST:=$(DIST)/src/emacs
    1.32 emacs:scripts/get-emacs.sh;
    1.33 	$< $(EMACS_VERSION)
    1.34 
    1.35+emacs-build:emacs scripts/build-emacs.sh;
    1.36+	cd $(EMACS_TARGET)
    1.37+	./autogen.sh
    1.38+	mkdir -pv $(EMACS_DIST)
    1.39+	scripts/build-emacs.sh $(EMACS_VERSION) $(EMACS_TARGET) $(EMACS_DIST)
    1.40+
    1.41+emacs-install:emacs-build;
    1.42+	cd $(EMACS_DIST)
    1.43+	make install
    1.44+
    1.45 ### RocksDB
    1.46-ROCKSDB_TARGET:=rocksdb-$(ROCKSDB_VERSION)
    1.47+ROCKSDB_TARGET:=build/src/rocksdb-$(ROCKSDB_VERSION)
    1.48 rocksdb:scripts/get-rocksdb.sh;
    1.49 	$< $(ROCKSDB_VERSION)
    1.50+	cd $(ROCKSDB_TARGET) 
    1.51+	make shared_lib DISABLE_JEMALLOC=1
    1.52 
    1.53 ### SBCL
    1.54 SBCL_TARGET:=sbcl-$(SBCL_VERSION)
    1.55@@ -48,29 +63,29 @@
    1.56 	$< $(SBCL_VERSION)
    1.57 
    1.58 ### Rust
    1.59-RUST_TARGET:=rust-$(RUST_VERSION)
    1.60+RUST_TARGET:=build/src/rust-$(RUST_VERSION)
    1.61 rust:scripts/get-rust.sh
    1.62 	$< $(RUST_VERSION)
    1.63-rust-install-x:rust;
    1.64-	cargo install --path build/$(RUST_TARGET)/src/tools/x
    1.65+rust-x:rust;
    1.66+	cargo install --path $(RUST_TARGET)/src/tools/x
    1.67 rust-build:rust rust-install-x;
    1.68-	cd build/$(RUST_TARGET) && x build library
    1.69+	cd $(RUST_TARGET) && x build library
    1.70 rust-doc:rust rust-install-x;
    1.71-	cd build/$(RUST_TARGET) && x doc
    1.72+	cd $(RUST_TARGET) && x doc
    1.73 rust-build-full:rust-build;
    1.74-	cd build/$(RUST_TARGET) && x build --stage 2 compiler/rustc
    1.75+	cd $(RUST_TARGET) && x build --stage 2 compiler/rustc
    1.76 rust-install:rust-build;
    1.77-	cd build/$(RUST_TARGET) && x install
    1.78-rust-dist:rust-build;
    1.79-	cd build/$(RUST_TARGET) && x dist
    1.80+	cd $(RUST_TARGET) && x install
    1.81+
    1.82 ### Code
    1.83+CODE_TARGET:=build/src/$(SRC)
    1.84 code:scripts/get-code.sh
    1.85 	$< $(SRC)
    1.86 
    1.87-code-clean::;rm -rf build/$(SRC)*
    1.88+clean-code::;rm -rf $(CODE_TARGET)/*
    1.89 
    1.90 ### Virt
    1.91-pod:virt/build-pod.sh
    1.92+dev-pod:virt/build-pod.sh
    1.93 	$<
    1.94 archlinux:virt/build-archlinux-base.sh
    1.95 	$<
    1.96@@ -85,16 +100,16 @@
    1.97 heptapod-runner:virt/build-heptapod-runner.sh
    1.98 	$<
    1.99 
   1.100-vc:heptapod heptapod-runner
   1.101+vc-pod:heptapod heptapod-runner
   1.102 
   1.103 virt:pod box bbdb vc
   1.104-### Web
   1.105 
   1.106 ### Dist
   1.107-dist/comp:scripts/bundle-dir.sh
   1.108+dist/bundle:scripts/bundle-dir.sh
   1.109 	$<
   1.110 
   1.111 dist/cdn:cdn
   1.112+	mkdir -pv $@
   1.113 	cp -r $^ $@
   1.114 
   1.115 dist/sbcl:sbcl;
   1.116@@ -102,12 +117,18 @@
   1.117 dist/linux:linux;
   1.118 
   1.119 dist/rocksdb:rocksdb;
   1.120+	cd $(ROCKSDB_TARGET)
   1.121+	cp -rf include/* $(D)
   1.122+	cp -f librocksdb.so* $(D)/lib/
   1.123+
   1.124+dist/rust:rust-build;
   1.125+	cd $(RUST_TARGET) && x dist
   1.126 
   1.127 dist/emacs:emacs;
   1.128 
   1.129-dist:dist/comp dist/cdn dist/sbcl dist/linux dist/rocksdb
   1.130+dist:dist/bundle dist/cdn dist/sbcl dist/rocksdb # dist/linux dist/rust
   1.131 
   1.132-dist-clean::;rm -rf dist/*
   1.133+clean-dist::;rm -rf dist/*
   1.134 
   1.135 ### Quickstart
   1.136 quick:code
     2.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2+++ b/scripts/build-emacs.sh	Mon Nov 27 23:47:58 2023 -0500
     2.3@@ -0,0 +1,22 @@
     2.4+#!/usr/bin/bash
     2.5+CPUS=$(shell getconf _NPROCESSORS_ONLN)
     2.6+VER="${1:-main}"
     2.7+TARGETDIR=${2:-$(realpath build/emacs-$VER)}
     2.8+DISTDIR=${3:-$(realpath dist/emacs-$VER)}
     2.9+CONFIG=(--with-mailutils
    2.10+	--with-imagemagick
    2.11+	--with-x-toolkit=gtk
    2.12+	--without-pop
    2.13+	--without-sound
    2.14+	--with-json
    2.15+	--enable-link-time-optimization
    2.16+	--with-native-compilation
    2.17+	--with-modules)
    2.18+pushd $TARGETDIR
    2.19+./autogen.sh
    2.20+mkdir -pv $DISTDIR
    2.21+pushd $DISTDIR
    2.22+$TARGETDIR/configure ${CONFIG[@]} 
    2.23+NATIVE_FULL_AOT=1 make -j$CPUS
    2.24+popd
    2.25+popd
     3.1--- a/scripts/bundle-dir.sh	Mon Nov 27 22:33:13 2023 -0500
     3.2+++ b/scripts/bundle-dir.sh	Mon Nov 27 23:47:58 2023 -0500
     3.3@@ -8,25 +8,28 @@
     3.4 echo "Bundling $BUNDLE_NAME in $OUT..."
     3.5 
     3.6 rm -rf $OUT/*
     3.7-rm -rf $WD/$BUNDLE_NAME.*
     3.8+mkdir -pv $OUT
     3.9 mkdir -pv $WD/vc/{zst,stream}
    3.10 
    3.11 pushd $SRC_PATH
    3.12-# Find all mercurial repositories, create bundles and dump them to $OUT dir
    3.13+# Find all mercurial repositories, create bundles and dump them to $OUT dir.
    3.14 for i in $(find . -name ".hg" | cut -c 3-); do
    3.15-    echo "";
    3.16-    echo $i;
    3.17-
    3.18-    cd "$i";
    3.19-    cd ..;
    3.20-    hg bundle -a -t zstd-v2 $WD/vc/zst/$(basename $(hg root)).hg.zst;
    3.21-    hg bundle -a -t none-v2 $WD/vc/$(basename $(hg root)).hg;
    3.22-    hg debugcreatestreamclonebundle $WD/vc/$(basename $(hg root)).hg.stream;
    3.23-    echo "... Done.";
    3.24+    echo ""
    3.25+    echo "found hg repo: $i"
    3.26+    cd "$i"
    3.27+    cd ..
    3.28+    echo "making zstd-v2 bundle..."
    3.29+    hg bundle -a -t zstd-v2 $WD/vc/zst/$(basename $(hg root)).hg.zst
    3.30+    echo "making none-v2 bundle..."
    3.31+    hg bundle -a -t none-v2 $WD/vc/$(basename $(hg root)).hg
    3.32+    echo "making stream bundle..."
    3.33+    hg debugcreatestreamclonebundle $WD/vc/stream/$(basename $(hg root)).hg.stream
    3.34+    echo "... Done."
    3.35     cd $SRC_PATH
    3.36 done
    3.37 popd
    3.38 pushd $WD
    3.39+# archive all *.hg.zst bundles, final compression with zst
    3.40 tar -I 'zstd' -cf $OUT/$BUNDLE_NAME.tar.zst vc/zst/*.hg.zst
    3.41 # tar -cf $OUT/$BUNDLE_NAME.tar.stream vc/stream/*.hg.stream
    3.42 # tar -cf $OUT/$BUNDLE_NAME.tar vc/*.hg
     4.1--- a/scripts/get-emacs.sh	Mon Nov 27 22:33:13 2023 -0500
     4.2+++ b/scripts/get-emacs.sh	Mon Nov 27 23:47:58 2023 -0500
     4.3@@ -1,25 +1,5 @@
     4.4 #!/usr/bin/bash
     4.5-CPUS=$(shell getconf _NPROCESSORS_ONLN)
     4.6 VER="${1:-main}"
     4.7 TARGETDIR=${2:-$(realpath build/emacs-$VER)}
     4.8-DISTDIR=${3:-$(realpath dist/emacs-$VER)}
     4.9-CONFIG=(--with-mailutils
    4.10-	--with-imagemagick
    4.11-	--with-x-toolkit=gtk
    4.12-	--without-pop
    4.13-	--without-sound
    4.14-	--with-json
    4.15-	--enable-link-time-optimization
    4.16-	--with-native-compilation
    4.17-	--with-modules)
    4.18 
    4.19 git clone https://vc.compiler.company/packy/shed/vendor/emacs.git $TARGETDIR
    4.20-pushd $TARGETDIR
    4.21-./autogen.sh
    4.22-mkdir -pv $DISTDIR
    4.23-pushd $DISTDIR
    4.24-$TARGETDIR/configure ${CONFIG[@]} 
    4.25-NATIVE_FULL_AOT=1 make -j$CPUS
    4.26-# make install
    4.27-popd
    4.28-popd
     5.1--- a/scripts/get-rocksdb.sh	Mon Nov 27 22:33:13 2023 -0500
     5.2+++ b/scripts/get-rocksdb.sh	Mon Nov 27 23:47:58 2023 -0500
     5.3@@ -1,12 +1,4 @@
     5.4 #!/usr/bin/bash
     5.5 VER="${1:-main}"
     5.6-TARGETDIR=${2:-$(realpath build/rocksdb-$VER)}
     5.7-DISTDIR=${3:-$(realpath dist)}
     5.8+TARGETDIR=${2:-$(realpath build/src/rocksdb-$VER)}
     5.9 git clone https://vc.compiler.company/packy/shed/vendor/rocksdb.git $TARGETDIR
    5.10-pushd $TARGETDIR
    5.11-make shared_lib DISABLE_JEMALLOC=1 && 
    5.12-mkdir -pv $DISTDIR/include
    5.13-mkdir -pv $DISTDIR/lib
    5.14-# cp -rf include/* $DISTDIR
    5.15-# cp -f librocksdb.so* $DISTDIR/lib/
    5.16-popd
     6.1--- a/scripts/get-rust.sh	Mon Nov 27 22:33:13 2023 -0500
     6.2+++ b/scripts/get-rust.sh	Mon Nov 27 23:47:58 2023 -0500
     6.3@@ -6,7 +6,4 @@
     6.4 
     6.5 VER="${1:-main}"
     6.6 TARGETDIR=${2:-$(realpath build/rust-$VER)}
     6.7-DISTDIR=${3:-$(realpath dist/rust)}
     6.8 git clone https://vc.compiler.company/packy/shed/vendor/rust.git $TARGETDIR
     6.9-pushd $TARGETDIR
    6.10-popd