Subject: Re: [bug#37012] [PATCH] gnu: mingw: Add x86_64 support.

From: Jan Nieuwenhuizen <[email-masked]>
Date: Wed, 14 Aug 2019 00:27:13 +0200

Carl Dong writes:

Hi Carl!

> This patch parameterizes previously hard-coded instances of
> i686-w64-mingw32, adding support for x86_64-w64-mingw32.

That would be great.  When I try it, I get

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build --target=i686-w64-mingw32 hello --no-build-hook
building /gnu/store/b3qq8g6lhwgadp09vwwmnyd91bvll3s3-module-import-compiled.drv...
Backtrace:
In ice-9/boot-9.scm:
    841:4 19 (with-throw-handler _ _ _)
In system/base/compile.scm:
    59:11 18 (_)
   155:11 17 (_ #<closed: file 61d8c0>)
   235:18 16 (read-and-compile #<input: /gnu/store/vdspbcgdlfg7xblm?> ?)
   183:32 15 (compile-fold (#<procedure compile-tree-il (x e opts)>) ?)
In ice-9/boot-9.scm:
   2312:4 14 (save-module-excursion _)
In language/scheme/compile-tree-il.scm:
    31:15 13 (_)
In ice-9/psyntax.scm:
  1235:36 12 (expand-top-sequence _ _ _ #f _ _ _)
  1182:24 11 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
   285:10 10 (parse _ (("placeholder" placeholder)) (()) _ c&e (# #) #)
In ice-9/eval.scm:
   293:34  9 (_ #<module (#{ g31}#) 62bf00>)
In ice-9/boot-9.scm:
   2874:4  8 (define-module* _ #:filename _ #:pure _ #:version _ # _ ?)
  2071:24  7 (call-with-deferred-observers _)
  2887:24  6 (_)
   222:29  5 (map1 _)
   222:29  4 (map1 (((guix build gnu-build-system)) ((guix utils)) ?))
   222:17  3 (map1 (((guix utils)) ((srfi srfi-1)) ((srfi #)) ((?)) ?))
   2803:6  2 (resolve-interface _ #:select _ #:hide _ #:prefix _ # _ ?)
In unknown file:
           1 (scm-error misc-error #f "~A ~S" ("no code for modu?" ?) ?)
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
no code for module (guix utils)
--8<---------------cut here---------------end--------------->8---

Does this it work for you, can you verify?

> diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm
> index d430b8afc4..77e279f07d 100644
> --- a/gnu/build/cross-toolchain.scm
> +++ b/gnu/build/cross-toolchain.scm
> @@ -22,6 +22,7 @@
>  (define-module (gnu build cross-toolchain)
>    #:use-module (guix build utils)
>    #:use-module (guix build gnu-build-system)
> +  #:use-module (guix utils)

I am suspecting this one here, in which case

> @@ -168,8 +169,8 @@ C_*INCLUDE_PATH."
>  a target triplet."
>    (modify-phases phases
>      (add-before 'configure 'set-cross-path
> -      (if (string-contains target "mingw")
> -          set-cross-path/mingw
> +      (if (target-mingw? target)
> +          (cut set-cross-path/mingw #:target target <...>)
>            set-cross-path))
>      (add-after 'install 'make-cross-binutils-visible
>        (cut make-cross-binutils-visible #:target target <...>))

this would need to change.

> diff --git a/gnu/packages/mingw.scm b/gnu/packages/mingw.scm
> index 3e96f2c475..907f2c3c35 100644
> --- a/gnu/packages/mingw.scm
> +++ b/gnu/packages/mingw.scm
...
> +      (description
> +       "Minimalist GNU for Windows (@dfn{MinGW}) is a complete software
> +de  velopment environment for creating native Microsoft Windows applications.
     ^^
What happened here?

> +It   includes a set of Windows-specific header files and static import libraries
> +wh  ich enable the use of the Windows API.  It does not rely on any third-party C
> +ru  ntime dynamic-link libraries (@dfn{DLL}s).
     ^^

Otherwise, LGTM.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <[email-masked]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com