SliTaz SliTaz Forum

You are not logged in.

#1 2015-11-28 20:11:53

llev
Member
Registered: 2011-12-09
Posts: 568

Development workflow

Hi,

So, I've set up a cooking environment with [c]cooker setup[/c] in a chroot made by [c]tazdev gen-chroot[/c], as advised in the Cookutils doc and the Cookbook.

I've read all the doc I could, but I've yet to find how the projects (other than wok) integrate in this setup.

To develop a new package, I will edit the contents of wok-hg/package/, then cook it to make sure it works, and finally push it from wok-hg to the repo. (Tell me if I'm wrong.) But how do I work on other projects? I may clone them anywhere, of course (is <chroot>/home/slitaz/repos/, like on tank, a good/common place?), but how do I say to my cooker it should fetch the sources there and not from the repo?

Thanks.

Offline

#2 2015-11-28 20:44:34

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Development workflow

Hi Lucas,

Welcome aboard smile

I may do it wrong, but I not prepare packages when I worked with SliTaz projects such as tazpkg, tazpanel or cookutils. I just run something like [c]make; sudo make install; make clean[/c] from the sources folder (even not try to do it with slitaz-base-files). And now package installed onto my system and I can test it work before pushing changes to Hg repository.

Offline

#3 2015-11-28 21:56:47

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Development workflow

So, you perform without a safety net: no chroot and direct install to the default path! I'm not sure I'll want to live so dangerously smile Where do you put the sources?

What about projects that yield several packages, like slitaz-tools which is the source of slitaz-tools and slitaz-tools-boxes? Shouldn't we make sure the individual packages are consistent? (Doing "make install" is like installing both packages, right?)

Offline

#4 2015-11-28 23:21:52

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Development workflow

I have a special folder with all SliTaz sub-projects inside.

Yes, you can install into chroot using DESTDIR option. But you need to made at least minimal chroot before.

Sometimes when I working with individual script (like libtaz.sh or tazpkg-notify) I can copy it forth and back between my system and sources, changing it in-place.

Sometimes it is not clear what "make ..." to do, like in your example with slitaz-tools. Just examine Makefile.

Offline

#5 2015-11-29 11:00:10

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Development workflow

Thanks for your hints.

I got an idea: cooker looks into /home/slitaz/src to find a source tarball before downloading from the repo, right? If so, one may "tar" the local project dir into /home/slitaz/src : this way, running cooker will allow to test the build process.

If any other dev wants to share his point of view, he's welcome.

(Is there any "she" in the team?)

Offline

#6 2015-11-29 11:32:22

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Development workflow

It is a bit tricky.

[c]Cook[/c] looks into src dir only if it can't download tarball using wget from specified URL.

If you'll change package version then, yes, Hg repository returns "not found" and [c]cook[/c] will use tarball from @chroot@/home/slitaz/src. You need to make this tarball manually and name it according to new version.

I think it is good way, but need only for vital projects. It will very bad if you'll break tazpkg or cookutils or base files — cook.slitaz.org will break then, because it updated these packages on it's host.

For every other projects you can read cooking log on cook.slitaz.org, then make your fixes (again), push, poke cooker, and it will rebuild the package.

Offline

#7 2015-12-05 19:00:31

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Development workflow

Hi again,

As you may have seen I have pushed my first commit (new package on wok). But I've struggled to accomplish this, because I'm a bit lost among several accounts and I don't know Hg well, for now. As a result of this struggle, my real name doesn't show up in the log smile

To work on the receipt, I was root in the chroot. Then,

[c]/home/slitaz/wok-hg# hg add xmgrace/receipt[/c]

After this, I think (can't remember for sure!) I ran

[c]/home/slitaz/wok-hg# hg commit -m "(message)" -u llev[/c]

Finally,

[c]# (or was it $?) hg push[/c]

Enough speaking about my mistakes. Can you tell me the right way?

- Who should I be when I run these commands?

- Where should I be? (chroot or not)

- I've set wok-hg to be owned by root:users with rwxrwxr-x mode. Comments?

Thanks in advance.

Offline

#8 2015-12-05 19:59:02

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Development workflow

Hi Lucas,

My workflow.

Background. I have usually small amount of free space on my root partition (50-200 MB), and even I lost a pair of files when free space become zero (and problems to non-root log in). Also I have partition (previously) used as home partition for frugal SliTaz-4.0. This partition in my fstab and auto mounted on boot time as /mnt/slitaz.

I have cooking wok: /mnt/slitaz/slitaz/cooking/wok (but better I write it as /path/to/wok).

I have chroot: /mnt/slitaz/slitaz/gtk3 (/path/to/chroot).

All SliTaz projects are here: /mnt/slitaz/slitaz/all-slitaz-hg.

I working under default user "tux", I only set password.

Let's begin.

I need to update some package.

I opened Sakura.

su; tazdev chroot /path/to/chroot

Open second tab in Sakura.

su; cd /path/to/chroot/home/slitaz/wok; mc

In Midnight Commander one panel with chroot wok, change second panel to /path/to/wok.

Copy package's folder with receipt, edit receipt.

Switch to first Sakura tab, execute 'cook packagename'.

Switch to mc to see sources, installed files, to edit receipt, description and so on.

Common debugging process.

When package builds well, I opened third tab in Sakura. Note, as tux user, not as root. Open mc and copy receipt and all the needed stuff back from chroot wok to regular wok (/path/to/wok). Exit mc.

Check my changes in wok: [c]hg st[/c]

If I need to add files: [c]hg add[/c] (Hg adds all new files because I not specify file names).

If I need to add and remove files: [c]hg addrem[/c] (again not specify no one file).

Check files added and/or removed: [c]hg st[/c] (again).

Now important action. Update this local wok to the latest revision from hg.slitaz.org: [c]hg pull -u[/c]

It may be no changes at all, or few changes to other packages, or anybody changed the same files as you (conflict).

Conflict resolving is beyond this small post. Go forth.

Why this action is important? Because of history should be continuous.

Now write commit description: [c]hg commit[/c]

Text editor will open (using environment variable EDITOR) and you can write and save your message.

Push commit to server: [c]hg push[/c]

That's all.

I only want to say, you previously need to edit your ~/.hgrc as described (somewhere) in the www.slitaz.org development corner, and add your real name (or nick), e-mail, and even hg password (if you need).

I wrote using smartphone now, so here any examples.

Offline

#9 2015-12-05 21:53:33

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Development workflow

Lightning-fast answer!

I see you don't use cooker. I'll try and adapt your procedure to the directory hierarchy created by cooker. If I can't make it work, I'll change the directory structure to reflect yours smile

I think my problems stem from having files belonging to root in wok-hg. Thanks for clarifying!

cooking wok: root

hg wok: user

I wish you courage for your next two days of hard work!

Offline

#10 2015-12-06 12:58:34

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Development workflow

Thank you, Lucas smile

I don't need automation provided by cooker on my host. Only colored logs would be nice.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]