I'm happy sure that people messing with 4e/9legacy will appreciate
this, and I'm to collaborate to keep this up to date, but I think
the majority of this will not land in 9front. We changed 9front so
we could write better code with these changes.

I'm not going to import a second copy of the utils that we already
ship; that's just invites having the copies get out of sync.

The hardest change to verify is the use of ifs. `$sep{} is subtly
differnet from 'ifs=$sep `{}'. This is because $ifs affects the
internals of shell functions. As a demonstration, if you have a
function that cats multiple files:

        fn show{
                for(i in `{seq 10})
                        cat /tmp/$i 
        }

and want to get comma separated fiels from them:

        fields=`,{show `{seq 10} | tr '\xa' ','}
        echo $#fields

This works totally fine, but if you try to use ifs:

        ifs=,
        fields=`{show | tr '\xa' ','}
        echo $#fields

then ifs affects the behavior of the 'show' function, and
we attempt to open a single file named '1
2
3
4
..
10'

Another problem here is that you have calls to ape/patch and ape/diff;
these will not work on 9front, because we removed them. Ape/patch was
a copy of Gnu patch from 1998, and it's busted. We would regularly get
segfaults from valid diffs on it, so we replaced the 15,160 lines of
patch with a native implementation which works better, at something
like 5% the size.

We did the same with ape/diff, through in this case we modified the
version that we inherited, and removed 23,922 lines. So, the total
diff here is reducing the size by 38,000 lines, and remmoving a lot
of bugs.

Finally, I'm not sure that using asctime will actually work; it'll
do the job for git/log, but generating valid git patches that can
be imported with 'git am' will require dates in a specific format.

I'll take some time to look through this later to see if there are
changes that make sense to take to minimize the diff.

Quoth Yaroslav K <[email protected]>:
> Hi all,
> 
> I’ve completed a full backport of git9 to the 4th Edition / 9legacy
> environment. Earlier attempts existed, and I reviewed the 9legacy
> patches carefully, but even with all undocumented dependencies
> applied, the result still wasn’t in a state where the same codebase
> could run unmodified across systems.
> 
> Instead of stacking more patches, I focused on the concrete
> incompatibilities that the port actually encountered: differences
> in rc syntax, flag parsing, libc interfaces, date/time formatting,
> awk behaviour, and the availability of certain helper utilities.
> None of these were major individually, but together they prevented
> a clean build and consistent behaviour on 4e.
> 
> The goal was to make git9 edition-agnostic without forking much of
> the code.  The result now builds and runs cleanly on both 9front
> and 4e/9legacy.
> 
> In practical terms, this meant replacing newer rc constructs with
> legacy-compatible forms, avoiding the 9front-specific aux/getflags
> syntax, steering clear of newer libc calls like Bfdopen, using date
> formatting primitives available on both systems, working around awk
> differences, and importing a small set of auxiliary utilities so
> that behaviour matches across both environments. The PR contains
> the full details, but the overarching theme is reducing shallow
> incompatibilities rather than introducing edition‑specific branches.
> 
> To install the port, use the contrib mechanism:
> 
> contrib/install yk/git
> 
> The RFC PR is here for anyone who wants to review or discuss the
> approach:
> 
> https://github.com/9front/9front/pull/2
> 
> This is offered in the spirit of 9legacy: keep the older systems
> usable and interoperable without turning them into museum pieces.
> Feedback is welcome, especially from anyone running mixed environments
> or interested in cross‑edition compatibility.
> 
> Thanks,
> Yaroslav Kolomiiets

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Td167d7e8cebadcc4-M2ae1df423cfedf56ff616d9a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to