Skip to content

Commit

Permalink
Merge branch 'julia-upstream-add-mmtk'
Browse files Browse the repository at this point in the history
  • Loading branch information
udesou committed Aug 19, 2024
2 parents d98aa33 + 306cee7 commit 14945f8
Show file tree
Hide file tree
Showing 391 changed files with 8,499 additions and 6,462 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/enforce-label-action@2.2.2
- 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/cffconvert-github-action@2.0.0
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 @@ -95,6 +95,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 @@ -495,7 +498,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 @@ -504,7 +507,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 @@ -516,6 +519,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 @@ -532,7 +540,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 @@ -542,7 +551,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 @@ -849,6 +859,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 @@ -981,6 +996,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 @@ -1319,7 +1343,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 @@ -1425,9 +1449,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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ endif
# Install appdata file
mkdir -p $(DESTDIR)$(datarootdir)/metainfo/
$(INSTALL_F) $(JULIAHOME)/contrib/julia.appdata.xml $(DESTDIR)$(datarootdir)/metainfo/
# Install terminal info database
ifneq ($(WITH_TERMINFO),0)
cp -R -L $(build_datarootdir)/terminfo $(DESTDIR)$(datarootdir)
endif

# Update RPATH entries and JL_SYSTEM_IMAGE_PATH if $(private_libdir_rel) != $(build_private_libdir_rel)
ifneq ($(private_libdir_rel),$(build_private_libdir_rel))
Expand Down
18 changes: 18 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ 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
---------------------

* `logrange(start, stop; length)` makes a range of constant ratio, instead of constant step ([#39071])
* The new `isfull(c::Channel)` function can be used to check if `put!(c, some_value)` will block. ([#53159])
* `waitany(tasks; throw=false)` and `waitall(tasks; failfast=false, throw=false)` which wait multiple tasks at once ([#53341]).
* `uuid7()` creates an RFC 9652 compliant UUID with version 7 ([#54834]).
* `insertdims(array; dims)` allows to insert singleton dimensions into an array which is the inverse operation to `dropdims`
* The new `Fix` type is a generalization of `Fix1/Fix2` for fixing a single argument ([#54653]).

New library features
--------------------
Expand All @@ -90,20 +94,30 @@ 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])
* New `ltruncate`, `rtruncate` and `ctruncate` functions for truncating strings to text width, accounting for char widths ([#55351])

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 Down Expand Up @@ -157,6 +171,10 @@ Deprecated or removed
External dependencies
---------------------

- The terminal info database, `terminfo`, is now vendored by default, providing a better
REPL user experience when `terminfo` is not available on the system. Julia can be built
without vendoring the database using the Makefile option `WITH_TERMINFO=0`. ([#55411])

Tooling Improvements
--------------------

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
42 changes: 24 additions & 18 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 @@ -421,7 +424,6 @@ include("weakkeydict.jl")

# ScopedValues
include("scopedvalues.jl")
using .ScopedValues

# metaprogramming
include("meta.jl")
Expand Down Expand Up @@ -614,6 +616,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
t === current_task() || _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 +657,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 14945f8

Please sign in to comment.