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

DPL-936-5 - As developers we need to fork JSON API 0.9.0 so we can fix a minor issues so we can upgrade rails to 6.1 to apply the security fix #4014

Closed
4 tasks done
stevieing opened this issue Feb 5, 2024 · 1 comment · Fixed by #4022
Assignees
Labels
Size: S Small - low effort & risk Technical Debt Update Aging Framework Dependencies OKR Value: 3 Value to the insitute is average

Comments

@stevieing
Copy link
Contributor

stevieing commented Feb 5, 2024

User story
As developers we need to fork JSON API 0.9.0 so we can fix a minor issues so we can upgrade rails to 6.1 to apply the security fix

Who are the primary contacts for this story
Abdullah / Steve

Who is the nominated tester for UAT
PSD

Acceptance criteria
To be considered successful the solution must allow:

Dependencies
This story is blocked by the following dependencies:

  • #<issue_no.>
  • sanger/#<issue_no.>

References
This story has a non-blocking relationship with:

Additional context
Add any other context or screenshots about the feature request here.

@stevieing stevieing added Size: M Medium - medium effort & risk Value: 3 Value to the insitute is average Technical Debt Update Aging Framework Dependencies OKR labels Feb 5, 2024
@stevieing stevieing changed the title DPL-936-3 - As developers we need to fork JSON API 0.9.0 so we can fix a minor issues so we can upgrade rails to 6.1 to apply the security fix DPL-936-5 - As developers we need to fork JSON API 0.9.0 so we can fix a minor issues so we can upgrade rails to 6.1 to apply the security fix Feb 5, 2024
@stevieing stevieing added Size: S Small - low effort & risk and removed Size: M Medium - medium effort & risk labels Feb 8, 2024
@dasunpubudumal dasunpubudumal self-assigned this Feb 16, 2024
@dasunpubudumal
Copy link
Contributor

dasunpubudumal commented Feb 17, 2024

Documenting some errors that came up and the resolutions:

Installing mysql2 0.5.5 with native extensions
Using record_loader 0.3.0 from https://github.com/sanger/record_loader (at master@9e7481f)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/mysql2-0.5.5/ext/mysql2
/Users/dp27/.rbenv/versions/3.0.6/bin/ruby -I /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0 -r ./siteconf20240217-35677-431vn1.rb extconf.rb --with-opt-dir\=/opt/homebrew/opt/openssl@3
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_gc_mark_movable()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enc_interned_str() in ruby.h... yes
-----
Using --with-openssl-dir=/Users/dp27/.rbenv/versions/3.0.6/openssl
-----
-----
Using mysql_config at /opt/homebrew/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_DEFAULT_AUTH in mysql.h... yes
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... no
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /opt/homebrew/Cellar/mysql/8.3.0/lib
-----
creating Makefile

current directory: /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/mysql2-0.5.5/ext/mysql2
make DESTDIR\= clean

current directory: /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/mysql2-0.5.5/ext/mysql2
make DESTDIR\=
compiling client.c
In file included from client.c:15:
./mysql_enc_name_to_ruby.h:43:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
mysql2_mysql_enc_name_to_rb_hash (str, len)
^
./mysql_enc_name_to_ruby.h:86:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
mysql2_mysql_enc_name_to_rb (str, len)
^
client.c:1438:3: error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  mysql_ssl_set(wrapper->client,
  ^
client.c:1438:3: note: did you mean 'mysql_close'?
/opt/homebrew/Cellar/mysql/8.3.0/include/mysql/mysql.h:797:14: note: 'mysql_close' declared here
void STDCALL mysql_close(MYSQL *sock);
             ^
2 warnings and 1 error generated.
make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/mysql2-0.5.5 for inspection.
Results logged to /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/extensions/arm64-darwin-23/3.0.0/mysql2-0.5.5/gem_make.out

  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in `run'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:44:in `block in make'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in `each'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in `make'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/tempfile.rb:317:in `open'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:159:in `build_extension'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:193:in `block in build_extensions'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `each'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `build_extensions'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/installer.rb:837:in `build_extensions'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/source/rubygems.rb:204:in `install'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:54:in `install'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:59:in `block in install_with_settings'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/rubygems_integration.rb:575:in `install_with_build_args'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:59:in `install_with_settings'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/worker.rb:62:in `apply_func'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/worker.rb:57:in `block in process_queue'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/worker.rb:54:in `loop'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/worker.rb:54:in `process_queue'
  /Users/dp27/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing mysql2 (0.5.5), and Bundler cannot continue.

In Gemfile:
  mysql2

== Command ["bundle install --jobs 4 --retry 3"] failed ==
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.bundle
ld: warning: ignoring duplicate libraries: '-lruby.3.0'
ld: library 'zstd' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1

make failed, exit code 2

We solved this by executing the following command:

bundle config build.mysql2 -- --with-cflags="-Wno-error=implicit-function-declaration" --with-ldflags=-L$(brew --prefix zstd)/lib

@dasunpubudumal dasunpubudumal linked a pull request Feb 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S Small - low effort & risk Technical Debt Update Aging Framework Dependencies OKR Value: 3 Value to the insitute is average
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants