Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
omus authored Nov 1, 2024
2 parents eefcc8c + 7d81897 commit 4d62745
Show file tree
Hide file tree
Showing 71 changed files with 1,610 additions and 1,346 deletions.
63 changes: 47 additions & 16 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,51 @@ SPACE:=$(eval) $(eval)
export LC_ALL=C
export LANG=C

# Respect `FORCE_COLOR` environment variable: <https://force-color.org/>.
ifndef FORCE_COLOR
FORCE_COLOR := ""
endif

# Respect `NO_COLOR` environment variable: <https://no-color.org/>.
ifndef NO_COLOR
NO_COLOR := ""
endif

# When both `FORCE_COLOR` and `NO_COLOR` are defined, the former has precedence.
ifneq ($(FORCE_COLOR), "")
NO_COLOR = ""
endif

WARNCOLOR:="\033[33;1m"
ENDCOLOR:="\033[0m"

CCCOLOR:="\033[34m"
LINKCOLOR:="\033[34;1m"
PERLCOLOR:="\033[35m"
FLISPCOLOR:="\033[32m"
JULIACOLOR:="\033[32;1m"
DTRACECOLOR:="\033[32;1m"

SRCCOLOR:="\033[33m"
BINCOLOR:="\033[37;1m"
JULCOLOR:="\033[34;1m"

ifneq ($(NO_COLOR), "")
WARNCOLOR:=""
ENDCOLOR:=""

CCCOLOR:=""
LINKCOLOR:=""
PERLCOLOR:=""
FLISPCOLOR:=""
JULIACOLOR:=""
DTRACECOLOR:=""

SRCCOLOR:=""
BINCOLOR:=""
JULCOLOR:=""
endif

# We need python for things like BB triplet recognition and relative path computation.
# We don't really care about version, generally, so just find something that works:
PYTHON := "$(shell which python 2>/dev/null || which python3 2>/dev/null || which python2 2>/dev/null || echo "{python|python3|python2} not found")"
Expand All @@ -140,7 +185,7 @@ ifeq ($(BUILDROOT),)
ifeq ("$(origin O)", "command line")
BUILDROOT := $(abspath $O)
BUILDDIR := $(abspath $(BUILDROOT)/$(call rel_path,$(JULIAHOME),$(SRCDIR)))
$(info $(shell printf '\033[32;1mBuilding into $(BUILDROOT)\033[0m')) # use printf to expand the escape sequences
$(info $(shell printf '$(JULIACOLOR)Building into $(BUILDROOT)$(ENDCOLOR)')) # use printf to expand the escape sequences
else
BUILDROOT:=$(JULIAHOME)
endif
Expand Down Expand Up @@ -1759,24 +1804,10 @@ ifndef VERBOSE
VERBOSE := 0
endif

WARNCOLOR:="\033[33;1m"
ENDCOLOR:="\033[0m"

ifeq ($(VERBOSE), 0)

QUIET_MAKE = -s

CCCOLOR:="\033[34m"
LINKCOLOR:="\033[34;1m"
PERLCOLOR:="\033[35m"
FLISPCOLOR:="\033[32m"
JULIACOLOR:="\033[32;1m"
DTRACECOLOR:="\033[32;1m"

SRCCOLOR:="\033[33m"
BINCOLOR:="\033[37;1m"
JULCOLOR:="\033[34;1m"

GOAL=$(subst ','\'',$(subst $(abspath $(JULIAHOME))/,,$(abspath $@)))

PRINT_CC = printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$(GOAL)$(ENDCOLOR); $(1)
Expand All @@ -1797,7 +1828,7 @@ PRINT_FLISP = echo '$(subst ','\'',$(1))'; $(1)
PRINT_JULIA = echo '$(subst ','\'',$(1))'; $(1)
PRINT_DTRACE = echo '$(subst ','\'',$(1))'; $(1)

endif
endif # VERBOSE

# Makefile debugging trick:
# call print-VARIABLE to see the runtime value of any variable
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ testall1: check-whitespace $(JULIA_BUILD_MODE)

test-%: check-whitespace $(JULIA_BUILD_MODE) .FORCE
@([ $$(( $$(date +%s) - $$(date -r $(build_private_libdir)/sys.$(SHLIB_EXT) +%s) )) -le 100 ] && \
printf '\033[93m HINT The system image was recently rebuilt. Are you aware of the test-revise-* targets? See CONTRIBUTING.md. \033[0m\n') || true
printf '$(WARNCOLOR) HINT The system image was recently rebuilt. Are you aware of the test-revise-* targets? See CONTRIBUTING.md. $(ENDCOLOR)\n') || true
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test $* JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)

