-
Notifications
You must be signed in to change notification settings - Fork 154
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
Disable GNU make
implicit variables and Quiet ar
with ARFLAGS
rather than > null
#2711
base: main
Are you sure you want to change the base?
Changes from all commits
ba82ce9
0779fa9
9bb8710
7ce2a66
469487f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -14,6 +14,7 @@ CPPFLAGS := -Iinclude $(CPPFLAGS) | |||
CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -Wno-missing-braces -fPIC -fvisibility=hidden $(CFLAGS) | ||||
CC ?= cc | ||||
AR ?= ar | ||||
ARFLAGS ?= -r$(V0:1=v) | ||||
WASI_SDK_PATH := /opt/wasi-sdk | ||||
|
||||
MAKEDIRS ?= mkdir -p | ||||
|
@@ -37,7 +38,7 @@ build/libprism.$(SOEXT): $(SHARED_OBJECTS) | |||
|
||||
build/libprism.a: $(STATIC_OBJECTS) | ||||
$(ECHO) "building $@ with $(AR)" | ||||
$(Q) $(AR) $(ARFLAGS) $@ $(STATIC_OBJECTS) $(Q1:0=>/dev/null) | ||||
$(Q) $(AR) $(ARFLAGS) $@ $(STATIC_OBJECTS) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A quick text find shows that this was the only recipe where Line 6 in 17762fa
(I’m a novice in C-land; if the entire set of V s and Q s is a convention, introduce them to me.)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Writing to Null has always been questionable as we could simply not supply Alternate approaches include:
|
||||
|
||||
javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS) | ||||
$(ECHO) "building $@" | ||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -51,6 +51,7 @@ def make(env, target) | |||||||
system( | ||||||||
env, | ||||||||
RUBY_PLATFORM.match?(/openbsd|freebsd/) ? "gmake" : "make", | ||||||||
"--no-builtin-variables", # don't let GNU make implicit variables override variable fallbacks in the Makefile | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand what this is doing. Could you explain why we need this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As noted on the previous posts, this flag disables implicit variables for GNU Lines 15 to 17 in 9bb8710
|
||||||||
target, | ||||||||
exception: true | ||||||||
) | ||||||||
|
@@ -76,22 +77,22 @@ def make(env, target) | |||||||
# The C extension uses RbConfig, which contains values from the toolchain that built the running Ruby. | ||||||||
env = RbConfig::CONFIG.slice("SOEXT", "CPPFLAGS", "CFLAGS", "CC", "AR", "ARFLAGS", "MAKEDIRS", "RMALL") | ||||||||
|
||||||||
require "mkmf" | ||||||||
|
||||||||
# It's possible that the Ruby that is being run wasn't actually compiled on this | ||||||||
# machine, in which case parts of RbConfig might be incorrect. In this case | ||||||||
# we'll need to do some additional checks and potentially fall back to defaults. | ||||||||
if env.key?("CC") && !File.exist?(env["CC"]) | ||||||||
if env.key?("CC") && !find_executable(env["CC"]) | ||||||||
env.delete("CC") | ||||||||
env.delete("CFLAGS") | ||||||||
env.delete("CPPFLAGS") | ||||||||
end | ||||||||
|
||||||||
if env.key?("AR") && !File.exist?(env["AR"]) | ||||||||
if env.key?("AR") && !find_executable(env["AR"]) | ||||||||
env.delete("AR") | ||||||||
env.delete("ARFLAGS") | ||||||||
end | ||||||||
|
||||||||
require "mkmf" | ||||||||
|
||||||||
# First, ensure that we can find the header for the prism library. | ||||||||
generate_templates # Templates should be generated before find_header. | ||||||||
unless find_header("prism.h", File.expand_path("../../include", __dir__)) | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to #2716, the original
?=
s were once a workaround for #2716.That issue’s root cause’s separately fixed and 7c2461f purged its related
extconf.rb
code. Like this PR, I wonder if those lines are still necessary?