Accept "ZEPHYR_MODULES" For Building Docs

First off, I see a new changed requirement for making Public tickets:

To raise a public support ticket you need to provide your location in profile. profile
Please fill these missing fields:

Location

However, the profile page still only says "Required for private tickets", and not public.

Now for the actual issue: Trying to build sdk-nrf/doc isn't playing nice with environmental variables like "ZEPHYR_MODULES".

I have my structure different and don't rely on a "modules" folder, so I use that variable to specify where the projects are located.

Yet, even when I specify the path to the nrfx and hal_nordic folders, it still says "No such file or directory: '/<pathToTopDir>/modules/hal/nordic/nrfx/doc/sphinx'".

It shouldn't have even been looking for the "/modules" folder when I'm not using it and I already specified where with the folders are located.

But even more perplexing is when I edited the zephyr/west.yml and sdk-nrf/west.yml, where I commented out: "revision: 077031bf6eaac5352e304ad0f1a0c5b16b4dd115" and changed "path: modules/hal/nordic" to "path: modules/hal/nordicWTH", I added print statements in the python files and found:

"_load_projects pd is: {'name': 'hal_nordic', 'path': 'modules/hal/nordicWTH', 'groups': ['hal']}"

called by

"_load_self zephyr /<pathToTopDir>/zephyr submanifests"
"_load_projects pd is: {'name': 'hal_nordic', 'revision': '077031bf6eaac5352e304ad0f1a0c5b16b4dd115', 'path': 'modules/hal/nordic', 'groups': ['hal']}"

called by

"_load_self nrf /<pathToTopDir>/nrf None"

I mean, where could it possibly still be getting that when I changed the yml?

What I'm seeing is happening is that west is automatically reading zephyr's west.yml right from the start. There, it's pulling the changed values (revision commented out, and path changed).

But after that, the "west.yml" is being read from the nrf folder. Here, that is wrong immediately. There is NO "nrf" in the topdir folder. And even then, it's magically getting the original hal_nordic settings.

My folder structure is something along the lines of:

sources
arm
nordic
sdk-nrf
hal_nordic
...
riscv
esp32
...
zephyrtopdir
zephyr
arm //ln -s to original location
riscv //ln -s to original location
... //no modules here since they're included in the corresponding arch folder

Mind you, I've already been able to build zephyr by itself, but trying to build all of the docs at one time via sdk-nrf using custom modules paths just isn't happening (it does build with "standard" modules path).

EDIT0: I see if I change sdk-nrf/west.yml "path: nrf" -> "path: ARM/Nordic", that takes care of "_load_self nrf /<pathToTopDir>/nrf None" by providing the correct path.

Frankly, there should be an environmental variable like ZEPHYR_BASE which gets used if it exists (perhaps NCS_BASE?)

I still don't like the fact that west is a requirement when under-the-hood stuff still happens with cmake. I should only need cmake.

Now, I see "_import_path_from_project" is what's bringing the "imported" "data" in from zephyr, and is looking for the "c932ad1952970987301719d927fc0232116e908f" commit in "sdk-zephyr" which I didn't have updated since I was using mainline.

But I'm still wondering, without having an existing zephyr that is being looked for, how it's pulling ANYTHING, much less the changed "west.yml" files that DO exist. I mean, does it get cached somewhere?:

_import_path_from_project <Project zephyr ('<pathToTopDir>/zephyr') at c932ad1952970987301719d927fc0232116e908f> west.yml
Manifest__init__file= None data= {
"manifest":
{
"defaults": { "remote": "upstream" },
"remotes":
[
{
"name": "upstream",
"url-base": "https://github.com/zephyrproject-rtos",
},
],
"projects":
[
{
"name": "canopennode",
"revision": "1052dae561497bef901f931ef75e117c9224aecd",
"path": "modules/lib/canopennode",
},
...
{
"name": "hal_nordic",
"revision": "077031bf6eaac5352e304ad0f1a0c5b16b4dd115",
"path": "modules/hal/nordic",
"groups": ["hal"],
},
...
{
"name": "zscilib",
"path": "modules/lib/zscilib",
"revision": "12bfe3f0a9fcbfe3edab7eabc9678b6c62875d34",
},
],
"group-filter": ["-ci"],
"self":
{
"west-commands": "scripts/west-commands.yml",
"import": "submanifests",
},
},
}

You can see "hal_nordic" revision and path are set to the normal values even though I changed the zephyr west.yml.

"$ west list" shows the changed "hal_nordic" values.

I also changed sdk-nrf west.yml "repo-path: sdk-zephyr" -> "repo-path: zephyr" and "revision: c932ad1952970987301719d927fc0232116e908f" -> "revision: main" or "revision: aceed99e2d224960d398fd812032ba71eba10162", and it's still magically getting unchanged values.

Manifest__init__file= <pathToTopDir>/ARM/Nordic/sdk-nrf/west.yml data= None kwargs= {}
_import_content_from_project <Project zephyr ('<pathToTopDir>/zephyr') at aceed99e2d224960d398fd812032ba71eba10162> west.yml
...
   - name: hal_nordic
     revision: 077031bf6eaac5352e304ad0f1a0c5b16b4dd115
     path: modules/hal/nordic
     groups:
       - hal
...

compared with the zephyr west.yml file I changed:

- name: hal_nordic
#revision: 077031bf6eaac5352e304ad0f1a0c5b16b4dd115
path: modules/hal/nordicWTF
groups:
- hal

It's looking like "_manifest_content_at" dealing directly with the .git blobs which is not helpful at all. Hopefully there's a yml way around that to take into account my own changes (without making any commits).

GOT IT!(... I think). It's progressing now and via https://github.com/zephyrproject-rtos/west/issues/560 did I find a way through it by "importing submodules".

Parents
  • Hi

    Were you able to get this working?

    Unfortunately we only support building the docs as described in the documentation, using the standard folder structure. 

    Best regards
    Torbjørn

  • Not yet. I resolve one thing and find something else ugly underneath.

    I'm currently at your "merge_search_indexes.py:for src_name, src_value in src_object.items()" where it says "AttributeError: 'list' object has no attribute 'items'". Yet, when I "print("src_prefix", src_prefix, "src_object", src_object)", there's a BOATLOAD of "items" like "[[153, 0, 1, 'c.BITMASK_BYTES_CALCULATE', 'BITMASK_BYTES_CALCULATE'],..."

    It's why I'm not marking my previous post as an "accepted solution" when it isn't yet since I'm finding there's more to it.

    Python isn't my go-to language (goto pun?), so it's going to take a bit.

    EDIT0: It "MAY" be the fact that "src_prefix" is blank/empty, in which case, I have to walkback through how that happened.

Reply
  • Not yet. I resolve one thing and find something else ugly underneath.

    I'm currently at your "merge_search_indexes.py:for src_name, src_value in src_object.items()" where it says "AttributeError: 'list' object has no attribute 'items'". Yet, when I "print("src_prefix", src_prefix, "src_object", src_object)", there's a BOATLOAD of "items" like "[[153, 0, 1, 'c.BITMASK_BYTES_CALCULATE', 'BITMASK_BYTES_CALCULATE'],..."

    It's why I'm not marking my previous post as an "accepted solution" when it isn't yet since I'm finding there's more to it.

    Python isn't my go-to language (goto pun?), so it's going to take a bit.

    EDIT0: It "MAY" be the fact that "src_prefix" is blank/empty, in which case, I have to walkback through how that happened.

Children
No Data
Related