[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] golang/xenlight: Add libxl_utils support


  • To: Nicolas Belouin <nicolas.belouin@xxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Fri, 19 Jul 2019 08:47:19 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=George.Dunlap@xxxxxxxxxx; spf=Pass smtp.mailfrom=George.Dunlap@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>
  • Delivery-date: Fri, 19 Jul 2019 08:47:27 +0000
  • Ironport-sdr: Sltrcjt+yooRhk/CrHOjzP3476Dt26zBdZWHrfAwMgYpCHhsXgQvz53oG7OIrjevaBb7Me7KZ4 RxvzNLJujAEkEnwx8DzLawTCw03qi2I+h38gyquj/WA1YRFLHWBBZLyRUkKgFG7LkQhJUSjP+a fUO49TDtlnHsM6ZyZlJcGIXp/eelbXebjPAbDffUqWC6nPVPGS/vWg04oGI27USeYRKOnMWJtD lXmahLTXEru/ro1QbkFp7pqFqBNk821cZ5fkK8TH9HqmiyjZI0rrSgu7T3X3RZ3XDXcWJf4+13 E44=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPbNjc95pGkfIQkWl7AokKBvwWKbRa8uAgAAUawA=
  • Thread-topic: [PATCH] golang/xenlight: Add libxl_utils support


> On Jul 19, 2019, at 8:34 AM, Nicolas Belouin <nicolas.belouin@xxxxxxxxx> 
> wrote:
> 
> 
> 
> On 7/18/19 11:54 PM, George Dunlap wrote:
>> The Go bindings for libxl miss functions from libxl_utils, let's start
>> with the simple libxl_domid_to_name and its counterpart
>> libxl_name_to_domid.
>> 
>> NB that C.GoString() will return "" if it's passed a NULL; see
>> https://github.com/golang/go/issues/32734#issuecomment-506835432
>> 
>> Signed-off-by: Nicolas Belouin <nicolas.belouin@xxxxxxxxx>
>> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
>> ---
>> v3:
>> - Wire into build system
>> - Add reference to C.GoString() handling NULL to commit message
>> 
>> Nicolas, could you test to see if this actually works for you?
> Tested it, it works.
> 
> I must confess I do not use that import path as the new modules mechanism
> introduced in Go1.11 downloads and compile a versioned copy of every
> dependency per project, and this behavior is incompatible with the build
> system used here.

It’s possible that something fundamentally has changed, but I suspect that 
rather you don’t quite understand how the current build system is supposed to 
work.  (In which case a write-up in the tree would probably be useful.)

Go has always insisted that there be no binary compatibility between versions; 
so it’s always been necessary to re-compile all your libraries when upgrading 
from (say) 1.8 to 1.9.  Which means that any useable distribution must also 
include all the source files necessary to recompile when you bump the version 
number.

So the core mechanism of the “install” is actually to copy all the source files 
necessary into the right local directory such that the go compiler can find 
them; ATM this is /usr/share/gocode/golang.xenproject.org/xenlight (as 
documented here: https://github.com/golang/go/wiki/FileTreeDocumentation).  The 
files which are copied are specified by the PGKSOURCES variable in the makefile.

The purpose of building a binary during the normal “make” process is not 
actually to have a useable binary; it’s to detect any potential issues when you 
do the Xen build, rather than whenever you actually build a Go program for the 
first time (potentially on some end-user’s system).  And “detect any issues” 
attempts to use “go build” in the situation you expect to use it at run time 
(i.e., it copies PKGSOURCES to a local directory, then points GO_PATH at them, 
points to the locally-built libraries, and then runs a plain `go build`).  In 
this way it should, theoretically, catch any of the following errors:

* Syntax / whatever errors in the Go bindings themselves
* Mismatches between the Go bindings and libxl &c
* Missing system libraries
* Something not right in the installation path system

All that to say — the “real” way to enable a new file in the xenlight package 
is to add it to PKGSOURCES.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.