Discussion:
[SM-Users] Spells and Grimoires and Dependencies, oh my!!
Kevin Monceaux
2006-07-20 19:31:29 UTC
Permalink
Fellow SMGL enthusiasts,

Okay, now I think I'm finally getting to the fun part. And, of course, I
have a couple of questions.

As some suggested I switched from the stable grimoire to the test grimoire.
I then did the equivelant of a system-update. I went through all the
individual steps separately so I would get more sorcery practice. All
spells with newer versions in test were cast successfully except for netpbm.
Netpbm complained about a missing libxml/xmlreader.h file. I suspect the
spell in question is missing a dependency. Is there a gaze command to
inquire which spell provides the missing file? Also, when writing spells
how detailed should the DEPENDS file be? For example, I suspect almost all
spells depend on glibc and it would be doubtful that one would come across a
system that doesn't have glibc installed. But, looking at the DEPENDS files
from several spells as examples none list glibc as a dependency. I would
think ALL dependencies should be included in the DEPENDS file.

I know I sould probably learn to crawl before learning to walk, and learn to
write some simple spells before trying to update existing spells, but I was
anxious to get Hercules up to date. The Hercules mainframe emulator is one
program I use quite frequently. The latest version is 3.04.1. The version
in both test and stable is 3.02. And, I noticed a few anomalies with the
spell. It's DETAILS file shows:

UPDATED=20030717

But, it's HISTORY shows the last update on 2006-06-28. It had no DEPENDS or
CONFIGURE files. Also, it's in the utils section. Shouldn't it and similar
programs be in an emulators section? It doesn't appear that the test or
stable grimoires have an emulators section. I copied the spell to my local
grimoire, updated it to the latest version, and added a couple of optional
dependencies and threw in a config option. It didn't like my first attempt
at a CONFIGURE file. All it displayed for the prompt was:

[ ]

It had me scratching my head for a while until I figured out I had an
extraneous space after the trailing \ on the first config_query_option line.
After fixing that sorcery appeares to be happy with the spell.

What is the SGML procedures for "version bumps?" Can I submit my updated
Hercules spell or do the modificationis need to be done by a spell/section
maintainer?

I plan to tackle creating spells for SIMH(yep, I like emulators) and clip(a
Clipper/xBase compatable compiler) next.


Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Jeremy Blosser
2006-07-20 20:12:34 UTC
Permalink
Post by Kevin Monceaux
Netpbm complained about a missing libxml/xmlreader.h file. I suspect the
spell in question is missing a dependency. Is there a gaze command to
inquire which spell provides the missing file?
gaze from path/to/file
^^^^ this is a regexp

That won't help you if you don't have the file installed, but you can ask
one of the irc bots to tell you if it knows of one:

<emrys> .from libxml/xmlreader.h
<scry> Processing your request...
<scry> libxml/xmlreader.h :: libxml2 (for a more verbose listing
http://odin.dtdm.org/scry/)
Post by Kevin Monceaux
Also, when writing spells how detailed should the DEPENDS file be? For
example, I suspect almost all spells depend on glibc and it would be
doubtful that one would come across a system that doesn't have glibc
installed. But, looking at the DEPENDS files from several spells as
examples none list glibc as a dependency. I would think ALL dependencies
should be included in the DEPENDS file.
The policy is that if a spell uses something DIRECTLY it should have a
depency on it. If it's a dependency of a dependency they don't need to
list it. A lot of times things that are in basesystem (gaze DEPENDS
basesystem) don't get added to the dependencies of other spells. For
things like glibc this is acceptable, for things that might drop out of
basesystem (eg wget) we try to avoid it.
Post by Kevin Monceaux
I know I sould probably learn to crawl before learning to walk, and learn to
write some simple spells before trying to update existing spells, but I was
anxious to get Hercules up to date. The Hercules mainframe emulator is one
program I use quite frequently. The latest version is 3.04.1. The version
in both test and stable is 3.02. And, I noticed a few anomalies with the
UPDATED=20030717
But, it's HISTORY shows the last update on 2006-06-28.
Ok this is where you start to get RTFM responses. :-) The spell files api
is pretty well documented, so if you're going to work in spells, read that.
eg, http://wiki.sourcemage.org/DETAILS reads in part:

