#5 Assign a random testing port
Merged 3 months ago by jaruga. Opened 3 months ago by jaruga.
rpms/ jaruga/rubygem-mysql2 feature/assign-a-random-testing-port  into  master

file modified
+3 -1

@@ -86,7 +86,9 @@ 

  

  TOP_DIR=$(pwd)

  # Use testing port because the standard mysqld port 3306 is occupied.

- MYSQL_TEST_PORT="13306"

+ # Assign a random port to consider a case of multi builds in parallel in a host.

+ # https://src.fedoraproject.org/rpms/rubygem-pg/pull-request/3

+ MYSQL_TEST_PORT="$((13306 + ${RANDOM} % 1000))"

  MYSQL_TEST_USER=$(id -un)

  MYSQL_TEST_DATA_DIR="${TOP_DIR}/data"

  MYSQL_TEST_SOCKET="${TOP_DIR}/mysql.sock"

The build failure due to the fixed testing port in %check section happens for rubygem-mysql2 in RHEL build system.
That is same situation with rubygem-pg.
I like fixing this as well as rubygem-pg.
https://src.fedoraproject.org/rpms/rubygem-pg/blob/master/f/rubygem-pg.spec#_85

I add below rubygem-pg's URL as a reference to both comment line and commit message.
https://github.com/ged/ruby-pg/pull/39

$ rpmlint -i ./*.spec /var/lib/mock/fedora-rawhide-x86_64/result/*.rpm
rubygem-mysql2.src: W: spelling-error Summary(en_US) libmysql -> liberalism
The value of this tag appears to be misspelled. Please double-check.

rubygem-mysql2.x86_64: W: spelling-error Summary(en_US) libmysql -> liberalism
The value of this tag appears to be misspelled. Please double-check.

rubygem-mysql2.x86_64: W: no-documentation
The package contains no documentation (README, doc, etc). You have to include
documentation files.

rubygem-mysql2.x86_64: E: zero-length /usr/lib64/gems/ruby/mysql2-0.5.2/gem.build_complete
rubygem-mysql2-doc.noarch: W: pem-certificate /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/ca-cert.pem
Shipping a PEM certificate is likely wrong. If used for the default
configuration, this is insecure ( since the certificate is public ). If this
is used for validation, ie a CA certificate store, then this must be kept up
to date due to CA compromise. The only valid reason is for testing purpose, so
ignore this warning if this is the case.

rubygem-mysql2-doc.noarch: W: pem-certificate /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/client-cert.pem
Shipping a PEM certificate is likely wrong. If used for the default
configuration, this is insecure ( since the certificate is public ). If this
is used for validation, ie a CA certificate store, then this must be kept up
to date due to CA compromise. The only valid reason is for testing purpose, so
ignore this warning if this is the case.

rubygem-mysql2-doc.noarch: E: wrong-script-interpreter /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh /usr/bin/env bash
This script uses an interpreter which is either an inappropriate one or
located in an inappropriate directory for packaged system software.

rubygem-mysql2-doc.noarch: E: non-executable-script /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh 644 /usr/bin/env bash
This text file contains a shebang or is located in a path dedicated for
executables, but lacks the executable bits and cannot thus be executed.  If
the file is meant to be an executable script, add the executable bits,
otherwise remove the shebang or move the file elsewhere.

rubygem-mysql2-doc.noarch: W: pem-certificate /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/server-cert.pem
Shipping a PEM certificate is likely wrong. If used for the default
configuration, this is insecure ( since the certificate is public ). If this
is used for validation, ie a CA certificate store, then this must be kept up
to date due to CA compromise. The only valid reason is for testing purpose, so
ignore this warning if this is the case.

5 packages and 1 specfiles checked; 3 errors, 6 warnings.
rubygem-mysql2-doc.noarch: E: wrong-script-interpreter /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh /usr/bin/env bash
This script uses an interpreter which is either an inappropriate one or
located in an inappropriate directory for packaged system software.

rubygem-mysql2-doc.noarch: E: non-executable-script /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh 644 /usr/bin/env bash

The relevant errors (above) seem rather easy to fix. Are you going to do a build after this PR? If yes, it should probably contain those fixes.

rubygem-mysql2-doc.noarch: W: pem-certificate /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/client-cert.pem

I do wonder why they have *.pem files when they also have a script to generate them(spec/ssl/gen_certs.sh).

The relevant errors (above) seem rather easy to fix. Are you going to do a build after this PR? If yes, it should probably contain those fixes.

Yeah, it can be easy. The choice is if we include the fix in this PR or another PR.

No, I am not planing to build (fedpkg build) after this PR. Because this PR does not affect the actual released binary RPM package.
That's the reason I did not do a release dump adding change log.

I do wonder why they have *.pem files when they also have a script to generate them(spec/ssl/gen_certs.sh).

I am not sure the reason.
The real time generated *.pem files in the testing process might be new small feature on the upstream.

If you do not intend to build we can move any issues to that build PR IMO, and merge this PR alonside with that. (I'd rather not merge without any build. IOW keeping master status in sync with build status.)

This link seems unrelevant, I would personally link to rubygem-pg PR.

If you do not intend to build we can move any issues to that build PR IMO, and merge this PR alonside with that. (I'd rather not merge without any build. IOW keeping master status in sync with build status.)

Do you know rubygem-pg is not built after this kind of commit was merged?
https://src.fedoraproject.org/rpms/rubygem-pg/commits/master

When rpms/ruby's commit "Add zlib-devel as BuildRequire" was merged in a past time, the build was not executed soon.
https://src.fedoraproject.org/rpms/ruby/commits/master

IOW keeping master status in sync with build status.

So, why do you have the opinion for only this rubygem-mysql2 case?

I can do something as you like.

Below process is possible

  1. This PR is merged.
  2. Another PR to fix the lint issue is merged.
  3. Then I can build this package.

So, why do you have the opinion for only this rubygem-mysql2 case?

It's just a personal preference to merge enhancements as needed, opposite to (build) fixes.

I can do something as you like.
Below process is possible

This PR is merged.
Another PR to fix the lint issue is merged.
Then I can build this package.

I see no need to build the package if the built content is the same.

rebased onto cc15309

3 months ago

@pvalena Now I rebased.

Now 2 commits in this PR.
1st commit: for random testing port.
2nd commit to fix rpmlint issue.

As 2nd commit is to change released file (the build content), I did release dump.
After this PR will be merged, I will do "fedpkg build".

This link seems unrelevant, I would personally link to rubygem-pg PR.

I changed it to your suggested link.

Now the rpmlint result is like this. I think this is okay.

rpmlint -i ./*.spec /var/lib/mock/fedora-rawhide-x86_64/result/*.rpm
rubygem-mysql2.src: W: spelling-error Summary(en_US) libmysql -> liberalism
The value of this tag appears to be misspelled. Please double-check.

rubygem-mysql2.x86_64: W: spelling-error Summary(en_US) libmysql -> liberalism
The value of this tag appears to be misspelled. Please double-check.

rubygem-mysql2.x86_64: W: no-documentation
The package contains no documentation (README, doc, etc). You have to include
documentation files.

rubygem-mysql2.x86_64: E: zero-length /usr/lib64/gems/ruby/mysql2-0.5.2/gem.build_complete
rubygem-mysql2-doc.noarch: E: wrong-script-interpreter /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh /usr/bin/env bash
This script uses an interpreter which is either an inappropriate one or
located in an inappropriate directory for packaged system software.

rubygem-mysql2-doc.noarch: E: non-executable-script /usr/share/gems/gems/mysql2-0.5.2/spec/ssl/gen_certs.sh 644 /usr/bin/env bash
This text file contains a shebang or is located in a path dedicated for
executables, but lacks the executable bits and cannot thus be executed.  If
the file is meant to be an executable script, add the executable bits,
otherwise remove the shebang or move the file elsewhere.

5 packages and 1 specfiles checked; 3 errors, 3 warnings.

Can you review again? Thanks.

I also checked the pem files are not included in the binary RPM files.

LGTM, although I think me previous comment is still valid.

Since there's no change in the main package I see no need to build the package.
IMHO it can be simply merged before other changes (e.g. rebase or FTBFS), preserving the Release from this PR.

Sure, I will move the 2nd commit to another PR. then merge this PR with only 1st commit now.
Thanks for the review.

1 new commit added

  • Assign a random testing port
3 months ago

Pull-Request has been merged by jaruga

3 months ago