Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove wrapper script #11

Merged
merged 12 commits into from
Sep 13, 2017
7 changes: 4 additions & 3 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \
TAGGED_RELEASE_BANNER="conda-forge-julia release" \
install

mv "$PREFIX/bin/julia" "$PREFIX/bin/julia_"
cp "$RECIPE_DIR/julia-wrapper.sh" "$PREFIX/bin/julia"
chmod +x "$PREFIX/bin/julia"
# Configure juliarc to use conda environment
cp -f "${RECIPE_DIR}/juliarc.jl" "${PREFIX}/etc/julia/juliarc.jl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should append, not replace

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like an empty file with a comment about how we can add stuff to it. Why not just replace it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it isn't empty on all platforms

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. So what sort of stuff ends up there then?


# Populate initial package directory
julia -e "Pkg.init(); Pkg.__init__()"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to drop Pkg initialization step after all. Appears conda-build strips out .git directories, which will break the METADATA repo. There are some hacks we could use to workaround this, but I'm not sure they are worth it.

xref: conda/conda-build#2360

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added PR ( dfornika#2 ) to drop this. Should fix the build issue.

24 changes: 0 additions & 24 deletions recipe/julia-wrapper.sh

This file was deleted.

8 changes: 8 additions & 0 deletions recipe/juliarc.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", ".."))

if !("JULIA_PKGDIR" in keys(ENV))
ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site")
Pkg.init()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably shouldn't be done on every startup, only if it hasn't been initialized yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the preferred way to check if the package repository has been initialized?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was thinking about that. It seems to only take a toll the first time (as it is initializing everything from scratch). What sort of penalties would we be taking on for subsequent calls?

Initially we tried to run this once during the build, but there was a conda-build issue that blocked it. ( conda/conda-build#2360 ) In the end, not sure we should be running this at build time anyways as it would go stale and make the package larger.

Could add a post-link step to handle this instead. That would run this step once only when julia gets installed. Seems like the best of both worlds really.

OTOH we could just never initialize Pkg at all. Would make it slow for the user the first time they run something with Pkg, but that would be the case anyways, right?

FWIW borrowed this strategy from SO answer. Related to this, is it necessary to call Pkg.__init__() or is that already handled by Pkg.init()?

Pkg.__init__()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead and drop this and the line above it (i.e. Pkg.init()).

pop!(Base.LOAD_CACHE_PATH)
Copy link
Member

@jakirkham jakirkham Sep 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change this line to Base.LOAD_CACHE_PATH[1] = joinpath(ENV["JULIA_PKGDIR"], "lib", string("v", join(split(string(VERSION), ".")[1:2], "."))) now that we have removed the Pkg.init() stuff.

end
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source:

build:
skip: True # [osx or win]
number: 0
number: 1
features:
- blas_{{ variant }}

Expand Down