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
Fix win datadir #22
Fix win datadir #22
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 ( |
Ok, now there is a fix pushed that fixes all the failing tests. This solution is the simplest one, where we copy a script to set the environment variable on activation of the conda env. According to conda-build docs (https://docs.conda.io/projects/conda-build/en/latest/resources/activate-scripts.html) this is to be avoided when possible but I don't understand the build process well enough to find another solution. It should be possible to update the build files to have the correct hard-coded BABEL_DATADIR (as it does for OSX and Linux) but my efforts in that direction has failed. I'll leave it like this for a couple of days to see if anyone has a hint as to how we could make a less hacky solution. |
@conda-forge-admin please rerender |
Hi! This is the friendly automated conda-forge-webservice. |
With no other input, I went ahead and bumped the build number and removed the WIP-status. I also updated the activation-scripts to stash and reset BABEL_DATADIR if it was set before activation of the conda environment. To me, this is ready to merge now. |
I haven't been able to test locally, but in principle this looks fine to me. Ideally the hard-coded path detection and prefix replacement in conda-build would mean this isn't necessary... but I don't know enough about it to say whether it is possible to rely on that. Maybe if the Also, I take it that there's no need to set |
I also thought the path-detection and prefix replacement would do it, but I couldn't make it work. I managed to get the path updated in the binary files, but there is something in how BABEL_DATADIR works that still made the wrong folder turn up in tokenst.cpp from the makro. Too much c++-makro smartness for my brain... |
Thanks for all your work here. We really should move away from relying on BABEL_DATADIR to be set. With OB 3.0, I managed to reduce the amount of data read from there but there's still more to go. |
This is intended to fix the issues that arises due to Conda not able to find the correct BABEL_DATADIR when building on Windows. This is the reason behind openbabel/openbabel#2409 and openbabel/openbabel#2372
I also tried to change the testing to actually fail when tests fail. Since
obabel
exits with 0 also when formats or data files are not found the current tests don't amount to anything. There are optional ways to do this but this was most in line with the current solution I think. An option would be to change thetests: -> commands
-lines to things like- python -c "import subprocess;exit(b'1 molecule converted' not in subprocess.run(['obabel', '-:c1ccccc1', '--gen3d', '-oinchi'], capture_output=True).stderr)"
but I thought the way in this PR is more clear.It's marked as WIP since I wanted to get a failing test on the CI before correcting the issue. I also have a question on the best possible solution to set the env correctly that I will expand on below in comments. I will also take care of the build number and re-rendering before removing WIP
Checklist
conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)