ioccc-src / mkiocccentry

Form an IOCCC submission as a compressed tarball file
Other
28 stars 6 forks source link

Enhancement: make release to temporarily set aside Makefile.local while building #1034

Open lcn2 opened 1 week ago

lcn2 commented 1 week ago

Is there an existing issue for this?

Describe the enhancement

The make release actions need to temporarily move aside any Makefile.local aside while the bulk of the actions were to happen and then PUT IT BACK afterwards:

if [[ -f save.Makefile.local ]]; then
    echo "ERROR: save.Makefile.local exists, aborting" 1>&2
    exit 123
fi
if [[ -f Makefile.local ]]; then
    mv -v -f -p Makefile.local save.Makefile.local
    status="$?"
    if [[ $status -ne 0 ]]; then
        echo "ERROR: mv -v -f -p Makefile.local save.Makefile.local failed, error: $status" 1>&2
        exit 124
    fi
fi

... the rest of the release staff including test ...

if [[ ! -f save.Makefile.local ]]; then
    echo "ERROR: save.Makefile.local is missing" 1>&2
    exit 125
fi
mv -v -f -p save.Makefile.local Makefile.local
status="$?"
if [[ $status -ne 0 ]]; then
    echo "ERROR: mv -v -f -p save.Makefile.local failed Makefile.local, error: $status" 1>&2
    exit 126
fi

And obviously Makefile.local and save.Makefile.local would be part of your .gitignore file.

Relevant images, screenshots or other files

n/a

Relevant links

GH-issuecomment-2486345495

Anything else?

Post CODE FREEZE and post-IOCCC28.

All comments and work of this issue to be delayed until after the IOCCC judges's post-IOCCC28 vacation.

xexyl commented 1 week ago

Same thing as the other one ... if you want.

Best wishes!

xexyl commented 1 week ago

Okay I started this with jparse but I can't do that today: the last two days were too hard and long. Tomorrow should be better if I can catch up with other things today.

Anyway I think that this task is not as easy as it seems. The problem is that the script uses the top level Makefile .. but that Makefile invokes rules from other Makefiles which means that those Makefiles probably also have to be moved. This will complicate the script some, possibly more than some.

I'll still look at it in the coming days if I can but just thought I'd remind you of this fact with multiple Makefiles.

Best wishes for a productive day!

xexyl commented 1 week ago

BTW: the -p option does not exist to mv. What are you referring to?

(It doesn't exist in linux or macOS.)

lcn2 commented 1 week ago

BTW: the -p option does not exist to mv. What are you referring to?

(It doesn't exist in linux or macOS.)

It was initially cp(1).

But don't bother with anything that is post-IOCCC28 for this repo as they won't be processed for months.

xexyl commented 1 week ago

BTW: the -p option does not exist to mv. What are you referring to? (It doesn't exist in linux or macOS.)

It was initially cp(1).

But don't bother with anything that is post-IOCCC28 for this repo as they won't be processed for months.

I actually wondered if you meant it to be cp. I won't be making any commit here, that is true, but I might play with the idea in jparse. But other things have to be worked out there too as noted. Not today and perhaps not even in the coming days.

Appreciate the clarification and suggestion.