Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Use addenv to ensure git commands don't leak env variables #45

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

giordano
Copy link
Member

No description provided.

@DilumAluthge
Copy link
Member

Want to add a depwarn for the function or functions that should be deprecated?

Then, in the not-so-distant future, we can make a breaking release of GitCommand in which we have removed those functions.

@giordano
Copy link
Member Author

Want to add a depwarn for the function or functions that should be deprecated?

The fact is that the way you call the function is completely different, not sure how to write a reasonable deprecation warning

@DilumAluthge
Copy link
Member

Want to add a depwarn for the function or functions that should be deprecated?

The fact is that the way you call the function is completely different, not sure how to write a reasonable deprecation warning

Ah fair enough, yeah let's omit the depwarn then.

@DilumAluthge
Copy link
Member

Honestly the new interface looks much easier to use!

@giordano giordano marked this pull request as ready for review March 22, 2021 01:10
@giordano
Copy link
Member Author

Ok, well, tests are passing also on Windows. I guess it's good, but then I don't understand what's going on in JuliaEcosystem/PackageAnalyzer.jl#39. Marking this as ready for review

@codecov-io
Copy link

codecov-io commented Mar 22, 2021

Codecov Report

Merging #45 (410e246) into master (bf21cfd) will decrease coverage by 0.30%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
- Coverage   94.64%   94.33%   -0.31%     
==========================================
  Files           4        4              
  Lines          56       53       -3     
==========================================
- Hits           53       50       -3     
  Misses          3        3              
Impacted Files Coverage Δ
src/git.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf21cfd...410e246. Read the comment docs.

@DilumAluthge
Copy link
Member

What's the Windows issue you're having? IIRC on Windows we just distribute the official Git for Windows binaries. So on Windows I don't think we do any modification of the environment, or the library search path, or anything like that.

@DilumAluthge
Copy link
Member

LGTM.

I can't believe that before this PR I was doing things like copy(ENV) 😱

@giordano
Copy link
Member Author

What's the Windows issue you're having?

The environment variables seem to be leaked: https://github.com/giordano/AnalyzeRegistry.jl/pull/39/checks?check_run_id=2161991335#step:6:134. But tests here don't confirm it

@giordano giordano merged commit 64d6cff into JuliaVersionControl:master Mar 22, 2021
@giordano giordano deleted the mg/addenv branch March 22, 2021 01:18
@DilumAluthge
Copy link
Member

Maybe something is going wrong inside Git_jll? IIRC on Windows we get the environment variables mappings straight from Git_jll:

git_path, env_mapping = Git_jll.git(; adjust_PATH = adjust_PATH,

@DilumAluthge
Copy link
Member

But also, on Windows, we read some stuff from the existing ENV... perhaps that is not thread-safe?

@giordano
Copy link
Member Author

giordano commented Mar 22, 2021

But also, on Windows, we read some stuff from the existing ENV... perhaps that is not thread-safe?

Reading isn't 100% thread-safe if something else is changing the global variables, but the important thing is that we don't change the global state, which is what I'm ensuring with the added tests. And we read ENV also in the other operating systems

originallibpath = get(ENV, JLLWrappers.LIBPATH_env, "")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants