add explanatory page about environment types#2738
add explanatory page about environment types#2738h-vetinari wants to merge 16 commits intoconda-forge:mainfrom
Conversation
✅ Deploy Preview for conda-forge-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
pre-commit.ci autofix |
b90ff88 to
c0b4740
Compare
jaimergp
left a comment
There was a problem hiding this comment.
Nice explanation! I added some comments that helped me understand the text in a clearer way. Thanks!
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
mgorny
left a comment
There was a problem hiding this comment.
As you probably know, I'm not an expert at English, but I think it makes sense to aim at non-native speakers being able to read it clearly. Also, in general I'd suggest avoid deeply nested sentences, they can easily get confusing.
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michał Górny <mgorny@gentoo.org> Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
|
Thanks a lot for the thorough reviews! I think I've incorporated basically everything, and have resolved the corresponding comments. I still need to do a pass through the docs for other places where this should be referenced. |
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
| ### Native builds | ||
|
|
||
| When the architectures between `build:` and `host:` match, the situation is simpler, because in that | ||
| case, both environments are able to execute code on the machine. Do not be confused by this additional |
There was a problem hiding this comment.
(Sorry, the old comment got disconnected.)
To be honest, I still think "confused" is confusing here; it suggests that the reader would be confused by being able to execute programs, but why would they be? I think the meaning you want to convey is that this is a pitfall.
There was a problem hiding this comment.
What I'm trying to express is the fact that, for build: == host:, being able to execute stuff from both environments is the main reason it's confusing in the first place, i.e. having to ask "do I put that in build: or host:?".
I'm trying to say that people should not get stuck in trying to fit a square peg (native compilation) into a round hole (the build: / host: separation).
But happy to find ways to improve the formulation here.
| it is _not_ assumed to depend on the ABI of `baz` (and would not be rebuilt if `baz` releases a new | ||
| ABI-changing version; only `bar` would be rebuilt in that case). | ||
|
|
||
| This is why the link check at the end of the build has an essential role. It will warn if the package |
There was a problem hiding this comment.
I think you should include an example output here, since someone who doesn't have a build log handy may have a hard time figuring out what you're talking about. And my understanding is that the "Understanding" part should be readable without having a particular example at hand.
There was a problem hiding this comment.
I spent an embarrassingly large amount of time on finding an appropriate example (neither trivial, nor overwhelming, etc.). Best I got so far would be
<RecipeTabs>
```
INFO: sysroot: '/home/conda/feedstock_root/build_artifacts/mujoco_1749065357629/_build_env/x86_64-conda-linux-gnu/sysroot/' files: '['usr/share/zoneinfo', 'usr/share/locale/zh_TW/LC_MESSAGES/libc.mo', 'usr/share/locale/zh_CN/LC_MESSAGES/libc.mo', 'usr/share/locale/vi/LC_MESSAGES/libc.mo']'
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libmujoco.so.3.3.2 found in local/linux-64::libmujoco==3.3.2=hebd7970_1
WARNING (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/liblodepng.so found in ['conda-forge/linux-64::lodepng==20220109=h924138e_0']
WARNING (mujoco-simulate,bin/mujoco-simulate): .. but ['conda-forge/linux-64::lodepng==20220109=h924138e_0'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libglfw.so.3 found in conda-forge/linux-64::glfw==3.4=hd590300_0
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libpthread.so.0 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libstdc++.so.6 found in conda-forge/linux-64::libstdcxx==15.1.0=h8f9b012_2
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libm.so.6 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libgcc_s.so.1 found in conda-forge/linux-64::libgcc==15.1.0=h767d61c_2
INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libc.so.6 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
WARNING (mujoco-simulate): dso library package conda-forge/linux-64::libgl==1.7.0=ha4b6fd6_2 in requirements/run but it is not used (i.e. it is overdepending or perhaps statically linked? If that is what you want then add it to `build/ignore_run_exports`)
```
```
│ │ [bin/mujoco-simulate] links against:
│ │ ├─ lib/liblodepng.so (lodepng)
│ │ ├─ lib/libmujoco.so.3.3.6 (libmujoco)
│ │ ├─ lib/libgcc_s.so.1 (libgcc)
│ │ ├─ lib/libstdc++.so.6.0.34 (libstdcxx)
│ │ ├─ libc.so.6 (system)
│ │ ├─ libpthread.so.0 (system)
│ │ ├─ lib/libglfw.so.3.4 (glfw)
│ │ └─ libm.so.6 (system)
│ │ ⚠ warning Overdepending against libgl
```
</RecipeTabs>
However, I cannot manage to get rattler-build to produce a correct overlinking warning. There's quite a bit more divergence w.r.t. overdepending warnings too.
I think run-exports will eventually have to be broken out into a separate article... Not necessarily now, but it looks inevitable 😅
There was a problem hiding this comment.
Just please use plain <Tabs/> with conda-build / rattler-build rather than abusing RecipeTabs, see e.g. docs/how-to/basics/populate-dependencies.mdx.
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
docs/maintainer/understanding_conda_forge/environment-types.mdx
Outdated
Show resolved
Hide resolved
| ```yaml | ||
| requirements: | ||
| build: # [build time] `linux-64`; where compilers and other tools get executed | ||
| - ${{ stdlib("c") }} # - translates to `sysroot_linux-aarch64`; mostly the C standard library |
There was a problem hiding this comment.
A more general comment: the discussion below doesn't really hint that sysroots — which pretty much fall into the category of headers/libraries you need — end up in build: rather than host:.
There was a problem hiding this comment.
Yeah that's true. I've left out discussion of most of the compiler bits, which I think are more appropriate for a separate page.
There was a problem hiding this comment.
Yeah, I agree with that, but perhaps leave a hint that there are special cases not covered in this doc.
Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Michał Górny <mgorny@gentoo.org>

In #2701 I had asked to break out the discussion about environments into a separate page. This is a first draft of what I had been thinking about. It's not yet hooked up to the rest of the documentation, which should refer to this in a couple of places (and deduplicate existing shorter explanations).