"UPDATED

* This is a numerical string indicating the date this spell was last
changed. Used as a reference for the sorcery scripts to know if a
spell has been updated. (This forces a recompile so only update for
non-version updates that need a recompile. Version updates and
non-recompile-needed changes should not touch this variable.)

Note: This is still supported, but shouldn't be used anymore. Instead use
PATCHLEVEL or SECURITY_PATCH as applicable."

So you only update UPDATED when you wanted them to recompile, but we don't
use that anymore (partly because it was confusing with that name).
Post by Kevin Monceaux
It had no DEPENDS or CONFIGURE files.
This is pretty typical for basic spells that don't have extra dependencies
(beyond things like glibc). If there are things that can be configured
about it beyond obscure options in the ./configure script, feel free to add
a CONFIGURE script (all ./configure options will be available during the
build already, but we do add the very common options as explicit queries in
CONFIGURE).
Post by Kevin Monceaux
Also, it's in the utils section. Shouldn't it and similar programs be in
an emulators section? It doesn't appear that the test or stable
grimoires have an emulators section.
You don't want to start the section organization question right now, trust
me. :-) We know it's got issues. Bigger priorities are in line ahead of
it (like switching our SCM for the project), but I optimistically expect
it'll probably get seriously reraised and answered in the next year.
Post by Kevin Monceaux
What is the SGML procedures for "version bumps?" Can I submit my updated
Hercules spell or do the modificationis need to be done by a spell/section
maintainer?
Open a bug and provide a patch* if you have one. The section maintainer or
another guru will review the patch and apply it. Do 3 or 4 of those and
you'll start getting the "why don't you just get commit access so you can
apply these yourselves" responses.

