@@ -1368,34 +1368,42 @@ end
1368
1368
# realpath is needed because Pkg is used for one of the precompile paths below, and Pkg calls realpath on the
1369
1369
# project path so the cache file slug will be different if the tempdir is given as a symlink
1370
1370
# (which it often is on MacOS) which would break the test.
1371
- project_path = joinpath (realpath (depot), " project" )
1372
- mkpath (project_path)
1373
1371
1374
1372
# Create fake `Foo.jl` package with two files:
1375
1373
foo_path = joinpath (depot, " dev" , " Foo51989" )
1376
1374
mkpath (joinpath (foo_path, " src" ))
1377
- open (joinpath (foo_path, " src" , " Foo51989.jl" ); write = true ) do io
1378
- println (io, """
1375
+ write (joinpath (foo_path, " src" , " Foo51989.jl" ),
1376
+ """
1379
1377
module Foo51989
1380
1378
include("internal.jl")
1381
1379
end
1382
1380
""" )
1383
- end
1384
- open (joinpath (foo_path, " src" , " internal.jl" ); write= true ) do io
1385
- println (io, " const a = \" asd\" " )
1386
- end
1387
- open (joinpath (foo_path, " Project.toml" ); write= true ) do io
1388
- println (io, """
1381
+ write (joinpath (foo_path, " src" , " internal.jl" ),
1382
+ " const a = \" asd\" " )
1383
+ write (joinpath (foo_path, " Project.toml" ),
1384
+ """
1389
1385
name = "Foo51989"
1390
1386
uuid = "00000000-0000-0000-0000-000000000001"
1391
1387
version = "1.0.0"
1392
1388
""" )
1393
- end
1389
+ write (joinpath (foo_path, " Manifest.toml" ),
1390
+ """
1391
+ # This file is machine-generated - editing it directly is not advised
1392
+ julia_version = "1.13.0-DEV"
1393
+ manifest_format = "2.0"
1394
+ project_hash = "8699765aeeac181c3e5ddbaeb9371968e1f84d6b"
1394
1395
1395
- # In our depot, `dev` and then `precompile` this `Foo` package.
1396
- @test success (addenv (
1397
- ` $(Base. julia_cmd ()) --project=$project_path --startup-file=no -e 'import Pkg; Pkg.develop("Foo51989"); Pkg.precompile(); exit(0)'` ,
1398
- " JULIA_DEPOT_PATH" => depot))
1396
+ [[deps.Foo51989]]
1397
+ path = "."
1398
+ uuid = "00000000-0000-0000-0000-000000000001"
1399
+ version = "1.0.0"
1400
+ """ )
1401
+
1402
+ # In our depot, `precompile` this `Foo` package.
1403
+ @test success (pipeline (addenv (
1404
+ ` $(Base. julia_cmd ()) --project=$foo_path --startup-file=no -e 'Base.Precompilation.precompilepkgs(["Foo51989"]); exit(0)'` ,
1405
+ " JULIA_DEPOT_PATH" => depot,
1406
+ ); stdout , stderr ))
1399
1407
1400
1408
# Get the size of the generated `.ji` file so that we can ensure that it gets altered
1401
1409
foo_compiled_path = joinpath (depot, " compiled" , " v$(VERSION . major) .$(VERSION . minor) " , " Foo51989" )
@@ -1413,10 +1421,10 @@ end
1413
1421
end
1414
1422
1415
1423
# Try to load `Foo`; this should trigger recompilation, not an error!
1416
- @test success (addenv (
1417
- ` $(Base. julia_cmd ()) --project=$project_path --startup-file=no -e 'using Foo51989; exit(0)'` ,
1424
+ @test success (pipeline ( addenv (
1425
+ ` $(Base. julia_cmd ()) --project=$foo_path --startup-file=no -e 'using Foo51989; exit(0)'` ,
1418
1426
" JULIA_DEPOT_PATH" => depot,
1419
- ))
1427
+ ); stdout , stderr ) )
1420
1428
1421
1429
# Ensure that there is still only one `.ji` file (it got replaced
1422
1430
# and the file size changed).
0 commit comments