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

MSWin32 compatibility and test portability #47

Merged
merged 4 commits into from Feb 9, 2022

Conversation

zmughal
Copy link
Contributor

@zmughal zmughal commented Nov 29, 2021

This PR replaces #44.

  • Add generic CI workflow
  • MSWin32 compatibility
  • Use platform-specific endpoints for testing connections

@zmughal
Copy link
Contributor Author

zmughal commented Dec 29, 2021

@calid, do you have a chance to look at this?

@zmughal
Copy link
Contributor Author

zmughal commented Feb 1, 2022

Hi @calid, is there anything else you would like to see for this PR?

@ghenry
Copy link
Contributor

ghenry commented Feb 8, 2022

Hi @zmughal

I'm helping maintain this now. Can you have a look at https://github.com/zeromq/perlzmq/runs/4348450971?check_suite_focus=true

Thanks.

@zmughal
Copy link
Contributor Author

zmughal commented Feb 8, 2022

Hello @ghenry, thank you for taking a look.

That is due to my adding of another Dist::Zilla plugin (https://metacpan.org/pod/Dist::Zilla::Plugin::DynamicPrereqs so that Sys::SigAction is only a test requirement for non-MSWin32 systems). It requires pushing a new version of the calid/zmq-ffi-testenv:ubuntu Docker image so that all the authordeps are available.

What I can do in a commit is update that CI workflow to install the missing deps so that it passes, but at some point a new Docker image will need to be used.

@calid
Copy link
Member

calid commented Feb 8, 2022

@ghenry scripts/docker-build and scripts/docker-push can help with building/updating the docker images (run once working directory is in the desired state)

@ghenry
Copy link
Contributor

ghenry commented Feb 8, 2022

Thanks. I'll look to update the images tomorrow evening.

@calid
Copy link
Member

calid commented Feb 8, 2022

sounds good, I can either add your docker id as a collaborator on the existing docker hub repos, or you can just change to your own, whichever you prefer

@ghenry
Copy link
Contributor

ghenry commented Feb 8, 2022

Cool. Can you add sentrypeer user in as that's the only one I've set up on DH so far.

@calid
Copy link
Member

calid commented Feb 8, 2022

added, let me know if any issues

@zmughal zmughal force-pushed the mswin32-compat branch 3 times, most recently from 9286f4c to b9cf0f7 Compare February 8, 2022 22:03
@ghenry
Copy link
Contributor

ghenry commented Feb 8, 2022

Sorry, let me keep that user clean. I have https://hub.docker.com/u/gavinhenry too. Could you swap when you get a sec?

Thanks.

@zmughal zmughal force-pushed the mswin32-compat branch 4 times, most recently from 4a3c1f8 to a4f595c Compare February 8, 2022 22:51
@calid
Copy link
Member

calid commented Feb 8, 2022

Sorry, let me keep that user clean. I have https://hub.docker.com/u/gavinhenry too. Could you swap when you get a sec?

Thanks.

Done!

@zmughal
Copy link
Contributor Author

zmughal commented Feb 8, 2022

@ghenry, @calid, the PR should be ready now (fixed the authordeps and updated the recently merged tests for #46).

- Use standard ZMQ DLL name for MSWin32.
- Add test helper library for determining platform capabilities
  for testing.
- Only use test dependency `Sys::SigAction` on non-MSWin32.
- Skip tests that use `fork(2)` on MSWin32.
- Skip tests for `get_fd()` as this is currently only implemented
  for Unix-likes.
The `zmq_ipc(7)` protocol is implemented using Unix domain sockets
(which are not available on MSWin32). On platforms with Unix domain
sockets, use `ipc://` and use `inproc://` elsewhere.
@ghenry ghenry merged commit ce5dc26 into zeromq:master Feb 9, 2022
@ghenry
Copy link
Contributor

ghenry commented Feb 9, 2022

Updating Docker images now.

@ghenry
Copy link
Contributor

ghenry commented Feb 9, 2022

What's the workflow for getting/setting a version for docker-build and docker-push scripts?

@zmughal zmughal deleted the mswin32-compat branch February 9, 2022 16:05
@ghenry
Copy link
Contributor

ghenry commented Feb 16, 2022

Should get time for this tonight/tomorrow. Thanks for all the pointers!

@ghenry
Copy link
Contributor

ghenry commented Feb 17, 2022

Yep! I usually did it from within the container using the release shell script in case something went sad, but I think the GitHub actions are running the full test harness and build/install so if that looks good probably safe to just straight up docker-run dzil release

Running this now:

TAG="1.18"; ./scripts/docker-build $TAG && ./scripts/docker-push $TAG

but I'm being dumb. What is docker-run ?

@ghenry
Copy link
Contributor

ghenry commented Feb 17, 2022

Failure :-(

xisofs-1.3/install.pl
xisofs-1.3/HISTORY
xisofs-1.3/VERSION
xisofs-1.3/xisofs.pl
xisofs-1.3/Bubble.pm
Entering xisofs-1.3
META.yml/json not found. Creating skeleton for it.
! The distribution doesn't have a proper Makefile.PL/Build.PL See /root/.cpanm/work/1645096535.8/build.log for details.
Searching 255 () on cpanmetadb ...
! Finding 255 on cpanmetadb failed.
! Could not find a release matching 255 on MetaCPAN.
Searching 255 on mirror http://www.cpan.org ...
! Finding 255 () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution 255
Searching (65280) () on cpanmetadb ...
! Finding (65280) on cpanmetadb failed.
! Could not find a release matching (65280) on MetaCPAN.
Searching (65280) on mirror http://www.cpan.org ...
! Finding (65280) () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution (65280)
Configuring xisofs-1.3 ... N/A
The command '/bin/sh -c cd /zmq-ffi && dzil listdeps --missing | cpanm -v' returned a non-zero code: 1

@calid
Copy link
Member

calid commented Feb 17, 2022

but I'm being dumb. What is docker-run ?

it's just a helper script at the top level of the repo

https://github.com/zeromq/perlzmq/blob/master/docker-run

there's also docker-shell

https://github.com/zeromq/perlzmq/blob/master/docker-shell

@calid
Copy link
Member

calid commented Feb 17, 2022

Failure :-(
...
! Finding 255 on cpanmetadb failed.

This looks like something is misconfigured or typo'd somewhere... I would maybe checkout before the recent PR's and try a build to confirm if it's something in the recent changes

@ghenry
Copy link
Contributor

ghenry commented Feb 17, 2022

Idiot! I should have spotted that. Will try again. Thanks.

@ghenry
Copy link
Contributor

ghenry commented Feb 17, 2022

Everything is failing due to Dist::Zilla::Plugin::DynamicPrereqs not being installed for whats in dist.ini

What's the best way to add this? Inside Dockerfile via cpanm?

@calid
Copy link
Member

calid commented Feb 17, 2022

Everything is failing due to Dist::Zilla::Plugin::DynamicPrereqs not being installed for whats in dist.ini

What's the best way to add this? Inside Dockerfile via cpanm?

yeah, fire up a shell inside the docker container (docker-shell helper), fixup dependencies as you would normally using standard commands, get everything in a happy state, and then cut/publish an image once things look good.

And in case it wasn't obvious, the only difference between the docker-shell and docker-release-shell helpers is the release shell bind mounts .ssh and other directories needed for push permissions... hence I wouldn't use it when creating vanilla images for any contributor to use, and just for doing an actual release

@ghenry
Copy link
Contributor

ghenry commented Feb 17, 2022 via email

@ghenry
Copy link
Contributor

ghenry commented Feb 23, 2022

Sorry about the delay. I did get a shell on this image and install the dep, but still failing to build. Will dig in more.

@zmughal
Copy link
Contributor Author

zmughal commented Mar 7, 2022

@ghenry, is there anything I can do to help? I have put together a PR at #49 that should allow for creating a new Docker image using ./scripts/docker-build.

@ghenry
Copy link
Contributor

ghenry commented Mar 7, 2022

Cool. Thanks. I'll check it out today.

@zmughal
Copy link
Contributor Author

zmughal commented Mar 18, 2022

Hello @ghenry, were you able to make some progress on this release?

I would like to use it to switch the dependencies of Devel::IPerl from ZMQ::LibZMQ3 to ZMQ::FFI. Let me know if there are any blockers and I can investigate.

@ghenry
Copy link
Contributor

ghenry commented Mar 18, 2022

A MetaCPAN release?

@zmughal
Copy link
Contributor Author

zmughal commented Mar 18, 2022

Yes, an upload to CPAN. Should be just (from a clean checkout):

  1. Update Docker:
./scripts/docker-build 1.18 && ./scripts/docker-push 1.18
  1. Run release shell:
./scripts/docker-release-shell
  1. and inside the release shell, run:
dzil build && cpanm --installdeps ./ZMQ-FFI-1.18.tar.gz && dzil release

Also, if you get a chance, could you review #50?

@ghenry
Copy link
Contributor

ghenry commented Mar 18, 2022 via email

@ghenry
Copy link
Contributor

ghenry commented Mar 18, 2022 via email

@ghenry
Copy link
Contributor

ghenry commented Mar 18, 2022

Last step I get:
Screenshot from 2022-03-18 21-42-30

@zmughal
Copy link
Contributor Author

zmughal commented Mar 18, 2022

Ah, that happens when you do not have a .gitconfig. An empty file should be fine.

Run this outside the Docker

touch ~/.gitconfig

and then re-run the Docker release shell.

@zmughal
Copy link
Contributor Author

zmughal commented Mar 18, 2022

Actually, better than empty one would be one with your author and e-mail info: https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration.

@zmughal
Copy link
Contributor Author

zmughal commented Mar 18, 2022

Make sure all of these exist on the host: https://github.com/zeromq/perlzmq/blob/master/scripts/docker-release-shell

  • .ssh directory (to push to GitHub)
  • .pause file (to upload to CPAN)
  • .gitconfig file (to configure git when it runs / commits)
  • .gitignore file (this is not necessary afaict)

@zmughal
Copy link
Contributor Author

zmughal commented Mar 21, 2022

@ghenry, did setting up the dotfiles work on your end?

@ghenry
Copy link
Contributor

ghenry commented Mar 21, 2022

Trying again today.

@ghenry
Copy link
Contributor

ghenry commented Mar 21, 2022 via email

@ghenry
Copy link
Contributor

ghenry commented Mar 21, 2022 via email

@ghenry
Copy link
Contributor

ghenry commented Mar 21, 2022 via email

@zmughal
Copy link
Contributor Author

zmughal commented Mar 21, 2022

Excellent! Thank you!

@zmughal
Copy link
Contributor Author

zmughal commented Mar 21, 2022

You might want to also do:

git push --tags

because I don't see a tag for 1.18 yet https://github.com/zeromq/perlzmq/tags.

@ghenry
Copy link
Contributor

ghenry commented Mar 21, 2022 via email

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

Successfully merging this pull request may close these issues.

None yet

3 participants