Skip to content

Conversation

@staticfloat
Copy link
Member

On most platforms, setting LD_LIBRARY_PATH and friends was not
necessary for invoking 7z because we fell back to the natural library
search paths for things like libstdc++, but in truly minimal
environments (like Alpine linux) this does not work; so let's set these
paths properly. We do this work manually in v1.6, in v1.7 we hope to
have a JLLWrappers-based solution.

On most platforms, setting `LD_LIBRARY_PATH` and friends was not
necessary for invoking `7z` because we fell back to the natural library
search paths for things like `libstdc++`, but in truly minimal
environments (like Alpine linux) this does not work; so let's set these
paths properly.  We do this work manually in v1.6, in v1.7 we hope to
have a JLLWrappers-based solution.
@stevengj
Copy link
Member

stevengj commented Jan 9, 2021

IIRC there is a way to set the environment for spawning a Cmd without modifying the global ENV.

@staticfloat
Copy link
Member Author

There is, I added it. :)

this provides both ways of doing it, for backwards compatibility.

return env
end

function p7zip(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
Copy link
Member

Choose a reason for hiding this comment

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

Should this method just be deprecated?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe we can pass an appropriate Cmd object, rather than the string?

Copy link
Member

Choose a reason for hiding this comment

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

I guess that doesn't buy us anything over the other method.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could deprecate it, but we're in a bit of an ecosystem issue in that if a package, which uses JLLs, wants to support 1.3-1.6, they will then get deprecation warnings on 1.6 for using the older, compatible interface. I think I would rather let things be for a bit, and then start introducing deprecation warnings once we have the data showing that we have a majority of users on 1.6+, and that package devs can actually switch over without annoying too many users.

const LIBPATH_env = "LD_LIBRARY_PATH"
const LIBPATH_default = ""
const pathsep = ':'
end
Copy link
Member

Choose a reason for hiding this comment

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

Should this definition be in Base somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, probably. In v1.7 this is all going to be generated by a stdlib-vendored copy of JLLWrappers, this is all just copied from there for the interim.

@staticfloat staticfloat merged commit 0f8eaa6 into master Jan 11, 2021
@staticfloat staticfloat deleted the sf/fix_p7zip_env branch January 11, 2021 22:32
@giordano
Copy link
Member

I guess this should be backported for v1.6?

@staticfloat staticfloat added the backport 1.6 Change should be backported to release-1.6 label Jan 11, 2021
@KristofferC KristofferC mentioned this pull request Jan 19, 2021
60 tasks
KristofferC pushed a commit that referenced this pull request Jan 19, 2021
(cherry picked from commit 0f8eaa6)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Feb 1, 2021
KristofferC pushed a commit that referenced this pull request Feb 1, 2021
(cherry picked from commit 0f8eaa6)
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
staticfloat added a commit that referenced this pull request Dec 23, 2022
(cherry picked from commit 0f8eaa6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants