Skip to content

Commit

Permalink
🔥 Bump Mojo version to nightly-2024.6.2614-78-0
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmondal committed Jun 27, 2024
1 parent 7870459 commit 487ac31
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions mojo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ in

stdenv.mkDerivation rec {
pname = "mojo";
version = "2024.5.1905";
version = "2024.6.2614";
fullVersion = "${version}-78-0";

src = fetchurl {
url = "https://packages.modular.com/nightly/mojo/packages/${version}/mojo-x86_64-unknown-linux-gnu-${version}-37-0.tar.zst";
sha256 = "sha256-k4oIv9p4DQ7E7o8Jsb7ISJ+Rbqcj32q1LQIMxSSMiBo=";
url = "https://packages.modular.com/nightly/mojo/packages/${version}/mojo-x86_64-unknown-linux-gnu-${fullVersion}.tar.zst";
sha256 = "sha256-vviicX3lfdLKtjVbOkEZIG+o9usbfMCJhnzmALSNtfI=";

# Stable crashes in remote execution.
# url = "https://packages.modular.com/mojo/packages/${version}/mojo-x86_64-unknown-linux-gnu-${version}-13-0.tar.zst";
Expand Down Expand Up @@ -81,7 +82,7 @@ stdenv.mkDerivation rec {
# WARNING: At the moment linking phase can't figure out how to link tinfo.
# To work around this we allow leaving the tinfo symbols undefined and
# unlinked. This is a risky practice and might trigger segfaults at runtime.
sed -i "s|system_libs = -lrt,-ldl,-lpthread,-lm,-lz,-ltinfo;|system_libs = -fuse-ld=mold,-lrt,-ldl,-lpthread,-lm,-Xlinker,-rpath=${glibc}/lib,-L,${zlib}/lib,-Xlinker,-rpath=${zlib}/lib,-Xlinker,-L,${tinfo}/lib,-Xlinker,-rpath=${tinfo}/lib,-Xlinker,-rpath=${stdenv.cc.cc.lib}/lib,-Xlinker,--unresolved-symbols=ignore-in-object-files,--verbose;|g" modular.cfg
sed -i "s|system_libs = -lrt,-ldl,-lpthread,-lm,-lz;|system_libs = -fuse-ld=mold,-lrt,-ldl,-lpthread,-lm,-Xlinker,-rpath=${glibc}/lib,-L,${zlib}/lib,-Xlinker,-rpath=${zlib}/lib,-Xlinker,-rpath=${stdenv.cc.cc.lib}/lib,-Xlinker,--unresolved-symbols=ignore-in-object-files,--verbose;|g" modular.cfg
'';

installPhase = ''
Expand Down
18 changes: 3 additions & 15 deletions mojo/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,13 @@ def _rules_mojo_dependencies_impl(_):
http_archive(
name = "mojo",
build_file = "@rules_mojo//thirdparty:mojo.BUILD.bazel",
integrity = "sha256-M4hGfPmiY3PX9otPZk38JCwWEQgL3z/YOZJ04CDAmkk=",
integrity = "sha256-PqgP+ELm4FL5989EJI8vjJvSRpPhtOpv5TH86k4BZR8=",
urls = [
# "https://github.com/modularml/mojo/archive/bf73717d79fbb79b4b2bf586b3a40072308b6184.zip"

# Nightly. Stable is broken.
"https://github.com/modularml/mojo/archive/7e8cd37ff8fe2ddbe69a3cca787e59abf6357d76.zip",
"https://github.com/modularml/mojo/archive/454974d477a44b93365181c77f20d9e1fe1aceaa.zip",
],
strip_prefix = "mojo-7e8cd37ff8fe2ddbe69a3cca787e59abf6357d76",
strip_prefix = "mojo-454974d477a44b93365181c77f20d9e1fe1aceaa",
)

# http_archive(
# name = "local-remote-execution",
# urls = [
# "https://github.com/TraceMachina/nativelink/archive/refs/tags/v0.4.0.zip",
# ],
# integrity = "sha256-yhsJQZITkWjMcaFyniWL2R4YGxYuwduHdcer6eTXbJY=",
# strip_prefix = "nativelink-0.4.0/local-remote-execution",
# )

rules_mojo_dependencies = module_extension(
implementation = _rules_mojo_dependencies_impl,
)
30 changes: 19 additions & 11 deletions thirdparty/mojo.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ mojo_library(

# Handled separately due to nonstandard compile parameters.
"stdlib/test/builtin/test_file.mojo",
"stdlib/test/builtin/test_sort.mojo",
"stdlib/test/os/test_getenv_setenv.mojo",
"stdlib/test/sys/test_aarch64_target.mojo",
"stdlib/test/sys/test_macos_target.mojo",
Expand Down Expand Up @@ -61,6 +62,7 @@ mojo_library(
"stdlib/test/os/test_trap.mojo",
"stdlib/test/os/test_trap_stringable.mojo",
"stdlib/test/sys/test_exit_1.mojo",
"stdlib/test/sys/test_dlhandle.mojo",

# rules_mojo doesn't support Python interop yet.
"stdlib/test/python/test_ownership.mojo",
Expand All @@ -74,17 +76,23 @@ mojo_library(
)
]

mojo_test(
name = "test_builtin_test_file",
srcs = ["stdlib/test/builtin/test_file.mojo"],
deps = [":stdlib"],
defines = [
# TODO(aaronmondal): Hack. Handle runfiles properly.
"CURRENT_DIR=../_main~rules_mojo_dependencies~mojo/stdlib/test/builtin",
"TEMP_FILE_DIR=testdir",
],
runtime_data = ["stdlib/test/builtin/test_file_dummy_input.txt"],
)
# These make use of _dir_of_current_file and expect to have the runtime data
# available at the same location as the test executable, making them
# incompatible with a naive Bazel `runfile` approach. To work around this we run
# them locally.
[
mojo_test(
name = file.replace("/", "_").removeprefix("stdlib_").removesuffix(".mojo"),
srcs = [file],
deps = [":stdlib"],
tags = ["local"],
runtime_data = ["stdlib/test/builtin/test_file_dummy_input.txt"],
)
for file in [
"stdlib/test/builtin/test_sort.mojo",
"stdlib/test/builtin/test_file.mojo",
]
]

# TODO(aaronmondal): Add support for testtime environment variables.
# mojo_test(
Expand Down

0 comments on commit 487ac31

Please sign in to comment.