test-revise-%: .FORCE
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Command-line option changes
* The `-m/--module` flag can be passed to run the `main` function inside a package with a set of arguments.
This `main` function should be declared using `@main` to indicate that it is an entry point.
* Enabling or disabling color text in Julia can now be controlled with the
[`NO_COLOR`](https://no-color.org/) or [`FORCE_COLOR`](https://force-color.org/) environment
variables. ([#53742]).
[`NO_COLOR`](https://no-color.org/) or [`FORCE_COLOR`](https://force-color.org/) environment
variables. These variables are also honored by Julia's build system ([#53742], [#56346]).
* `--project=@temp` starts Julia with a temporary environment.
* New `--trace-compile-timing` option to report how long each method reported by `--trace-compile` took
to compile, in ms. ([#54662])
Expand Down
1 change: 0 additions & 1 deletion THIRDPARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ for exceptions.
- [crc32c.c](https://stackoverflow.com/questions/17645167/implementing-sse-4-2s-crc32c-in-software) (CRC-32c checksum code by Mark Adler) [[ZLib](https://opensource.org/licenses/Zlib)].
- [LDC](https://github.com/ldc-developers/ldc/blob/master/LICENSE) (for ccall/cfunction ABI definitions) [BSD-3]. The portion of code that Julia uses from LDC is [BSD-3] licensed.
- [LLVM](https://releases.llvm.org/3.9.0/LICENSE.TXT) (for parts of src/disasm.cpp) [UIUC]
- [MINGW](https://sourceforge.net/p/mingw/mingw-org-wsl/ci/legacy/tree/mingwrt/mingwex/dirname.c) (for dirname implementation on Windows) [MIT]
- [NetBSD](https://www.netbsd.org/about/redistribution.html) (for setjmp, longjmp, and strptime implementations on Windows) [BSD-3]
- [Python](https://docs.python.org/3/license.html) (for strtod implementation on Windows) [PSF]
- [FEMTOLISP](https://github.com/JeffBezanson/femtolisp) [BSD-3]
Expand Down
1 change: 0 additions & 1 deletion base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ function Core._hasmethod(@nospecialize(f), @nospecialize(t)) # this function has
return Core._hasmethod(tt)
end


# core operations & types
include("promotion.jl")
include("tuple.jl")
Expand Down
6 changes: 3 additions & 3 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,11 @@ function CodeInstance(
mi::MethodInstance, owner, @nospecialize(rettype), @nospecialize(exctype), @nospecialize(inferred_const),
@nospecialize(inferred), const_flags::Int32, min_world::UInt, max_world::UInt,
effects::UInt32, @nospecialize(analysis_results),
relocatability::UInt8, edges::Union{DebugInfo,Nothing})
relocatability::UInt8, di::Union{DebugInfo,Nothing}, edges::SimpleVector)
return ccall(:jl_new_codeinst, Ref{CodeInstance},
(Any, Any, Any, Any, Any, Any, Int32, UInt, UInt, UInt32, Any, UInt8, Any),
(Any, Any, Any, Any, Any, Any, Int32, UInt, UInt, UInt32, Any, UInt8, Any, Any),
mi, owner, rettype, exctype, inferred_const, inferred, const_flags, min_world, max_world,
effects, analysis_results, relocatability, edges)
effects, analysis_results, relocatability, di, edges)
end
GlobalRef(m::Module, s::Symbol) = ccall(:jl_module_globalref, Ref{GlobalRef}, (Any, Any), m, s)
Module(name::Symbol=:anonymous, std_imports::Bool=true, default_names::Bool=true) = ccall(:jl_f_new_module, Ref{Module}, (Any, Bool, Bool), name, std_imports, default_names)
Expand Down
50 changes: 45 additions & 5 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,51 @@ function close(c::Channel, @nospecialize(excp::Exception))
nothing
end

# Use acquire here to pair with release store in `close`, so that subsequent `isready` calls
# are forced to see `isready == true` if they see `isopen == false`. This means users must
# call `isopen` before `isready` if you are using the race-y APIs (or call `iterate`, which
# does this right for you).
isopen(c::Channel) = ((@atomic :acquire c.state) === :open)
"""
isopen(c::Channel)
Determines whether a [`Channel`](@ref) is open for new [`put!`](@ref) operations.
Notice that a `Channel`` can be closed and still have
buffered elements which can be consumed with [`take!`](@ref).
# Examples
Buffered channel with task:
```jldoctest
julia> c = Channel(ch -> put!(ch, 1), 1);
julia> isopen(c) # The channel is closed to new `put!`s
false
julia> isready(c) # The channel is closed but still contains elements
true
julia> take!(c)
1
julia> isready(c)
false
```
Unbuffered channel:
```jldoctest
julia> c = Channel{Int}();
julia> isopen(c)
true
julia> close(c)
julia> isopen(c)
false
```
"""
function isopen(c::Channel)
# Use acquire here to pair with release store in `close`, so that subsequent `isready` calls
# are forced to see `isready == true` if they see `isopen == false`. This means users must
# call `isopen` before `isready` if you are using the race-y APIs (or call `iterate`, which
# does this right for you).
return ((@atomic :acquire c.state) === :open)
end

"""
empty!(c::Channel)
Expand Down
Loading

0 comments on commit 4d62745

Please sign in to comment.