Thanks.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
goinstall is the common denominator for the Go environment and is
pretty easy to use.
It put some limitations on the layout that you can use on your program.
On the other hand, if you don't care about easy of installation on
other computers,
go-gb looks the better alternative so far.
--
André Moraes
http://andredevchannel.blogspot.com/
Making your packages work with goinstall is a better approach.
goinstall is the common denominator for the Go environment and is
pretty easy to use.
It put some limitations on the layout that you can use on your program.On the other hand, if you don't care about easy of installation on
other computers,
go-gb looks the better alternative so far.
I now use goinstall on Linux & Mac but it doesn't work on Windows, so
for Windows I use gb. Also, I use gb -c to clean up on Linux & Mac since
goinstall -clean doesn't seem to clean anything.
I believe that the gomake tool will be rereleased as a build tool that
doesn't depend on Make (and so might be cross-platform); but I don't
know when or if and how compatible it will be for projects built using
goinstall.
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Advanced Qt Programming" - ISBN 0321635906
http://www.qtrac.eu/aqpbook.html
I wonder what kind of programs people are routinely/on average writing when they are able not to use make. I just checked and about 1 in 4 of Go packages which were produced in our company do depend on golex and/or goyacc to build, so 'make' (or any other equivalence of its ability to invoke such tools) is our only automated option...
I believe that the gomake tool will be rereleased as a build tool that
doesn't depend on Make (and so might be cross-platform); but I don't
know when or if and how compatible it will be for projects built using
goinstall.
I believe that the gomake tool will be rereleased as a build tool that
doesn't depend on Make (and so might be cross-platform);
Relative imports would be great, Kyle!
On Jul 28, 11:16 am, Jan Mercl <jan....@nic.cz> wrote:
> AFAIK e.g. GNU Make is cross platform.
The only problem is that Makefiles are rarely such.
He means that the a makefile often won't work on multiple platforms, except in the simplest and most complex cases.
On Friday, July 29, 2011 1:24:51 PM UTC+2, John Asmuth wrote:He means that the a makefile often won't work on multiple platforms, except in the simplest and most complex cases.Are there any examples for this found anywhere in the Go source tree (considering all the supported platforms)? I don't think so.
And outside the Go source tree? I don't know, haven't yet seen any such. Sure, it's always possible to write non portable things, Make Makefiles included ;-)
Well, I don't imagine building runtime on windows would work with the existing makefile...
And outside the Go source tree? I don't know, haven't yet seen any such. Sure, it's always possible to write non portable things, Make Makefiles included ;-)Absolutely there are - just think of all the libraries you need to link.
He's not referring to syntax - just that the build process is unique for every platform and that makefiles don't address that at all.
+1
grtz,
--
Miek
Hi,2¢The makefiles for a typical Go project do not seem complex at all, simple in fact but i just tried go-gb the other day and its just so simple and it does automagic good things like collect the executables in a bin directory. These things may seem trivial but for me who is trying to introduce Go to a heavy long-time Java shop its a great boon. "You are building this thing with 'Make'??" is what i often hear and they don't mean it in a good way. I would prefer a by default zero conf build system like gb simply because it is easier and if extra stuff like generators of what not needs to be called it would be nice if i could declare it in Go syntax in a file somewhere (cmp w SBT/Scala). It also rhymes very nice with Go's philosophy to be simple and get lots done easily.Rgrds,Henrik
On Jul 29, 2011 9:42 AM, "Mateusz Czapliński" <czap...@gmail.com> wrote:
>
> On Jul 29, 2:51 pm, Jan Mercl <jan.me...@nic.cz> wrote:
> > So as the Build Frameworks do not address everything (cf. goyacc and any
> > other tools like that).
> >
> > Perhaps I'm an old school guy, but for me Make solves much more then Build
> > Frameworks and it is pretty cross platform, I think. On average our existing
> > Go Makefiles, excluding the boilerplate, are like 10-20 lines written once
> > per package. Pretty low cost, IMO.
>
> I do totally agree that Make is a much more universal tool than the
> current Go "Build Frameworks", and the power it gives can often be
> needed. I do also very much admire how The Go Team managed to make the
> basic end-user Makefiles for Go so simple to write, use and read.
>
As an example, I currently auto-generate a version.go file using $VCS command > version.go which is pretty easy to put into a Makefile and with a bit of temp indirection won't trigger a full rebuild either. How would something like that be done in the "goinstall" world?
John
I'll just add that generating go code from go is also one of those cases that are very difficult to do portably with make, which makes it particularly appealing for a go build tool, especially as it is so easy to generate go code from go.
What about a convention where a file ending in .go.go is a main program that generates a go file in the same location without the second .go. The limitation of this approach is that your code-generation programs can only have one file in their main package, and would live in the same location as the generated code. Also, it opens up an attack vector in that you'd have to execute the code, which could be interpreted as a danger if I may be installing untrusted code. On the other hand make is as bad, and go install is almost as bad.
David
I'll just add that generating go code from go is also one of those cases that are very difficult to do portably with make, which makes it particularly appealing for a go build tool, especially as it is so easy to generate go code from go.
What about a convention where a file ending in .go.go is a main program that generates a go file in the same location without the second .go. The limitation of this approach is that your code-generation programs can only have one file in their main package, and would live in the same location as the generated code. Also, it opens up an attack vector in that you'd have to execute the code, which could be interpreted as a danger if I may be installing untrusted code. On the other hand make is as bad, and go install is almost as bad.
Would the changes to your metric collecting script be non-trivial?
I don't understand the comment about lexing oriented packages.
I think you must have misunderstood my suggestion. A .go.go file *would* be a valid go program, which when compiled would yield an executable whose output is also valid go source code. The only incompatibility I can see would be with tools that assume that all the go code in a single directory must be for a single package, or that all the go files whose package is main and are in a single directory must be for the same executable. But I'd call any script that makes these assumptions broken.
David
On Jul 31, 2011 4:44 PM, "Jan Mercl" <jan....@nic.cz> wrote:
>> I don't understand the comment about lexing oriented packages.
>
>
> From the already published code e.g. this example will break on a box with .go.go files anywhere in $GOROOT/src:
> https://github.com/cznic/golex/blob/master/example2.l#L280
I don't see anything there that would break if .go.go files were used, since they would be valid go files.
David
> The only incompatibility I can see would be with tools that assume that all
> the go code in a single directory must be for a single package, or that all
> the go files whose package is main and are in a single directory must be for
> the same executable. But I'd call any script that makes these assumptions
> broken.
You've just described a principal assumption of the build system for
the Go tree, and the majority of third party packages. It's also an
assumption that goinstall (and related tools) is based on, and will
continue to be based on in the future.
Dave.
From the already published code e.g. this example will break on a box with .go.go files anywhere in $GOROOT/src:
I don't care if anyone wants/needs to use some Build Framework. I *do* care if that would mean breaking things for other people in no need to use Build Frameworks.
And yes, I honestly consider the idea of establishing a .go.go extension as a poor one.
On Aug 2, 2011 12:37 PM, "John Asmuth" <jas...@gmail.com> wrote:
> One reason I can think of is that this only deals with one possible prebuild step. A change from zero prebuild operations to one prebuild operation is significant, and would make the argument against adding additional prebuild steps of various sorts weaker. We might end up with 90 special file types that we all have to deal with.
>
> I'd much rather agree on a standard that can do any kind of prebuilding. A special name for a shell script, perhaps.
>
> Or, alternatively, no change.
I think using shell scripts would be a terrible idea: it's notoriously hard to write a portable shell script, and that's leaving out the possibility of building on windows. Much nicer to use go scripts if anything. It's true that the .go.go idea doesn't address all possible prebuild possibilities, but I'm not sure that's a problem. We aren't going to find a flexible approach that treats dependencies that is simpler than make and the beauty of gb, go install are in their convention-over-configuration approach. Any convention is going to imply some degree of limitation.
I suppose a good idea would be to consider use cases that aren't currently handled by gb or goinstall. One is to handle generated code code a la gotgo, another would be what I worked on with goadmin, which was a system for creating programs based on the state of a computer (e.g. to replicate the set of Unix users on the build system). Neither are compelling stories, nor are they actively maintained. But if you've also got situations where you want to generate go code then maybe it's not so rare...
David
Łukasz Gruner
2011/8/2 ⚛ <0xe2.0x...@gmail.com>:
I am not sure I fully understand what you are referring to. Is this is
a question about configuration files in goam?
It's hard to write portable makefiles.
David
Why not just add a, per directory Makefile that produces .go file, and
make goinstall use it?
Hi, I finally tried it again but without success:
http://code.google.com/p/go/issues/detail?id=2137
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Rapid GUI Programming with Python and Qt" - ISBN 0132354187
http://www.qtrac.eu/pyqtbook.html
I'm also having problems with goinstall on Windows:
http://code.google.com/p/go/issues/detail?id=2137
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Programming in Go" - ISBN 0321774639
http://www.qtrac.eu/gobook.html
It's a bit more complicated (and reasonable) than that.
Unsurprisingly, many (buggy) XP programs do not work under Vista or
later because they were not written correctly. Microsoft tries to
protect Vista users from those programs by not running them. They have
a a heuristic that flags pre-Vista programs with "setup" or "install"
in their name as most likely being incorrect and refuses to run them,
probably based on hard, imperical data.
This doesn't mean that Vista refuses to run all programs that have a
"setup" or "install" in their names.
With XP Microsoft introduced a manifest file which is an XML file that
can be embedded inside .exe as a resource (or provided as a separate
file alongside the .exe e.g. foo.exe.manifest is an XML manifest for
foo.exe).
One of the things that can be described in the manifest file is an OS
compatibilty level where a programmer can state "I promise this
program works correctly under Vista" which will turn off the
filename-based compatiblity heuristic.
Basically Vista (and 7) doesn't trust pre-Vista executables (and
especially those with "isntall" or "setup" in their name) and it's
programmer's job to mark the executables explicitly as Vista (and 7)
compatible.
In the context of goinstall.exe (and all other executables that are
part of Go installation), Windows build should embed the right XML
manifest which will tell Windows that it's ok to run goinstall.exe
(and others) on Vista and 7.
The magic incantation is:
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows Vista
functionality -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--This Id value indicates the application supports Windows 7
functionality-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
(see http://code.google.com/p/sumatrapdf/source/browse/trunk/src/installer/Installer.exe.manifest
for a full manifest file that I use for an installer for my app)
This can also be done by a user via UI
(http://www.howtogeek.com/howto/windows-vista/using-windows-vista-compatibility-mode/)
but clearly that's not a scalable solution.
-- kjk