Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Checking out development branch causes a build failure

raeder

Member
What version of the code are you using?

> git describe
cesm2_0_alpha10e-1237-g5437da0 This has cesm3.0_alphabranch merged in.


Have you made any changes to files in the source tree
I changed .gitmodules to get some clones from my github forks.
All of the forks were up-to-date with the ESCOMP versions when I ran git-fleximod this morning.

Describe every step you took leading up to the problem:
The goal is to make a small change in each of most of the components of CESM,
which will enable st-archiving of new types of files (from DART).
After reading the relevant parts of instructions for developers I:
1) Forked some repositories, with all of the their branches, to github.com/kdraeder:
2) Selected the development branch for each in the forks:
Code:
repos          develop branch
 cesm           master
 cime           master
 CAM            cam_development
 CESM_CICE      main
 CTSM           master
 CMEPS          main
 MOM_interface  main
 mizuRoute      cesm-coupling
 RTM            master
 MOSART         master

3) git clone https://github.com/kdraeder/cesm.git cesm3.0_gh_kdraeder
4) Modified .gitmodules to use the kdraeder versions of those repositories,
but continue to use the default versions of the others:
Code:
   [submodule "ccs_config"]
        path = ccs_config
        url =           https://github.com/ESMCI/ccs_config_cesm.git
        fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
        fxtag = ccs_config_cesm1.0.32
        fxrequired = ToplevelRequired

    [submodule "cime"]
        path = cime
        url =           https://github.com/kdraeder/cime
        fxDONOTUSEurl = https://github.com/ESMCI/cime
        fxtag = cime6.1.72
        fxrequired = ToplevelRequired
...

5) git-fleximod update
This leaves all of the clones in a detached HEAD state.
6) Built and ran a B compset case for a day as a test.
7) Set up each target clone (but not cesm) for development work by (tcsh):
(These remote commands are left over from cases in which I used the default .gitmodules)
Code:
git remote rename origin upstream
      git remote add origin https://github.com/kdraeder/$repos[$r].git
      git checkout    $dev_br[$r]
      git pull origin $dev_br[$r]
      git checkout -b ${repname}_st-arch_dart
Example status:
Code:
      git status -uno
          On branch clm_st-arch_dart
          Changes not staged for commit:
                  modified:   src/fates (new commits)
      git remote -v
          origin   https://github.com/kdraeder/CTSM.git (push)
          upstream https://github.com/kdraeder/CTSM (fetch)

8) case.build --clean-all
9) case.build failed in the CLM build:

Code:
/glade/work/raeder/Models/cesm3.0_gh_kdraeder/components/clm/src/utils/clmfates_interfaceMod.F90(2878):
    error #6460:
    This is not a component name that is defined in the encompassing structure.   [COSZEN]
      this%fates(nc)%bc_in(s)%coszen = coszen_col(c)
...

Describe your problem or question:
What's wrong with my `build`s, branches, andor remotes?
Why does it work when those pieces are in a detached HEAD state, but not when I check out development branches?
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
@raeder I don't have permissions to see your code on glade, so I can't look at any of this. But, I think there's a couple of things that are problematic with the process you've done as I understand it. A simple thing is that you'll want a remote to the upstream version for each of the modified submodule directories. Once, you have that you can fetch from the upstream for each submodule directory and be able to see tags and use describe.

Bash:
cd components/clm
git remote add upstream https://github.com/ESCOMP/CTSM.git
git fetch upstream
git describe[
/CODE]

It looks like you might have a script that does this setup for you, so you could add some of the above to the script.

The other part though is that if I understand you're process, you have the latest from the development branch for each submodule. And you should NOT expect that to ever work for a CESM checkout. Maybe in some rare conditions you can do that -- but you shouldn't expect it to. What you should expect to work is a branch for each subcomponent that's based of the version used as specified in the CESM .gitmodules file.

So start with a branch for the submodules you need to update from the version in the CESM alpha branch .gitmodules file.

[URL]https://github.com/ESCOMP/CESM/blob/cesm3.0-alphabranch/.gitmodules[/URL]

I assuming you wanted to use the latest in each submodule to make it easter to be able to bring in your changes to each subcomponent. But, don't worry about that -- it'll be close enough. And if you make a PR to each subcomponent the maintainers will be able to merge it to the latest and bring it into that repository

The thing is -- it's tricky to get the submodules all aligned together in a way that they'll work together. Sometimes changes in one submodule makes it incompatible with another. So never expect the latest will ever work together, start with something that's been tested and known to work.

I think that's what you need to get something working together. Let us know how it goes.
 
Top