1. Euphoria development workflow

Looks like Matt got ticket:607. Heh, I was still in the process of looking for it and tracing various parts of code.

The Euphoria source code really is kind of a mish-mash, BTW, with not enough comments. I did find a few other bugs and/or areas which could be cleaned up.

But I digress. I would like to know the "best practices" for working with the source.

So I clone the repository and I start making changes. Now, before I upload any changes I want to test them, right? I mean, code changes, not documentation changes.

If I build a modified interpreter, should I just "make install" and let it overwrite my regular interpreter? Or should I change PREFIX and let it install to a subdirectory in home?

And then "make test" will run all of the unit tests/regression tests, right? And what is "coverage analysis"?

Thanks.

Edit:

Of course, it looks like it doesn't matter much. I can't build the current source because it is choking on the "eu:poke8" and other references.

<0074>:: Errors resolving the following references: 
	../../compress.e (237): peek8s 
	../../buildsys.e (367): sizeof 
	../../buildsys.e (377): sizeof 
	../../../include/euphoria/info.e (71): sizeof 
	../../../include/std/datetime.e (58): sizeof 
	../../../include/std/datetime.e (59): poke_pointer 
	../../../include/std/filesys.e (49): sizeof 
	../../../include/std/convert.e (73): poke8 
	../../../include/std/machine.e (43): sizeof 
	../../../include/std/machine.e (149): poke_pointer 
	../../../include/std/machine.e (150): poke_pointer 
	../../../include/std/machine.e (180): peek_pointer 
	../../../include/std/machine.e (760): poke8 
 
				eu:poke8( eaddr, data ) 
				       ^ 

Tried to download the most current eubins, at least the one which seems to have actual executables in it, and that doesn't work either.

What I tried was this:

./configure --prefix ~/eubin --eubins ~/eubins-linux 
make 
and
./configure -without-euphoria --prefix ~/eubin 
make 

eubin is where I want Euphoria to go. eubins-linux is the stuff I downloaded from eubins.

Edit2: Has anyone looked at binding a bleeding-edge interpreter and translator instead of making a whole eubin package? And then that bound executable could be kept with the bleeding edge versions.

new topic     » topic index » view message » categorize

2. Re: Euphoria development workflow

jaygade said...

But I digress. I would like to know the "best practices" for working with the source.

So I clone the repository and I start making changes. Now, before I upload any changes I want to test them, right? I mean, code changes, not documentation changes.

If I build a modified interpreter, should I just "make install" and let it overwrite my regular interpreter? Or should I change PREFIX and let it install to a subdirectory in home?

And then "make test" will run all of the unit tests/regression tests, right? And what is "coverage analysis"?

You should run the tests prior to installing. I'd recommend only installing if you're pretty confident that it's all fairly stable. During development, that's often not the case (and it definitely seems not to be the case right now).

A simple "make test" runs the full suite of unit tests, interpreted, bound and translated.

"make coverage" runs the unit tests interpreted, and collects coverage metrics for the standard library. It allows us to get an idea of which parts of the standard library have not been tested by the unit tests. I think we're somewhere around 86% at this point. A lot of the uncovered code is error checking and crashing upon bad data or whatever. After building try running it, and it will generate some html reports in your build directory, in a unit-test subdirectory.

jaygade said...

Of course, it looks like it doesn't matter much. I can't build the current source because it is choking on the "eu:poke8" and other references.

Yes, there have been some additions in the trunk (i.e., the 4.1 code base) lately as I've been working on the 64-bit version.

jaygade said...

Tried to download the most current eubins, at least the one which seems to have actual executables in it, and that doesn't work either.

What I tried was this:

./configure --prefix ~/eubin --eubins ~/eubins-linux 
make 
and
./configure -without-euphoria --prefix ~/eubin 
make 

eubin is where I want Euphoria to go. eubins-linux is the stuff I downloaded from eubins.

The --without-euphoria option is for when you've got pre-translated source code. I don't think that's what you want to do.

jaygade said...

Edit2: Has anyone looked at binding a bleeding-edge interpreter and translator instead of making a whole eubin package? And then that bound executable could be kept with the bleeding edge versions.

I'm not sure how well that would work. The eubin stuff is automated (and currently needs to be gotten back on track). The repository in general is in a bit of disarray. A couple of weeks ago, I was doing some pretty heavy development, but then I got sick, so I've been out of it for a while, and over the next week or so, I expect it to be in much better shape, hopefully including getting the eubins process back on track.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: Euphoria development workflow

Thanks, Matt.

What I really want to know, though, is the best practices - how you guys do it. Especially under Linux.

So you clone the repository. You make some changes to the source. Now what do you do?

Do you test the changes by interpreting first? Do you do a build and install the binaries to an alternate location and then test? Do you have a test harness to just test your changes?

new topic     » goto parent     » topic index » view message » categorize

4. Re: Euphoria development workflow

jaygade said...

Thanks, Matt.

What I really want to know, though, is the best practices - how you guys do it. Especially under Linux.

So you clone the repository. You make some changes to the source. Now what do you do?

Do you test the changes by interpreting first? Do you do a build and install the binaries to an alternate location and then test? Do you have a test harness to just test your changes?

You don't need to install before running the tests. You can run the tests from right in the source tree using the makefile. Here's what I tend to do:

$ make all -j3 && make tools -j3 && make test 
That will build all of the binaries and run the tests. If you want to run only a single test:
$ make test TESTFILE=t_sequence.e 
You can also quote the TESTFILE argument to run several individual tests:
$ make test TESTFILE="t_sequence.e t_math.e t_switch.e" 

If you just want to test the interpreter, you can substitute "make coverage" for "make test".

When you're satisfied with your changes, you commit them ("hg ci"). When you do this, if you're fixing a particular ticket, you can put "Fixes ticket xyz" in your commit message, and the ticket will be automatically updated. If it's not a fix (maybe just partial, or maybe you added a failing test or something) you can just mention the ticket without the "Fixes" and a message will be automatically posted to the ticket. Note that committing just updates your local repository, not the remote repo on openeuphoria.org.

The ticket updating happens when you push (hg push) your changes to the repository on openeuphoria.org. There's also a hook for the CIA.vc bot, who posts messages to the euphoria IRC channel.

The process is similar for windows, with the biggest change being that you'll probably use "wmake" instead of "make" if you're using watcom (you can also use mingw, which uses the GNU makefile, and GNU make).

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: Euphoria development workflow

Excellent, thanks.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Euphoria development workflow

mattlewis said...

You don't need to install before running the tests. You can run the tests from right in the source tree using the makefile. Here's what I tend to do:

$ make all -j3 && make tools -j3 && make test 

Does the 'make test' use the binaries that have just been created in the 'build' directory or does it use the ones from the config file's --eubin setting?

Also, what does the "-j3" switch do? I'm using wmake by the way.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Euphoria development workflow

DerekParnell said...
mattlewis said...

You don't need to install before running the tests. You can run the tests from right in the source tree using the makefile. Here's what I tend to do:

$ make all -j3 && make tools -j3 && make test 

Does the 'make test' use the binaries that have just been created in the 'build' directory or does it use the ones from the config file's --eubin setting?

Also, what does the "-j3" switch do? I'm using wmake by the way.

"make test" uses the newly built binaries. The eubin setting only affects which interpreter is used to run the translator.

The "-j3" flag is tells GNU make that it can run 3 jobs in parallel, which speeds up the process. There is no similar flag for watcom.

Matt

new topic     » goto parent     » topic index » view message » categorize

8. Re: Euphoria development workflow

So I've got some changes to make but I'm still getting hung up on Mercurial. Heck, I only used svn a little bit so source control is still pretty new to me.

However, while I'm testing, I found this resource which seems more useful (so far) than the official tutorial: http://hginit.com/top/

I found it by Googling "Mercurial for dummies". Go figure.

Anyway, once I'm sure my changes for ticket:609 are working and I'm sure that I'm doing my hg commands correctly then I'll get them actually onto the server.

Edit: Anyhow, my Mercurial workflow goes kinda like this:

Only needs to be done once, I think, to clone the main repo. This is now MY repo.

~/$ hg clone -b 4.0 https://openeuphoria.org/hg/euphoria ~/euphoria-4.0.1 

Clone MY repo to a working directory. Can be done for different tickets, etc.

~/$ hg clone -b 4.0 ~/euphoria-4.0.1 ~/my-eu-4.0.1 

Make changes in directory my-eu-4.0.1 and test them. Then commit the changes to my local repo:

~/my-eu-4.0.1$ hg commit -m "Fix [[ticket:609]] or whatever." 

This is about where I got lost. I think that from there, I need to pull any changes, update or merge as necessary, retest? and then push changes? And at that point my repo and the online repo should be the same?

And the process repeats except instead of the first command above being "clone" it would be "pull", right?

Still reading Sposky's page on Mercurial so I will probably find the answers myself. It might be nice to have our own wiki page for doing this stuff though.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Euphoria development workflow

Okay, I still can't figure out how to upload my changes. I can't merge or push because it says I have too many heads.

Help!

new topic     » goto parent     » topic index » view message » categorize

10. Re: Euphoria development workflow

jaygade said...

Okay, I still can't figure out how to upload my changes. I can't merge or push because it says I have too many heads.

Help!

LOL grin ... I know where you are coming from. I'm sort of comfortable with downloading now, but uploading is still a scary black art - unless one knows all the jargon, paradigms, and enormous number of unintuitive command line options. But other than that, Hg is just peachy.

new topic     » goto parent     » topic index » view message » categorize

11. Re: Euphoria development workflow

I think I'll just re-clone to a new folder, put in my changes, and try again.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Euphoria development workflow

Well, I finally got it, but the diff output looks like there are some lines there that I didn't change myself?

Still confused, hope that I didn't screw up the branch.

Here's what I did:

$ hg clone -b 4.0 https://scm.openeuphoria.org/hg/euphoria euphoria4-clone 
$ cd euphoria4-clone 
$ cp ../euphoria4.0.1/source/scanner.e ./source 
$ cp ../euphoria4.0.1/source/scinot.e ./source 
$ cp ../euphoria4.0.1/tests/t_scientific.e ./tests 
$ hg add t_scientific.e 
$ hg commit -m "Fix [[ticket:609]] handling zeroes in scientific notation" 
$ hg push -b 4.0 

I did a few other things in there, they were mostly "helps" and stuff like that. Before I copied my files I did try to do a pull and an up for the branch, but there were no changes waiting.

So I don't know why I have any changes listed outside of my_sscanf() in scanner.e.

The output of the push also told me that there was no ticket information, as well as a lot of lines mentioning how the certificate for openeuphoria.org was invalid.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu