Skip to content

Commit

Permalink
Merge pull request #908 from nodenv/pull-ruby-build
Browse files Browse the repository at this point in the history
pull ruby build
  • Loading branch information
jasonkarns authored Jun 2, 2024
2 parents 740afbc + 87fbdf7 commit c5e7f0f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
> TODO
> Use one of the scripts `script/update-*` to add a new Node version.
## Updating OpenSSL

Use `script/update-openssl`.

## Git configuration for fetching rbenv upstream

In order to continually pull changes from rbenv/ruby-build into node-build, it is necessary to add rbenv/ruby-build as a git remote.
Expand Down
4 changes: 4 additions & 0 deletions bin/node-build
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,10 @@ if [ -n "$VERBOSE" ]; then
tail -f "$LOG_PATH" &
TAIL_PID=$!
trap "kill $TAIL_PID" SIGINT SIGTERM EXIT
else
if [ -z "$NODE_BUILD_TESTING" ]; then
echo "To follow progress, use 'tail -f $LOG_PATH' or pass --verbose" >&2
fi
fi

export LDFLAGS="-L${PREFIX_PATH}/lib ${LDFLAGS}"
Expand Down
21 changes: 21 additions & 0 deletions script/update-openssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env ruby

raise "Usage: #{$0} NEW_VERSION SHA" unless ARGV.size == 2
new_version, sha = ARGV

major_minor = new_version.split('.')[0..1].join('.')

Dir.glob('share/ruby-build/*') do |file|
contents = File.read(file)

openssl_package = "\"openssl-#{major_minor}"

next unless contents.include? openssl_package

lines = contents.lines
line = lines.find { |line| line.include? openssl_package }
old_version = line[/"openssl-([\d.]+[a-z]?)"/, 1] or raise
line.gsub!(old_version, new_version)
line.sub!(/\.tar\.gz#(\h+)"/, ".tar.gz##{sha}\"")
File.write(file, lines.join)
end
1 change: 1 addition & 0 deletions test/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
BATS_TMPDIR="$BATS_TEST_DIRNAME/tmp"
export NODE_BUILD_CURL_OPTS=
export NODE_BUILD_HTTP_CLIENT="curl"
export NODE_BUILD_TESTING=true

load ../node_modules/bats-support/load
load ../node_modules/bats-assert/load
Expand Down

0 comments on commit c5e7f0f

Please sign in to comment.