(*You could also try your hand at cloning our git repo via http and making
your changes there, then publishing your changed repo as an http git repo
so the guru can pull it from you directly. git is new enough to us that we
aren't doing this yet with anyone but are excited about the potential.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/sm-users/attachments/20060720/8a7cbdd0/attachment.bin
Kevin Monceaux
2006-07-20 21:20:32 UTC
Permalink
Jeremy,
Post by Jeremy Blosser
gaze from path/to/file
^^^^ this is a regexp
That won't help you if you don't have the file installed, but you can ask
That was the problem. I found info on "gaze from" in the gaze man page but
since the file didn't exist on my system it didn't help.
Post by Jeremy Blosser
<emrys> .from libxml/xmlreader.h
<scry> Processing your request...
<scry> libxml/xmlreader.h :: libxml2 (for a more verbose listing
http://odin.dtdm.org/scry/)
Ah, that's what I needed. I also checked out the above url. Looks like it
could be very helpful when searching for things. I'll be sure to add it to
my URL database. I suspect netpbm is missing a dependency for libxml2.
I've added netpbm to my local grimoire and added a dependency of libxml2 to
it. I have a cast running right now. Hopefully that'll fix the problem.
Post by Jeremy Blosser
The policy is that if a spell uses something DIRECTLY it should have a
depency on it. If it's a dependency of a dependency they don't need to
list it. A lot of times things that are in basesystem (gaze DEPENDS
basesystem) don't get added to the dependencies of other spells. For
things like glibc this is acceptable, for things that might drop out of
basesystem (eg wget) we try to avoid it.
Sounds like a plan.
Post by Jeremy Blosser
Ok this is where you start to get RTFM responses. :-) The spell files api
is pretty well documented, so if you're going to work in spells, read that.
RTFM responses are fine, especially ones like yours with a pointer to the
location of the info in question. I'm still learning my way around the SMGL
docs. I definitely have alot to learn.
Post by Jeremy Blosser
So you only update UPDATED when you wanted them to recompile, but we don't
use that anymore (partly because it was confusing with that name).
So, if I submit a patch with an updated Hercules spell should I remove the
UPDATED line from the DETAILS file?
Post by Jeremy Blosser
This is pretty typical for basic spells that don't have extra dependencies
(beyond things like glibc). If there are things that can be configured
about it beyond obscure options in the ./configure script, feel free to add
a CONFIGURE script (all ./configure options will be available during the
build already, but we do add the very common options as explicit queries in
CONFIGURE).
There are a couple of optional dependencies that Hercules is fairly useless
without. Hercules was cast successfully with the CONFIGURE and DEPENDS
scripts I added. I'll nit-pick through the Hercules documentation and
./configure --help output and see if anything else might be useful, do a
little polishing, and will probably have a patch ready for submission in the
near future.
Post by Jeremy Blosser
Open a bug and provide a patch* if you have one. The section maintainer or
another guru will review the patch and apply it.
Will do.
Post by Jeremy Blosser
Do 3 or 4 of those and you'll start getting the "why don't you just get
commit access so you can apply these yourselves" responses.
I can live with that. Looks like I might have two already, if my minor
dependency fix for netpbm takes care of the problem.
Post by Jeremy Blosser
(*You could also try your hand at cloning our git repo via http and making
your changes there, then publishing your changed repo as an http git repo
so the guru can pull it from you directly. git is new enough to us that we
aren't doing this yet with anyone but are excited about the potential.)
Looks like git's DEPEND file needs a little work:

gaze what git

/var/lib/sorcery/codex/test/devel/git/DETAILS: line 10: [: !=: unary operator expected

After the above error gaze did display the description.


Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Eric Sandall
2006-07-20 23:05:50 UTC
Permalink
Post by Kevin Monceaux
Jeremy,
<snip>
Post by Kevin Monceaux
Post by Jeremy Blosser
So you only update UPDATED when you wanted them to recompile, but we don't
use that anymore (partly because it was confusing with that name).
So, if I submit a patch with an updated Hercules spell should I remove the
UPDATED line from the DETAILS file?
Any and all cleanup is appreciated. :) You may also notice that some
packages have a BUILD_API=2 line in their DETAILS file, this is no
longer needed for most grimoires as they have a grimoire-wide
API_VERSION file which sets BUILD_API=2 (our second iteration of the
Sorcery spell API) for any spell which doesn't override it (e.g.
spells still on BUILD_API=1).
Post by Kevin Monceaux
Post by Jeremy Blosser
This is pretty typical for basic spells that don't have extra dependencies
(beyond things like glibc). If there are things that can be configured
about it beyond obscure options in the ./configure script, feel free to add
a CONFIGURE script (all ./configure options will be available during the
build already, but we do add the very common options as explicit queries in
CONFIGURE).
There are a couple of optional dependencies that Hercules is fairly useless
without. Hercules was cast successfully with the CONFIGURE and DEPENDS
scripts I added. I'll nit-pick through the Hercules documentation and
./configure --help output and see if anything else might be useful, do a
little polishing, and will probably have a patch ready for submission in the
near future.
We're all about options so fill it in with as many as you can test
(and are prudent, you probably don't need to add queries for
`./configure --program-transform-name` ;)).

<snip>
Post by Kevin Monceaux
Post by Jeremy Blosser
Do 3 or 4 of those and you'll start getting the "why don't you just get
commit access so you can apply these yourselves" responses.
I can live with that. Looks like I might have two already, if my minor
dependency fix for netpbm takes care of the problem.
Easy to play around with spells, isn't it? =)
Post by Kevin Monceaux
Post by Jeremy Blosser
(*You could also try your hand at cloning our git repo via http and making
your changes there, then publishing your changed repo as an http git repo
so the guru can pull it from you directly. git is new enough to us that we
aren't doing this yet with anyone but are excited about the potential.)
gaze what git
/var/lib/sorcery/codex/test/devel/git/DETAILS: line 10: [: !=: unary operator expected
After the above error gaze did display the description.
You mean the DETAILS file? ;) Looks like someone forgot to quote the
variables on DETAILS:10. Fixed in commit
426306f26dd856ed38d98f32e41568898e950c7a, thanks! :)

