devops: Support a flag day for x86-64 host 10.1.10.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sat, 14 Dec 2019 00:46:43 +0000 (17:46 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sat, 14 Dec 2019 04:45:40 +0000 (21:45 -0700)
src/devops/build.scm
src/devops/devops.scm

index fb3ed912ee7567c90b301903228168ff16d6ed8b..82f04cfc825cd63399a09a7407bf00bfb2702685 100644 (file)
@@ -101,9 +101,13 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 (define (build-core-pkg name vers)
   (let ((sarch build-scheme-architecture)
        (pkgdir (string build-dir"/"name"-"vers))
-       (options (if (string-prefix? "svm" build-scheme-architecture)
-                    (string " --enable-native-code="build-scheme-architecture)
-                    "")))
+       (options (string
+                 (if (flag-day?)
+                     " --enable-cross-compiling"
+                     "")
+                 (if (string-prefix? "svm" build-scheme-architecture)
+                     (string " --enable-native-code="build-scheme-architecture)
+                     ""))))
     (run "rm -rf "pkgdir)
     (run "cd "build-dir" && tar xzf "name"-"vers".tar.gz")
     (run "cd "pkgdir"/src && ./configure" options)
@@ -127,7 +131,12 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
   (let ((pkgdir (string build-dir"/"name"-"vers)))
     (run "rm -rf "pkgdir)
     (run "cd "build-dir" && tar xJf "name"_"vers".tar.xz")
-    (run "cd "pkgdir" && dpkg-buildpackage -b -uc")
+    (if (flag-day?)
+       (with-subprocess-environment-variable
+        "CONF_FLAGS" "--enable-cross-compiling"
+        (lambda ()
+          (run "cd "pkgdir" && dpkg-buildpackage -b -uc")))
+       (run "cd "pkgdir" && dpkg-buildpackage -b -uc"))
     (let ((darch build-debian-architecture))
       (set-file-modes! (string build-dir"/"name"_"vers"_"darch".deb") #o444)
       (set-file-modes! (string build-dir"/"name"_"vers"_"darch".changes") #o444)
@@ -138,6 +147,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
       (run "rm -rf "pkgdir)
       (run "sudo "project-name"-install "name"_"vers"_"darch".deb"))))
 
+(define (flag-day?)
+  (and (equal? '(10 1 10) (get-subsystem-version "Release"))
+       (equal? 'x86-64 microcode-id/compiled-code-type)))
+
 (define (build-plugin-pkg name vers)
   (let ((pkgdir (string build-dir"/"name"-"vers)))
     (run "rm -rf "pkgdir)
index f21b3e11aaf65619f919bb98dd8d261df09a3927..52717f0029fc29ee9128d5377fd4796ae85f2a35 100644 (file)
@@ -780,7 +780,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
         (a.v (read-host-arch.version host-exe))
         (host-arch (symbol->string (car a.v)))
         (host-version (cdr a.v))
-        (cross? (and target (not (string=? target host-arch))))
         (master? (cond ((file-directory? ".git")
                         (not (file-directory? "debian")))
                        ((file-directory? "../.git")
@@ -805,40 +804,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
           (error "Not a git working directory:"
                  (working-directory-pathname))))
 
-    (if cross?
-       (let ((config-options
-              (decorated-string-append
-               "" " " ""
-               (filter (lambda (option)
-                         (not (string-prefix? option "--enable-debugging")))
-                       (burst-string make-config #\space #t)))))
-         (if (not (file-directory? "cross"))
-             (make-directory "cross"))
-         (cond ((file-directory? ".git")
-                (for-each (lambda (name)
-                            (lndir* name "src/" "cross/" "../src"))
-                          (sort string<? (directory-file-names "src"))))
-               ((file-directory? "../.git")
-                (for-each (lambda (name)
-                            (lndir* name "../src/" "cross/" "../../src"))
-                          (directory-file-names "../src")))
-               (else
-                (error "Unexpected source directory:"
-                       (working-directory-pathname))))
-         (if (not (file-exists? "cross/configure"))
-             (trun "cd cross/ && ./Setup.sh"))
-         (if (not (file-exists? "cross/Makefile"))
-             (trun "cd cross/ && ./configure --prefix="prefix
-                   " --disable-default-plugins"
-                   (if (not (string=? target host-arch))
-                       (string-append
-                        " --enable-cross-compiling"
-                        " --enable-native-code="target
-                        " "config-options)
-                       (string-append
-                        " "config-options))))
-         (trun "cd cross/ && make all")))
-
     (cond ((file-directory? ".git"))
          ((file-directory? "../.git")
           (lndir "../src"))
@@ -849,7 +814,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
     (if (not (file-exists? "src/Makefile"))
        (trun "cd src/ && ./configure --prefix="prefix
              (if (not master?) " --disable-default-plugins" "")
-             (if cross? " --with-scheme-build=../cross " " ")
+             (if (not (string-null? make-config)) " " "")
              make-config))
     (trun "cd src/ && make tags")
     (trun "cd src/ && make all")