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

conda install withenv #41

Closed
wants to merge 2 commits into from
Closed

Conversation

wookay
Copy link
Contributor

@wookay wookay commented Aug 13, 2016

to fix the workaround on appveyor (CI for windows) of IJulia
https://github.com/JuliaLang/IJulia.jl/blob/master/appveyor.yml#L35

I have tested a bunch of times something like

using Conda
run(Conda._set_conda_env(`$Conda.conda install -y qt`))

the solution that I found is withenv, that works fine.
it needs to know the details of the changes from Julia 0.4 and Julia 0.5
the global variable ENV and the function setenv on windows.

@tkelman
Copy link
Contributor

tkelman commented Aug 13, 2016

I would think the copy should achieve the same thing, but hey if it works...


Any environment variable starting by CONDA will interact with the run.
"""
function _set_conda_env(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove this function and replace other uses of if with the same withenv construct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if so, it's need to refactor with the newer function like run_with_env.

run_with_env(`$conda install -y $pkg`)

run_with_env(`$conda remove -y $pkg`)

instead of

withenv(_get_conda_env()...) do
    run(`$conda install -y $pkg`)
end

run(_set_conda_env(`$conda remove -y $pkg`))

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, go for it! I just do not like to have two very similar functions with close names 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed something,
but it still needs the _set_conda_env function for
that is used to get the information from the commands.

 return collect(keys(JSON.parse(readstring(_set_conda_env(`$conda search $package --json`)))))

@Luthaf
Copy link
Contributor

Luthaf commented Aug 22, 2016

What is the issue with IJulia exactly? I am not sure I get the initial problem here.


# install qt
if is_windows()
Conda.add("qt")
Copy link
Contributor

Choose a reason for hiding this comment

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

this should probably clean up after itself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added removing qt. thanks.

@Luthaf Luthaf mentioned this pull request Aug 22, 2016
@wookay
Copy link
Contributor Author

wookay commented Aug 23, 2016

the issue is when installing qt with Conda on windows.
here's sample.

julia> versioninfo()
Julia Version 0.5.0-rc2+0
Commit 0350e57 (2016-08-12 11:25 UTC)
Platform Info:
  System: NT (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

julia> Conda.add("qt")
INFO: Downloading miniconda installer ...
INFO: Installing miniconda ...
Fetching package metadata: ....
Solving package specifications: .........

Package plan for installation in environment C:\Users\wookyoung\.julia\v0.5\Conda\deps\usr:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    jpeg-8d                    |            vc9_0         175 KB
    openssl-1.0.2h             |            vc9_0         4.4 MB
    python-2.7.12              |                0        23.5 MB
    zlib-1.2.8                 |            vc9_3         108 KB
    conda-env-2.5.1            |           py27_0          67 KB
    libpng-1.6.22              |            vc9_0         524 KB
    libtiff-4.0.6              |            vc9_2         466 KB
    ruamel_yaml-0.11.14        |           py27_0         212 KB
    conda-4.1.11               |           py27_0         245 KB
    qt-4.8.7                   |            vc9_9        50.3 MB
    ------------------------------------------------------------
                                           Total:        79.9 MB

The following NEW packages will be INSTALLED:

    jpeg:        8d-vc9_0       [vc9]
    libpng:      1.6.22-vc9_0   [vc9]
    libtiff:     4.0.6-vc9_2    [vc9]
    openssl:     1.0.2h-vc9_0   [vc9]
    qt:          4.8.7-vc9_9    [vc9]
    ruamel_yaml: 0.11.14-py27_0
    zlib:        1.2.8-vc9_3    [vc9]

The following packages will be UPDATED:

    conda:       4.0.5-py27_0 --> 4.1.11-py27_0
    conda-env:   2.4.5-py27_0 --> 2.5.1-py27_0
    python:      2.7.11-4     --> 2.7.12-0

Fetching packages ...
jpeg-8d-vc9_0. 100% |###############################| Time: 0:00:00 209.23 kB/s
openssl-1.0.2h 100% |###############################| Time: 0:00:03   1.31 MB/s
python-2.7.12- 100% |###############################| Time: 0:00:35 686.80 kB/s
zlib-1.2.8-vc9 100% |###############################| Time: 0:00:00 124.92 kB/s
conda-env-2.5. 100% |###############################| Time: 0:00:00 128.73 kB/s
libpng-1.6.22- 100% |###############################| Time: 0:00:02 237.39 kB/s
libtiff-4.0.6- 100% |###############################| Time: 0:00:01 368.69 kB/s
ruamel_yaml-0. 100% |###############################| Time: 0:00:03  56.60 kB/s
conda-4.1.11-p 100% |###############################| Time: 0:00:02 116.52 kB/s
qt-4.8.7-vc9_9 100% |###############################| Time: 0:00:27   1.92 MB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
Error: Error: post-link failed for: qt-4.8.7-vc9_9##################     |  90%
ERROR: failed process: Process(setenv(`'C:\Users\wookyoung\.julia\v0.5\Conda\deps\usr\Scripts\conda' install -y qt`,String["=C:=C:\\Users\\wookyoung","CONDARC=C:\\Users\\wookyoung\\.julia\\v0.5\\Conda\\deps\\usr\\condarc-julia"]), ProcessExited(1)) [1]
 in pipeline_error(::Base.Process) at .\process.jl:616
 in run(::Cmd) at .\process.jl:592
 in add(::String) at C:\Users\wookyoung\.julia\v0.5\Conda\src\Conda.jl:146

@wookay
Copy link
Contributor Author

wookay commented Aug 25, 2016

I've checked this on Julia 0.5.0-rc3,
it has fixed already by the back-ported PRs
JuliaLang/julia#18012
JuliaLang/julia#18144

so just close this PR soon, thanks

@tkelman
Copy link
Contributor

tkelman commented Aug 25, 2016

I thought that was just a printing problem?

@wookay
Copy link
Contributor Author

wookay commented Aug 25, 2016

I think that getting ENV correctly now on windows.

@tkelman
Copy link
Contributor

tkelman commented Aug 25, 2016

Oh, if the nightlies are from after the first was merged but before the second, then yes ENV will be wrong.

@wookay
Copy link
Contributor Author

wookay commented Aug 27, 2016

closing. thanks.

@wookay wookay closed this Aug 27, 2016
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.

3 participants