-sandalle
--
Eric Sandall | Source Mage GNU/Linux Developer
eric at sandall.us PGP: 0xA8EFDD61 | http://www.sourcemage.org/
http://eric.sandall.us/ | SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org/ #196285 | http://www.shock.wsu.edu/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Kevin Monceaux
2006-07-20 23:16:44 UTC
Permalink
Post by Eric Sandall
Post by Kevin Monceaux
So, if I submit a patch with an updated Hercules spell should I remove the
UPDATED line from the DETAILS file?
Any and all cleanup is appreciated. :) You may also notice that some
packages have a BUILD_API=2 line in their DETAILS file, this is no longer
needed for most grimoires as they have a grimoire-wide API_VERSION file
which sets BUILD_API=2 (our second iteration of the Sorcery spell API)
for any spell which doesn't override it (e.g. spells still on
BUILD_API=1).
I'll be happy to try and take care of a little cleanup with any patches I
submit. I'll dig through the docs and familiarize myself with which parms
are depreciated.
Post by Eric Sandall
Easy to play around with spells, isn't it? =)
It sure is. I wich I had found SMGL sooner.
Post by Eric Sandall
Post by Kevin Monceaux
gaze what git
/var/lib/sorcery/codex/test/devel/git/DETAILS: line 10: [: !=: unary operator expected
After the above error gaze did display the description.
You mean the DETAILS file? ;) Looks like someone forgot to quote the
variables on DETAILS:10. Fixed in commit
426306f26dd856ed38d98f32e41568898e950c7a, thanks! :)
Yes, that should have been "git's DETAILS file," sorry.


Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Kevin Monceaux
2006-07-20 23:08:23 UTC
Permalink
I suspect netpbm is missing a dependency for libxml2. I've added netpbm
to my local grimoire and added a dependency of libxml2 to it. I have a
cast running right now. Hopefully that'll fix the problem.
This might be another RTFM question. If so, please forgive me. Adding a
dependency of libxml2 to netpbm appears to fix the problem. But, now I'm
encountering a local grimoire problem. If I cast netpbm from my local
grimoire it fails with a:

make_single: command not found

It compiles fine(with the added dependency) when cast from the test
grimoire. But changes made there would be overwritten the next time I do a
"scribe update." I've searched SourceMage.org but didn't find much info on
make_single. http://www.SourceMage.org/search turns up one hit for
make_single:

http://www.SourceMage.org/node/1161

But, make_single is nowhere to be found on that page. A search of
http://wiki.SourceMage.org prodouced one result:

http://wiki.SourceMage.org/Things_Spells_Should_Not_Do

But all that page says about make_single is that it should be used instead
of MAKE_NJOBS(DETAILS).


Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Jeremy Blosser
2006-07-20 23:18:52 UTC
Permalink
Post by Kevin Monceaux
I suspect netpbm is missing a dependency for libxml2. I've added netpbm
to my local grimoire and added a dependency of libxml2 to it. I have a
cast running right now. Hopefully that'll fix the problem.
This might be another RTFM question. If so, please forgive me. Adding a
dependency of libxml2 to netpbm appears to fix the problem. But, now I'm
encountering a local grimoire problem. If I cast netpbm from my local
make_single: command not found
There are several support files in the grimoire that your local grimoire
doesn't have just after you mkdir it. A big one is ./FUNCTIONS, which is
where make_single comes from.

You can fix this by symlinking those files from /var/lib/sorcery/codex/test
into your local grimoire. Some people prefer using scribbler(8) for this
kind of thing, man scribbler.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/sm-users/attachments/20060720/6e206d9c/attachment.bin
Loading...