Skip to content

Commit

Permalink
Merge branch 'master' into fixN
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer authored Aug 1, 2024
2 parents 6cac583 + 0ef8a91 commit 0271f75
Show file tree
Hide file tree
Showing 282 changed files with 6,909 additions and 3,762 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 100
labels:
- "dependencies"
- "github-actions"
- "domain:ci"
2 changes: 1 addition & 1 deletion .github/workflows/LabelCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: yogevbd/[email protected]
- uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2
with:
# REQUIRED_LABELS_ANY: "bug,enhancement,skip-changelog"
# REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','enhancement','skip-changelog']"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout the JuliaLang/julia repository
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Check spelling with typos
#uses: crate-ci/typos@master
#uses: crate-ci/typos@c7af4712eda24dd1ef54bd8212973888489eb0ce # v1.23.5
env:
GH_TOKEN: "${{ github.token }}"
run: |
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/Whitespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Whitespace

permissions: {}

on:
push:
branches:
- master
pull_request:

jobs:
whitespace:
name: Check whitespace
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout the JuliaLang/julia repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Check whitespace
run: |
contrib/check-whitespace.jl
4 changes: 2 additions & 2 deletions .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/[email protected]
uses: citation-file-format/cffconvert-github-action@4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 # 2.0.0
with:
args: "--validate"
11 changes: 4 additions & 7 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ Multi-threading changes
-----------------------

* `Threads.@threads` now supports the `:greedy` scheduler, intended for non-uniform workloads ([#52096]).
* A new exported struct `Lockable{T, L<:AbstractLock}` makes it easy to bundle a resource and its lock together ([#52898]).
* A new public (but unexported) struct `Base.Lockable{T, L<:AbstractLock}` makes it easy to bundle a resource and its lock together ([#52898]).

Build system changes
--------------------

* There is a new `Makefile` to build Julia and LLVM using the profile-guided and link-time optimizations (PGO and LTO) strategies, see `contrib/pgo-lto/Makefile` ([#45641]).

New library functions
---------------------

Expand Down Expand Up @@ -128,12 +130,6 @@ Standard library changes
* The new `@styled_str` string macro provides a convenient way of creating a
`AnnotatedString` with various faces or other attributes applied ([#49586]).

#### JuliaSyntaxHighlighting

* A new standard library for applying syntax highlighting to Julia code, this
uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function
that creates an `AnnotatedString` with syntax highlighting applied.

#### Package Manager

#### LinearAlgebra
Expand Down Expand Up @@ -420,6 +416,7 @@ Deprecated or removed
[#44247]: https://github.com/JuliaLang/julia/issues/44247
[#45164]: https://github.com/JuliaLang/julia/issues/45164
[#45396]: https://github.com/JuliaLang/julia/issues/45396
[#45641]: https://github.com/JuliaLang/julia/issues/45641
[#45962]: https://github.com/JuliaLang/julia/issues/45962
[#46196]: https://github.com/JuliaLang/julia/issues/46196
[#46372]: https://github.com/JuliaLang/julia/issues/46372
Expand Down
43 changes: 37 additions & 6 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ WITH_DTRACE := 0
# Enable ITTAPI integration
WITH_ITTAPI := 0

# Enable NVTX integration
WITH_NVTX := 0

# Enable Tracy support
WITH_TRACY := 0
WITH_TRACY_CALLSTACKS := 0
Expand Down Expand Up @@ -492,7 +495,7 @@ MACOSX_VERSION_MIN := 11.0
endif
endif

JCFLAGS_COMMON := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCFLAGS_COMMON := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -Wformat -Wformat-security
JCFLAGS_CLANG := $(JCFLAGS_COMMON)
JCFLAGS_GCC := $(JCFLAGS_COMMON) -fno-gnu-unique

Expand All @@ -501,7 +504,7 @@ JCPPFLAGS_COMMON := -fasynchronous-unwind-tables
JCPPFLAGS_CLANG := $(JCPPFLAGS_COMMON) -mllvm -enable-tail-merge=0
JCPPFLAGS_GCC := $(JCPPFLAGS_COMMON) -fno-tree-tail-merge

JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17 -Wformat -Wformat-security
JCXXFLAGS_CLANG := $(JCXXFLAGS_COMMON) -pedantic
JCXXFLAGS_GCC := $(JCXXFLAGS_COMMON) -fno-gnu-unique

Expand All @@ -513,6 +516,11 @@ SHIPFLAGS_COMMON := -O3
SHIPFLAGS_CLANG := $(SHIPFLAGS_COMMON) -g
SHIPFLAGS_GCC := $(SHIPFLAGS_COMMON) -ggdb2 -falign-functions

BOLT_LDFLAGS :=

BOLT_CFLAGS_GCC :=
BOLT_CFLAGS_CLANG :=

ifeq ($(OS), Darwin)
JCPPFLAGS_CLANG += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1
endif
Expand All @@ -529,7 +537,8 @@ JCFLAGS := $(JCFLAGS_GCC)
JCPPFLAGS := $(JCPPFLAGS_GCC)
JCXXFLAGS := $(JCXXFLAGS_GCC)
DEBUGFLAGS := $(DEBUGFLAGS_GCC)
SHIPFLAGS := $(SHIPFLAGS_GCC)
SHIPFLAGS := $(SHIPFLAGS_GCC) $(BOLT_CFLAGS_GCC)
BOLT_CFLAGS := $(BOLT_CFLAGS_GCC)
endif

ifeq ($(USECLANG),1)
Expand All @@ -539,7 +548,8 @@ JCFLAGS := $(JCFLAGS_CLANG)
JCPPFLAGS := $(JCPPFLAGS_CLANG)
JCXXFLAGS := $(JCXXFLAGS_CLANG)
DEBUGFLAGS := $(DEBUGFLAGS_CLANG)
SHIPFLAGS := $(SHIPFLAGS_CLANG)
SHIPFLAGS := $(SHIPFLAGS_CLANG) $(BOLT_CFLAGS_CLANG)
BOLT_CFLAGS := $(BOLT_CFLAGS_CLANG)

ifeq ($(OS), Darwin)
CC += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
Expand Down Expand Up @@ -808,6 +818,11 @@ JCXXFLAGS += -DUSE_TIMING_COUNTS
JCFLAGS += -DUSE_TIMING_COUNTS
endif

ifeq ($(WITH_NVTX), 1)
JCXXFLAGS += -DUSE_NVTX
JCFLAGS += -DUSE_NVTX
endif

# ===========================================================================

# Select the cpu architecture to target, or automatically detects the user's compiler
Expand Down Expand Up @@ -940,6 +955,15 @@ BINARY:=64
MARCH=
endif

# Allow Clang to use CRC instructions (only applicable on AArch64)
ifneq (,$(findstring aarch64,$(ARCH)))
ifeq ($(USECLANG),1)
ifeq (,$(MARCH))
JCFLAGS += -mcrc
endif
endif
endif

# If we are running on powerpc64 or ppc64, fail out dramatically
ifneq (,$(filter $(ARCH), powerpc64 ppc64))
$(error Big-endian PPC64 is not supported, to ignore this error, set ARCH=ppc64le)
Expand Down Expand Up @@ -1278,7 +1302,7 @@ CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.33|GLIBCXX_3\.5\.|GLIBCXX_4\.
# Note: we explicitly _do not_ define `CSL` here, since it requires some more
# advanced techniques to decide whether it should be installed from a BB source
# or not. See `deps/csl.mk` for more detail.
BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM LIBSUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP LLD LIBTRACYCLIENT
BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM LIBSUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP LLD LIBTRACYCLIENT BOLT
define SET_BB_DEFAULT
# First, check to see if BB is disabled on a global setting
ifeq ($$(USE_BINARYBUILDER),0)
Expand Down Expand Up @@ -1384,9 +1408,16 @@ OSLIBS += -lelf -lkvm -lrt -lpthread -latomic
# make it loaded first to
# prevent from linking to outdated system libs.
# See #21788
# TODO: Determine whether the condition here on AArch64 (added in #55089) should actually
# be `ifneq ($(USE_BINARYBUILDER),0)`. We vendor a correctly versioned libgcc_s when using
# BinaryBuilder which we want to link in early as noted above, but it could be the case
# that without BinaryBuilder, regardless of architecture, we need to delay linking libgcc_s
# to avoid getting the system one.
ifeq (,$(findstring aarch64,$(ARCH)))
OSLIBS += -lgcc_s
endif

OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
OSLIBS += -Wl,--export-dynamic -Wl,--undefined-version -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
$(NO_WHOLE_ARCHIVE)
endif

Expand Down
23 changes: 23 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ New language features

- A new keyword argument `usings::Bool` has been added to `names`. By using this, we can now
find all the names available in module `A` by `names(A; all=true, imported=true, usings=true)`. ([#54609])
- the `@atomic(...)` macro family supports now the reference assignment syntax, e.g.
`@atomic :monotonic v[3] += 4` modifies `v[3]` atomically with monotonic ordering semantics. ([#54707])
The supported syntax allows
- atomic fetch (`x = @atomic v[3]`),
- atomic set (`@atomic v[3] = 4`),
- atomic modify (`@atomic v[3] += 2`),
- atomic set once (`@atomiconce v[3] = 2`),
- atomic swap (`x = @atomicswap v[3] = 2`), and
- atomic replace (`x = @atomicreplace v[3] 2=>5`).

Language changes
----------------
Expand Down Expand Up @@ -54,6 +63,8 @@ Multi-threading changes
Build system changes
--------------------

* There are new `Makefile`s to build Julia and LLVM using the Binary Optimization and Layout Tool (BOLT), see `contrib/bolt` and `contrib/pgo-lto-bolt` ([#54107]).

New library functions
---------------------

Expand Down Expand Up @@ -82,20 +93,29 @@ New library features
data-races. Or use the callback form of `open` to have all that handled
automatically.
* `@timed` now additionally returns the elapsed compilation and recompilation time ([#52889])
* `escape_string` takes additional keyword arguments `ascii=true` (to escape all
non-ASCII characters) and `fullhex=true` (to require full 4/8-digit hex numbers
for u/U escapes, e.g. for C compatibility) [#55099]).
* `filter` can now act on a `NamedTuple` ([#50795]).
* `tempname` can now take a suffix string to allow the file name to include a suffix and include that suffix in
the uniquing checking ([#53474])
* `RegexMatch` objects can now be used to construct `NamedTuple`s and `Dict`s ([#50988])
* `Lockable` is now exported ([#54595])

Standard library changes
------------------------

* `gcdx(0, 0)` now returns `(0, 0, 0)` instead of `(0, 1, 0)` ([#40989]).
* `fd` returns a `RawFD` instead of an `Int` ([#55080]).

#### StyledStrings

#### JuliaSyntaxHighlighting

* A new standard library for applying syntax highlighting to Julia code, this
uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function
that creates an `AnnotatedString` with syntax highlighting applied.

#### Package Manager

#### LinearAlgebra
Expand All @@ -121,6 +141,9 @@ Standard library changes
complete names that have been explicitly `using`-ed. ([#54610])
- REPL completions can now complete input lines like `[import|using] Mod: xxx|` e.g.
complete `using Base.Experimental: @op` to `using Base.Experimental: @opaque`. ([#54719])
- the REPL will now warn if it detects a name is being accessed from a module which does not define it (nor has a submodule which defines it),
and for which the name is not public in that module. For example, `map` is defined in Base, and executing `LinearAlgebra.map`
in the REPL will now issue a warning the first time occurs. ([#54872])

#### SuiteSparse

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ New developers may find the notes in
[CONTRIBUTING](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md)
helpful to start contributing to the Julia codebase.

### External Resources
### Learning Julia

- [**StackOverflow**](https://stackoverflow.com/questions/tagged/julia-lang)
- [**Twitter**](https://twitter.com/JuliaLanguage)
- [**Learning resources**](https://julialang.org/learning/)

## Binary Installation
Expand Down Expand Up @@ -94,7 +92,7 @@ and then use the command prompt to change into the resulting julia directory. By
Julia. However, most users should use the [most recent stable version](https://github.com/JuliaLang/julia/releases)
of Julia. You can get this version by running:

git checkout v1.10.3
git checkout v1.10.4

To build the `julia` executable, run `make` from within the julia directory.

Expand Down
41 changes: 24 additions & 17 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function setproperty!(x, f::Symbol, v)
return setfield!(x, f, val)
end

typeof(function getproperty end).name.constprop_heuristic = Core.FORCE_CONST_PROP
typeof(function setproperty! end).name.constprop_heuristic = Core.FORCE_CONST_PROP

dotgetproperty(x, f) = getproperty(x, f)

getproperty(x::Module, f::Symbol, order::Symbol) = (@inline; getglobal(x, f, order))
Expand Down Expand Up @@ -224,7 +227,7 @@ delete_method(which(Pair{Any,Any}, (Any, Any)))
end

# The REPL stdlib hooks into Base using this Ref
const REPL_MODULE_REF = Ref{Module}()
const REPL_MODULE_REF = Ref{Module}(Base)

include("checked.jl")
using .Checked
Expand Down Expand Up @@ -614,6 +617,25 @@ function profile_printing_listener(cond::Base.AsyncCondition)
nothing
end

function start_profile_listener()
cond = Base.AsyncCondition()
Base.uv_unref(cond.handle)
t = errormonitor(Threads.@spawn(profile_printing_listener(cond)))
atexit() do
# destroy this callback when exiting
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), C_NULL)
# this will prompt any ongoing or pending event to flush also
close(cond)
# error-propagation is not needed, since the errormonitor will handle printing that better
_wait(t)
end
finalizer(cond) do c
# if something goes south, still make sure we aren't keeping a reference in C to this
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), C_NULL)
end
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), cond.handle)
end

function __init__()
# Base library init
global _atexit_hooks_finished = false
Expand All @@ -636,22 +658,7 @@ function __init__()
# Profiling helper
@static if !Sys.iswindows()
# triggering a profile via signals is not implemented on windows
cond = Base.AsyncCondition()
Base.uv_unref(cond.handle)
t = errormonitor(Threads.@spawn(profile_printing_listener(cond)))
atexit() do
# destroy this callback when exiting
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), C_NULL)
# this will prompt any ongoing or pending event to flush also
close(cond)
# error-propagation is not needed, since the errormonitor will handle printing that better
_wait(t)
end
finalizer(cond) do c
# if something goes south, still make sure we aren't keeping a reference in C to this
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), C_NULL)
end
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), cond.handle)
start_profile_listener()
end
_require_world_age[] = get_world_counter()
# Prevent spawned Julia process from getting stuck waiting on Tracy to connect.
Expand Down
Loading

0 comments on commit 0271f75

Please sign in to comment.