JuliaLang / JuliaLang/Distributed.jl

`@everywhere` running `using` and `imports` first means you can't do `using Pkg; Pkg.activate(".")` first before `using MyPkg` for local `MyPkg`

Open
#195 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
55
Forks
19
PR merge metrics
No merged PRs in 30d

Description

When using Distributed and loading packages on workers that include local packages in development , one might want to do something like:

@everywhere begin
using Pkg; Pkg.activate(".")
using OtherPkgs
using MyPkg

where MyPkg is a local package in the current directory. However, since@everywhere moves using MyPkg above Pkg.activate(".") (see below)
https://github.com/JuliaLang/julia/blob/a11de31665d46b63fe1ff043d056c3c5483afdc6/stdlib/Distributed/src/macros.jl#L204
this doesn't work and one is required to use two separate @everywhere blocks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in stdlib/Distributed/src/macros.jl around the linked line where @everywhere reorders using and import statements. Reproduce the shown single-block example with Pkg.activate(".") and local MyPkg, then inspect how the macro transforms the block. Done means the activation can take effect before loading MyPkg in that block without breaking the existing @everywhere behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.