From a7f9b06350b2c317050180e8459d0ab1a1835f05 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 2 Dec 2024 06:51:33 -0800 Subject: [PATCH] Move Makefile.entry to Makefile.example The file template/entry/Makefile.entry was moved to next/Makefile.example. This matches the mkiocccentry repo in filename and where it was before (template/entry) is not the right place as that is for the template of making submissions into a winning entry whereas next/ is for the next contest. The next/ seems like the most logical place because the example file could be updated per contest for whatever reason, perhaps by adding the year in it (or not). On the other hand, the try.sh in template/entry is for submitters too but since the bin/cvt-submission.sh script will copy the template files to a winning entry if it does not exist it is left in template/entry, even if this might not be ideal. The references to the old Makefile.entry have been updated to Makefile.example in the new path/filename. Other changes had to be made too including updates to bin/cvt-submission.sh. That script should be checked to make sure everything is okay but as I have no way to test it that might have to be done by the judges though I think it is okay. Html files that have been changed that might need to be checked are: 0. faq.html (this one especially should be checked) 1. next/guidelines.html (though the judges will be checking this more) 2. next/rules.html (though the judges will be checking this more) For the faq.html file, the Makefile.example and try.sh/try.alt.sh scripts should be downloaded, not linked to on GitHub and it needs to be clear that one should use the Makefile.example from the website (this repo) rather than the out of date mkiocccentry repo. For the guidelines and rules, and especially the guidelines, any files linked should also be downloaded and not linked to GitHub. The text should be clear already but it might be good to have a quick pass. The judges will be going over these files before the next contest too. The files should be downloaded here too, not linked to GitHub as submitters need to download the files to make use of. The thanks-for-help.html file was slightly modified but should be fine too. In this case the GitHub file should be linked to. The version of the rules and guidelines are from an earlier date of when they were last modified for the above changes (as this was worked on over a number of days). --- bin/cvt-submission.sh | 51 ++++++++++++++++- faq.html | 25 ++++++--- faq.md | 28 +++++++--- .../Makefile.entry => next/Makefile.example | 0 next/guidelines.html | 42 +++++++------- next/guidelines.md | 42 ++++++++------ next/rules.html | 6 +- next/rules.md | 6 +- template/entry/try.alt.sh | 54 +++++++++++++----- template/entry/try.sh | 55 ++++++++++++++----- thanks-for-help.html | 3 + thanks-for-help.md | 4 ++ 12 files changed, 228 insertions(+), 88 deletions(-) rename template/entry/Makefile.entry => next/Makefile.example (100%) diff --git a/bin/cvt-submission.sh b/bin/cvt-submission.sh index be4b9d7d4..8d00f0c63 100755 --- a/bin/cvt-submission.sh +++ b/bin/cvt-submission.sh @@ -10,6 +10,18 @@ # files for new authors, and update `author/author_handle.json` # for authors who won previously. # +# This script was written in 2024 by: +# +# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\ +# +# with useful improvements by: +# +# @xexyl +# https://xexyl.net Cody Boone Ferguson +# https://ioccc.xexyl.net +# +# "Because sometimes even the IOCCC Judges need some help." :-) +# # Copyright (c) 2024 by Landon Curt Noll. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and @@ -1011,6 +1023,7 @@ export REMARKS_MD="$YYYY_DIR/remarks.md" export TAR_BZ2="$YYYY_DIR/$ENTRY_ID.tar.bz2" export ENTRY_JSON="$YYYY_DIR/.entry.json" export DOT_GITIGNORE="$YYYY_DIR/.gitignore" +export TRY_SH="$YYYY_DIR/try.sh" export DOT_PATH="$YYYY_DIR/.path" export README_MD="$YYYY_DIR/README.md" export INDEX_HTML="$YYYY_DIR/index.html" @@ -1023,6 +1036,7 @@ export TEMPLATE_ENTRY_DIR="$TEMPLATE_DIR/entry" export TEMPLATE_GITIGNORE="$TEMPLATE_ENTRY_DIR/gitignore" export TEMPLATE_README_MD_HEAD="$TEMPLATE_ENTRY_DIR/README.md.head" export TEMPLATE_README_MD_TAIL="$TEMPLATE_ENTRY_DIR/README.md.tail" +export TEMPLATE_TRY_SH="$TEMPLATE_DIR/try.sh" # determine TARBALL filename @@ -1114,7 +1128,10 @@ if [[ ! -f $TEMPLATE_README_MD_TAIL ]]; then echo "$0: ERROR: missing template README.md.tail file: $TEMPLATE_README_MD_TAIL" 1>&2 exit 6 fi - +if [[ ! -f $TRY_SH ]]; then + echo "$0: ERROR: missing template try.sh file: $TRY_SH" 1>&2 + exit 6 +fi # firewall - verify chkentry tool # @@ -1911,6 +1928,7 @@ if [[ -z $NOOP ]]; then ((++count)) manifest_csv "$ORIG_C" 50 false c true "original source code" >> "$TMP_MANIFEST_CSV" + # collect manifest for extra_file(s) # export PATTERN @@ -2121,6 +2139,37 @@ if [[ -z $NOOP ]]; then manifest_csv .gitignore 4000000000 true gitignore true "list of files that should not be committed under git" \ >> "$TMP_MANIFEST_CSV" + # if try.sh does not exist, copy example over, otherwise just update + # manifest + # + if [[ ! -f $TRY_SH ]]; then + if [[ $V_FLAG -ge 3 ]]; then + echo "$0: debug[3]: about to run: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH" 1>&2 + cp -f -p -v "$YYYY_DIR/$PROG_C" "$TRY_SH" + status="$?" + if [[ $status -ne 0 ]]; then + echo "$0: ERROR: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH failed," \ + "error code: $status" 1>&2 + exit 55 + fi + else + cp -f -p "$TEMPLATE_TRY_SH" "$TRY_SH" + status="$?" + if [[ $status -ne 0 ]]; then + echo "$0: ERROR: cp -f -p $TEMPLATE_TRY_SH $TRY_SH failed," \ + "error code: $status" 1>&2 + exit 56 + fi + fi + fi + + # write manifest csv line for try.sh + # + ((++count)) + manifest_csv try.sh 100 true shellscript true "script to try entry" \ + >> "$TMP_MANIFEST_CSV" + + # form .path if needed # if [[ ! -f $DOT_PATH ]]; then diff --git a/faq.html b/faq.html index e07c66971..1255bd8be 100644 --- a/faq.html +++ b/faq.html @@ -788,9 +788,8 @@ or later SUS.
We recommend starting with the sample
+ We recommend starting with the sample
Makefile
-as found in the mkiocccentry GitHub repo,
(renamed as The Although the Jump to: top If you have alternate code that you are including, then you can use the
try.alt.sh template instead. We recommend that you include the use of these scripts in the Jump to: top Additionally you may install the The syntax of If the tool exits 0 then the document is valid JSON; otherwise it’ll
@@ -3092,6 +3100,9 @@ verbosity with the If the tool is not installed then you will obviously have to specify the path of
the tool. NOTE: the Jump to: top IMPORTANT: Be SURE to read the IOCCC rules. Jump to: topMakefile of course) as a starting point for your
entry’s Makefile.Makefile is a file used by the make(1) command that contains
@@ -835,9 +834,16 @@ program(s), clean up any files made by the program etc.
try
-
try.sh script
+system, which we do like, you can have this rule invoke the script
+(./try.sh).mkiocccentry(1) tool only checks for those rules, the most up to
+date
+Makefile.example,
+does have other rules like everything and alt, and we encourage you to use
+that one.try rule in the
+example Makefile that you modify for your submission. See the
+FAQ on “submission Makefiles.
@@ -3079,10 +3088,9 @@ toolkit, which includes the IOCCC version of the jparse(1) tool, lo
under the mkiocccentry directory as jparse/jparse.
jparse(1) tool from the jparse
repo:
+ git clone https://github.com/xexyl/jparse.git
- cd jparse
- make clobber all test
- sudo make install git clone https://github.com/ioccc-src/mkiocccentry.git
+ cd mkiocccentry && make clobber all" 1>&2
+ cd jparse && sudo make install clobber" 1>&2jparse(1) is very simple: jparse foo.json-v option. For instance: jparse -v 3 foo.jsonjparse subdirectory is a clone of the official jparse
+repo but we recommend you compile and
+install via the mkiocccentry repo because it has the dependencies built in.
diff --git a/faq.md b/faq.md
index 71230c8e9..50d876599 100644
--- a/faq.md
+++ b/faq.md
@@ -460,8 +460,7 @@ Jump to: [top](#)
diff --git a/template/entry/Makefile.entry b/next/Makefile.example
similarity index 100%
rename from template/entry/Makefile.entry
rename to next/Makefile.example
diff --git a/next/guidelines.html b/next/guidelines.html
index 977607053..744a905e2 100644
--- a/next/guidelines.html
+++ b/next/guidelines.html
@@ -465,7 +465,7 @@ writing by contacting the judges.
We recommend that you use the example -Makefile -from the IOCCC mkiocccentry repo, +
We recommend that you use the example
+Makefile,
renamed as Makefile of course, as the starting point for your submission’s
required Makefile. Feel free to modify the Makefile to suit your obfuscated
needs.
main;
@@ -1347,6 +1348,9 @@ do not assume this sort of code will work:
...
T[14] = ';'; /* modifying a string requires: -fwritable-strings */
+
char b[] = "Is this OK";
@@ -1559,7 +1563,7 @@ CPU, we might just try your submission on that emulator as well :-)
ARCH= -m64
diff --git a/next/guidelines.md b/next/guidelines.md
index a73ec5cd2..4d499d0aa 100644
--- a/next/guidelines.md
+++ b/next/guidelines.md
@@ -52,7 +52,7 @@ Jump to: [top](#)
**IMPORTANT**: Be **SURE** to read the [IOCCC rules](rules.html).
@@ -160,11 +160,9 @@ to account for the new [mkiocccentry repo](https://github.com/ioccc-src/mkioccce
@@ -863,7 +860,7 @@ Jump to: [top](#)
+
+
@@ -1159,7 +1161,7 @@ is NOT the smallest C source file that when compiled and run, dumps core:
@@ -1169,6 +1171,10 @@ do not assume this sort of code will work:
T[14] = ';'; /* modifying a string requires: -fwritable-strings */
```
+
+
@@ -1420,7 +1426,7 @@ CPU, we might just try your submission on that emulator as well :-)
If your submission **MUST** run only on a 64-bit or 32-bit architecture,
then you **MUST** specify the `-arch` on your command line
(see `ARCH` in the [example
-Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)). Do not assume a processor word size without specifying `-arch`. For example:
+Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example)). Do not assume a processor word size without specifying `-arch`. For example:
```
diff --git a/next/rules.html b/next/rules.html
index 41c82aaf3..6757699ef 100644
--- a/next/rules.html
+++ b/next/rules.html
@@ -466,7 +466,7 @@ writing by contacting the judges.
Jump to: top
IMPORTANT: Be sure to read the IOCCC guidelines.
Jump to: top
@@ -905,7 +905,7 @@ those requirements.
The target of the Makefile must be called prog. The original
diff --git a/next/rules.md b/next/rules.md
index a02271cf6..e1f1a9570 100644
--- a/next/rules.md
+++ b/next/rules.md
@@ -57,7 +57,7 @@ Jump to: [top](#)
Jump to: [top](#)
**IMPORTANT**: Be sure to read the [IOCCC guidelines](guidelines.html).
@@ -607,7 +607,7 @@ those requirements.
diff --git a/template/entry/try.alt.sh b/template/entry/try.alt.sh
index 824d31885..459d92974 100644
--- a/template/entry/try.alt.sh
+++ b/template/entry/try.alt.sh
@@ -1,32 +1,56 @@
#!/usr/bin/env bash
#
-# try.sh - demonstrate IOCCC entry abstract alternate code
-#
-# NOTE: if your submission wins and become an entry, 'abstract' will be changed
-# to the YYYY/directory name. You can remove this comment if you wish but if not
-# it'll be done by the judges.
+# try.alt.sh - demonstrate IOCCC entry YYYY/foo alternate code
+# XXX - try.alt.sh example version: 1.0.0-1 11-28-2024 - XXX
#
+# XXX - NOTE: if your submission wins and become an entry, then - XXX
+# XXX - YYYY/foo will be changed to the 4 digit year and directory - XXX
+# XXX - name. - XXX
+# XXX - NOTE: please remove the XXX lines in this file, including this one - XXX
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
-if [[ -z "$CC" ]]; then
- CC="cc"
-fi
+# XXX - if you need CC to be something else for some reason, say clang, - XXX
+# XXX - then change "cc" to that or whatever you need. - XXX
+# XXX - If you need other variables you can also set them in whatever way - XXX
+# XXX - you need; this is a good method, however, in cases where it's OK - XXX
+# XXX - to let the user redefine it. - XXX
+[[ -z "$CC" ]] && CC="cc"
+# XXX - make sure to compile the alt code, using make alt! - XXX
+# XXX - if you need to build the main program for the try.alt.sh script, - XXX
+# XXX - then change the 'alt' to 'all alt' in the below command. - XXX
+# XXX - Later, if the submission wins, it can be changed to 'everything'. - XXX
make CC="$CC" alt >/dev/null || exit 1
+# XXX - it's usually a good idea to clear the screen but if not done - XXX
+# XXX - then you should remove the comment about it and the command. - XXX
# clear screen after compilation so that only the entry is shown
clear
-# XXX - Invoke the program in one or more ways - XXX
-# XXX - It is good to use the shell built-in read to let the user - XXX
-# XXX - read what will happen and then proceed as they wish. - XXX
-# XXX - You may modify the command based on your program and you - XXX
-# XXX - may provide more than one invocation. - XXX
-# XXX - Please remove the XXX lines - XXX
-# XXX - an example follows - XXX
+# XXX - Invoke the program in one or more ways - XXX
+# XXX - NOTE: you can include more than one command line and you - XXX
+# XXX - certainly can include pipelines. - XXX
+
+# XXX - It is good to use the shell built-in read(1) to - XXX
+# XXX - let the user know what is about to be done, as - XXX
+# XXX - shown below, so they can proceed when ready. - XXX
+
+# XXX - You may modify the command based on your program and you - XXX
+# XXX - may provide more than one invocation. - XXX
+
+# XXX - Examples follow. - XXX
+
+# XXX - if the prompt will not be too long, say more than 80 chars - XXX
+# XXX - or so: - XXX
read -r -n 1 -p "Press any key to run: ./prog.alt: "
echo 1>&2
./prog.alt
+
+# XXX - Otherwise, for longer command lines, you might try: - XXX
+echo "$ ./prog.alt some long command line"
+read -r -n 1 -p "Press any key to continue: "
+./prog.alt some long command line
+
diff --git a/template/entry/try.sh b/template/entry/try.sh
index 096e1c13a..ad9eb97dd 100644
--- a/template/entry/try.sh
+++ b/template/entry/try.sh
@@ -1,32 +1,57 @@
#!/usr/bin/env bash
#
-# try.sh - demonstrate IOCCC entry abstract
-#
-# NOTE: if your submission wins and become an entry, 'abstract' will be changed
-# to the YYYY/directory name. You can remove this comment if you wish but if not
-# it'll be done by the judges.
+# try.sh - demonstrate IOCCC entry YYYY/foo
+# XXX - try.sh example version: 1.0.0-1 11-28-2024 - XXX
+
+# XXX - NOTE: if your submission wins and become an entry, then - XXX
+# XXX - YYYY/foo will be changed to the 4 digit year and directory - XXX
+# XXX - name. - XXX
+# XXX - NOTE: please remove the XXX lines in this file, including this one - XXX
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
-if [[ -z "$CC" ]]; then
- CC="cc"
-fi
+# XXX - if you need CC to be something else, say clang, then change cc - XXX
+# XXX - to whatever you need. - XXX
+# XXX - If you need other variables you can also set them in whatever way - XXX
+# XXX - you need; this is a good method, however, in cases where it's OK - XXX
+# XXX - to let the user redefine it. - XXX
+[[ -z "$CC" ]] && CC="cc"
+
+# XXX - make sure to compile the program, using make all! - XXX
+# XXX - if you need to build the alt code for the try.sh script, - XXX
+# XXX - then change the 'all' to 'all alt' in the below command. - XXX
+# XXX - Later, if the submission wins, it can be changed to 'everything'. - XXX
make CC="$CC" all >/dev/null || exit 1
+# XXX - it's usually a good idea to clear the screen but if not done - XXX
+# XXX - then you should remove the comment about it and the command. - XXX
# clear screen after compilation so that only the entry is shown
clear
-# XXX - Invoke the program in one or more ways - XXX
-# XXX - It is good to use the shell built-in read to let the user - XXX
-# XXX - read what will happen and then proceed as they wish. - XXX
-# XXX - You may modify the command based on your program and you - XXX
-# XXX - may provide more than one invocation. - XXX
-# XXX - Please remove the XXX lines - XXX
-# XXX - an example follows - XXX
+# XXX - Invoke the program in one or more ways - XXX
+# XXX - NOTE: you can include more than one command line and you - XXX
+# XXX - certainly can include pipelines. - XXX
+
+# XXX - It is good to use the shell built-in read(1) to - XXX
+# XXX - let the user know what is about to be done, as - XXX
+# XXX - shown below, so they can proceed when ready. - XXX
+
+# XXX - You may modify the command based on your program and you - XXX
+# XXX - may provide more than one invocation. - XXX
+
+# XXX - Examples follow. - XXX
+
+# XXX - if the prompt will not be too long, say more than 80 chars - XXX
+# XXX - or so: - XXX
read -r -n 1 -p "Press any key to run: ./prog: "
echo 1>&2
./prog
+
+# XXX - Otherwise, for longer command lines, you might try: - XXX
+echo "$ ./prog some long command line"
+read -r -n 1 -p "Press any key to continue: "
+./prog some long command line
diff --git a/thanks-for-help.html b/thanks-for-help.html
index 19bb79c28..efa6b8bc4 100644
--- a/thanks-for-help.html
+++ b/thanks-for-help.html
@@ -5125,6 +5125,9 @@ manually.
more easily run programs. It is not always useful but these scripts do a variety
of things to really show off the entries, so this really helps with the
presentation of the winning entries.
+Cody also added the example scripts for future submitters,
+try.sh and
+try.alt.sh.
Jump to: top
Website and manifest improvements
diff --git a/thanks-for-help.md b/thanks-for-help.md
index 923eed933..5bff3d8e0 100644
--- a/thanks-for-help.md
+++ b/thanks-for-help.md
@@ -7038,6 +7038,10 @@ more easily run programs. It is not always useful but these scripts do a variety
of things to really show off the entries, so this really helps with the
presentation of the winning entries.
+Cody also added the example scripts for future submitters,
+[try.sh](%%REPO_URL%%/next/try.sh) and
+[try.alt.sh](%%REPO_URL%%/next/try.alt.sh).
+
Jump to: [top](#)