Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE!] Proposed packaging for opam releases #1

Closed
wants to merge 3 commits into from

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Mar 12, 2024

On my fork I have two branches 20240902-1 and opam which demonstrate a proposed means of producing tarballs automatically from GitHub commits.

This PR isn't intended to be merged; assuming we're happy with this I will push these two branches to this repo.

The idea is to create a package which when installed in opam provides the files needed for winpthreads when configuring OCaml (the packaging for Windows handles flexdll in the same way).

The tarball produced by this branch contains:

C:\Devel>tar tf 20240902-1.tar.gz
winpthreads-20240902-1/
winpthreads-20240902-1/COPYING
winpthreads-20240902-1/README
winpthreads-20240902-1/include/
winpthreads-20240902-1/include/pthread.h
winpthreads-20240902-1/include/pthread_compat.h
winpthreads-20240902-1/include/pthread_signal.h
winpthreads-20240902-1/include/pthread_time.h
winpthreads-20240902-1/include/pthread_unistd.h
winpthreads-20240902-1/include/sched.h
winpthreads-20240902-1/include/semaphore.h
winpthreads-20240902-1/src/
winpthreads-20240902-1/src/barrier.c
winpthreads-20240902-1/src/barrier.h
winpthreads-20240902-1/src/clock.c
winpthreads-20240902-1/src/cond.c
winpthreads-20240902-1/src/cond.h
winpthreads-20240902-1/src/libgcc/
winpthreads-20240902-1/src/misc.c
winpthreads-20240902-1/src/misc.h
winpthreads-20240902-1/src/mutex.c
winpthreads-20240902-1/src/nanosleep.c
winpthreads-20240902-1/src/ref.c
winpthreads-20240902-1/src/ref.h
winpthreads-20240902-1/src/rwlock.c
winpthreads-20240902-1/src/rwlock.h
winpthreads-20240902-1/src/sched.c
winpthreads-20240902-1/src/sem.c
winpthreads-20240902-1/src/sem.h
winpthreads-20240902-1/src/spinlock.c
winpthreads-20240902-1/src/thread.c
winpthreads-20240902-1/src/thread.h
winpthreads-20240902-1/src/winpthread_internal.h
winpthreads-20240902-1/src/wpth_ver.h
winpthreads-20240902-1/winpthreads.install

Instructions in scripts/README.md document the process for creating a
"release branch"
Copy link

@shym shym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very elegant solution to package winpthreads, congratulations!
I pushed a couple of small suggestions with 2 commits on my 20240902-1 branch.
And I wondered about your first commit as I see it empty: was that on purpose?

@@ -0,0 +1,9 @@
#/bin/sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: this a comment instead of a shebang :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, I meant it to be a Sixth Edition Unix Shell Script 😉

d635af4d9 again:

```console
$ git checkout -b 20240902-1 d635af4d9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn’t that meant to be 20240209 rather than 20240902?

@dra27
Copy link
Member Author

dra27 commented Mar 13, 2024

Thanks, @shym - I've force pushed both typo suggestions to https://github.com/dra27/winpthreads/commits/opam.

For the shell script, I guess I spend too long contorting around sh scripts, because one can't guarantee the presence of bash, but that really doesn't matter here! I had one question, though - is there a technical reason to prefer printf vs echo? In this case, echo seems clearer, but I wonder that I'm missing something?

@dra27
Copy link
Member Author

dra27 commented Mar 13, 2024

Branches pushed! :shipit:

@dra27 dra27 closed this Mar 13, 2024
@shym
Copy link

shym commented Mar 13, 2024

is there a technical reason to prefer printf vs echo?

I just found printf ' "%s" { "%s" }\n' "$f" "$f" easier to read than echo " \"$f\" { \"$f\" }" and then used printf everywhere for uniformity.
(I often end up replacing echo because echo -e is not portable, but that isn't a concern here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants