-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
WIP: Add python-toolchain #642
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
253b12c
to
4a58f96
Compare
Running into this issue ( conda/conda-build#963 ). Can come up with a workaround if needed. |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Commented the failing tests for now. |
Added some recipes for testing. Here |
Windows has some issue. I expect this is because I don't know how to activate it correctly. Maybe there are other issues too. |
Excuse the extremely naive question, but does adopting |
Unfortunately not. See this comment by @minrk. Basically, to make sure things don't go sideways with
This really isn't magical. We are simply adding a 3 line global config file. This is something that
Unfortunately, adding these arguments (
Well, that's really a question of documentation. I don't see this as any more confusing than the In any event, I don't want us to get too hung up on this now as I would rather worry about the CI improvements that we are starting with `conda-forge-build-setup` first. That is a really big gain that we are going to need soon as we need to start using `conda-build` 1.20.3 and cleaning out some bottlenecks like the `curl` recipe. |
@@ -0,0 +1 @@ | |||
set PIP_CONFIG_FILE="%LIBRARY_PREFIX%\etc\pip.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually it's set "NAME=VALUE"
. No idea why, but using it that way prevented bugs in cmder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I have seen that syntax for unsetting a variable, but not setting it. Will change.
4aaaddb
to
9f74b05
Compare
@@ -0,0 +1 @@ | |||
set "PIP_CONFIG_FILE=" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't seen quotes on unset (there are no spaces in this, so it should not be needed), but it will probably also not hurt :-)
Can you double check that these activation scripts work correctly on Windows, @JanSchulz? I took my best guess, but I'm still not totally sure that these work right or that I'm activating them correctly. |
- test -f "${PREFIX}/etc/pip.conf" # [unix] | ||
#- test -f "${STDLIB_DIR}/distutils/distutils.cfg" # [unix] | ||
- if not exist "%LIBRARY_PREFIX%\\etc\\pip.conf" exit 1 # [win] | ||
#- if not exist "%STDLIB_DIR%\\distutils\\distutils.cfg" exit 1 # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the go recipe I now try
- cmd /c if x%GOROOT% NEQ x%CONDA_DEFAULT_ENV%\go exit 1 # [win]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it seems that we need a newer conda version for that to work: conda/conda@f531272
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was doing activation manually in cases like that, which is horrendous, but it got the job done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and another problem: conda build does not activate the environment but only changes the PATH: at least the gopath isn't set in during tests :-(
The following NEW packages will be INSTALLED:
go: 1.4.2-0
Fetching packages ...
go-1.4.2-0.tar 100% |###############################| Time: 0:00:00 130.22 MB/s
Extracting packages ...
[ COMPLETE ]|##################################################| 100%
Linking packages ...
[ COMPLETE ]|##################################################| 100%
C:\portabel\miniconda\conda-bld\test-tmp_dir>go version
go: cannot find GOROOT directory: C:\portabel\miniconda\envs\_build\go
C:\portabel\miniconda\conda-bld\test-tmp_dir>if errorlevel 1 exit 1
TESTS FAILED: go-1.4.2-0
I'm currently thinking about this workaround:
commands:
- activate _test # [win]
- go version
- go help
- go run hello.go
- cmd /c echo x%GOROOT% NEQ x%CONDA_DEFAULT_ENV%\go # [win]
- cmd /c if x%GOROOT% NEQ x%CONDA_DEFAULT_ENV%\go exit 1 # [win]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the workaround works :-) -> jakirkham#11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I confused the two issues. Also, using activate
to solve this problem on *NIXes. This is the conda-build
issue ( conda/conda-build#910 ) that pertains to fixing this problem.
7b8b25b
to
013ca3f
Compare
Seems that we are still suffering form activation issues on Windows. Suggestions? |
And something similar in That's a horrible workaround, but it seems to work :-) |
number: 0 | ||
script: | ||
- source activate _build # [unix] | ||
- activate _build # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I'm trying to activate
the _build
environment here, but that seems to not be setting PIP_CONFIG_FILE
. Is there something obviously wrong here? While using CONDA_DEFAULT_ENV
may be more robust, I would still expect for this to work on Windows. Am I still installing the scripts in the wrong location? Double-checked and thought this was ok, but I could still be wrong about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing obvious. What happens if you just do
activate _build
Interactively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. If I had a working Windows machine, I could tell you. 😉 Unfortunately, no such luck. 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I do have a sort of working Windows machine (think the compiler installs didn't go over well 😨). Fortunately, this doesn't require working compilers (I would hope 👼). FWICT it is not activating correctly there. 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget you can log into appveyor directly:
https://www.appveyor.com/docs/how-to/rdp-to-build-worker
On Mon, Jun 6, 2016 at 4:15 PM jakirkham [email protected] wrote:
In recipes/webcolors/meta.yaml
#642 (comment)
:+{% set version = "1.5" %}
+
+package:
- name: webcolors
- version: {{ version }}
+source:
- fn: webcolors-{{ version }}.tar.gz
- url: https://pypi.python.org/packages/source/w/webcolors/webcolors-{{ version }}.tar.gz
- md5: 2e9da1bbb7a087c6108e05be64640afb
+build:
- number: 0
- script:
- source activate _build # [unix]
- activate _build # [win]
Though I do have a sort of working Windows machine (think the compiler
installs didn't go over well 😨). Fortunately, this doesn't require
working compilers (I would hope 👼). FWICT it is not activating correctly
there. 😕—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/conda-forge/staged-recipes/pull/642/files/013ca3f8d866a57c79724e8ecb99a0c4b38c326d#r65970568,
or mute the thread
https://github.com/notifications/unsubscribe/AACV-bkgYdk7ebR2-bae5D8HTPEdBksLks5qJI3qgaJpZM4Ih7wZ
.
@msarahan, do you see anything wrong with the Windows activation here? I think the paths are all correct, but I could still be missing something. If you can see something that is obviously wrong, please let me know. As this would be something using PR ( conda/conda-build#1002 ), it would be good if we can make sure this is working correctly. Maybe we are running into common issues. |
013ca3f
to
1b3f39c
Compare
I think I remember fixing my activate script as the currently released version of conda/conda-env does not have the activate.d step as part of the -> workaround:
|
Yeah, I was about to say I think this is why I had |
1b3f39c
to
c2bbab5
Compare
Yeah, otherwise we see these really weird |
Nope, I'm wrong that makes no difference. Same problem. |
as far as I understand batch, the only think to make it work would be to hack the activate.bat script. |
Re the |
commands: | ||
- test -f "${PREFIX}/etc/pip.conf" # [unix] | ||
#- test -f "${STDLIB_DIR}/distutils/distutils.cfg" # [unix] | ||
- if not exist "%LIBRARY_PREFIX%\\etc\\pip.conf" exit 1 # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the appveyor log you don't need \\
, \
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little more worried about something parsing the yaml and misinterpreting something. As AppVeyor can handle this fine, I'm happy enough to leave this alone.
So, basically, we need a |
So, IMO currently (with the current
|
You're right. I guess the copying is buried in these lines. Maybe I should enable some sort of verbose flag so it is easier to read. |
|
1e29b93
to
fcfd155
Compare
I don't think I ever had |
Anyways |
It might be time to pick this up again as the needed changes for Windows are in |
fcfd155
to
817bf2a
Compare
Rebased on current |
817bf2a
to
6e185ea
Compare
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
6e185ea
to
7a496af
Compare
7a496af
to
ba33005
Compare
Partially resolves: #528
This is a "toolchain" for configuring our Python installs. This PR includes a few pieces that still need a bit more polishing.
As a note, this package is designed intentionally to not overlap with the
toolchain
package. The reason is thetoolchain
package implies compilation happens, which is an important piece of information to make clear and distinct. By keeping thetoolchain
package for compiling, it makes it easy for someone to know if compilation is done in a recipe. We do not want to mix this up with Python packages and lose this very important piece of information. This package provided here is only useful for Python builds and does not configure compilers. Though the two could be combined together when both are needed.The first piece added here are default
setuptools
arguments. One only needs to runpython setup.py install
and addpython-toolchain
as a build dependency to make this work. The only subtle point here is the configuration file we add seems to breakdistutils
. However, I don't actually see this as a problem. We simply don't use this toolchain withdistutils
. Also, we can find out pretty quickly whether a package usessetuptools
or not by doing this experiment. This saves us from hunting around in the code for this information. As we are going to disable the inclusion ofpip
,setuptools
, andwheel
aspython
dependencies on the VMs, it will be much easier to tell if something is building withdistutils
or not. Basically, people try not usingpython-toolchain
(i.e. usingdistutils
). When it fails, it will need thepython-toolchain
added too. The rest happens behind the scenes. We have simplified things for that use case by actually makingsetuptools
a run dependency of thepython-toolchain
to ensure it gets pulled into so only thepython-toolchain
will be needed as a dependency.The second piece basically this implements the same idea that @minrk described in this comment. This works by adding a configuration file to
$PREFIX/etc/pip.conf
or%LIBRARY_PREFIX\etc\pip.conf
on Windows. Aspip
may not know where to find this file and it will not necessarily look in such places we setPIP_CONFIG_FILE
in activation scripts to make sure it finds this. In the long run, we will want the functionality asked for in this issue ( conda/conda-build#910 ) to make this work smoothly. In the interim, there is a kludgy one line hack that we can use to get by. In any event, this will allow one to dopip install .
and everything will work correctly behind the scenes. Just as mentioned in the previous case, we made things easier by makingpip
a runtime dependency of thepython-toolchain
. Should add that regardless of whether the package usesdistutils
orsetuptools
, we still findpip install .
works fine with thepython-toolchain
.This package (just as the
toolchain
package) was designed so that it could work locally just as well as it does in the CIs. By doing this, we make it easy for people to debug things locally. A feature that remains useful for more complex problems.Please provide feedback on this. Also, feel free to take it for a test drive. 🚗
cc @msarahan @ocefpaf @pelson @minrk @scopatz @frol