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

KeyError: 'build' in File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/post.py", line 394, in get_build_metadata #998

Closed
mithro opened this issue Jun 4, 2016 · 3 comments · Fixed by #999
Labels
locked [bot] locked due to inactivity

Comments

@mithro
Copy link

mithro commented Jun 4, 2016

Conda has started to fail to build my openocd package at https://github.com/timvideos/conda-hdmi2usb-packages/tree/master/openocd

You can see the complete logs at https://travis-ci.org/timvideos/conda-hdmi2usb-packages/jobs/135197247

+ ./src/openocd --version
+ head -1
+ sed -es/-/_/g '-es/.* 0\./0./' '-es/ .*//'
+ ./src/openocd --version
+ sed '-es/[^(]*(//' '-es/)//' -es/://g -es/-/_/g
+ head -1
+ TZ=UTC
+ date +%Y%m%d%H%M%S
Deprecation warning: support for __conda_version__ will be removed in Conda build 2.0.Try Jinja templates instead: http://conda.pydata.org/docs/building/environment-vars.html#git-environment-variables
Setting version from __conda_version__.txt: 0.10.0_dev_00248_g772a165
Deprecation warning: support for __conda_buildnum__ will be removed in Conda build 2.0.Try Jinja templates instead: http://conda.pydata.org/docs/building/environment-vars.html#git-environment-variables
Setting build number from __conda_buildnum__.txt: 20160604040737
An unexpected error has occurred, please consider sending the
..
    https://github.com/conda/conda-build/issues
.
Include the output of the command 'conda info' in your report.
..
Traceback (most recent call last):
  File "/tmp/.../conda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/main_build.py", line 134, in main
    args_func(args, p)
  File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/main_build.py", line 373, in args_func
    args.func(args, p)
  File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/main_build.py", line 320, in execute
    need_source_download=need_source_download)
  File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/build.py", line 523, in build
    get_build_metadata(m)
  File "/tmp/.../conda/lib/python3.5/site-packages/conda_build/post.py", line 394, in get_build_metadata
    m.meta['build']['number'] = build_number
KeyError: 'build'
@mithro
Copy link
Author

mithro commented Jun 4, 2016

I think the problem appears to be the lack of build section in my meta.yaml file?

mithro added a commit to litex-hub/litex-conda-packages that referenced this issue Jun 4, 2016
@msarahan
Copy link
Contributor

msarahan commented Jun 4, 2016

Yes, in order to use the post-build versioning, you must have the build section in your meta.yaml file. We can fix that by adding the 'build' key if it doesn't exist.

As you've mentioned in #8, post-build versioning is deprecated. Post-build versioning makes it impossible to reason about the filename that will be output by a build, which in turn breaks other parts of conda-build, such as pre-rendering templates, and outputting built package filenames without actually doing a build. I could not come up with good reasons why versions can't be known before a build. I'm open to discussion if you have ideas. I think your versioning needs will be well-met with jinja2 templating, though, and I'm happy to answer questions you may have on that.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants