Skip to content

Conversation

@akritkbehera
Copy link
Collaborator

@akritkbehera akritkbehera commented Dec 16, 2025

This fixes the broken default-architecture for bits it searches for defaults-architecture in configured directory if it exists it merges them defaults-release or any other default provided through --defaults in CLI.
If defaults-architecture exists it will take precedence over other values which is similar to aliBuild behavior.
Resolves #60

@akritkbehera akritkbehera marked this pull request as ready for review December 16, 2025 13:13
@akritkbehera akritkbehera requested a review from pbuncic December 16, 2025 13:14
@pbuncic
Copy link
Contributor

pbuncic commented Dec 17, 2025

@ktf, @Ni-Langguth - can you check this PR to make sure it does not do something backwards incompatible with ALICE and is in line with what is needed by LCG?

@Ni-Langguth
Copy link

Ni-Langguth commented Jan 6, 2026

Hi, I tested this with our CI and found that the build requires 'default-$architecture.sh' on this branch. Is this intentional, and if so, could this requirement be made optional?

[root@lcgapp-alma9-physical lcg.bits]# bits build --defaults lcg::gcc15::dbg ninja --always-prefer-system --force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg
ERROR: Default `./common.bits/defaults-x86-64-alma9-gcc15-dbg.sh' does not exists.
ERROR: 
Traceback (most recent call last):
  File "/build/nlanggut/bitsPlayground0/bits/bitsBuild", line 133, in <module>
    doMain(args, parser)
  File "/build/nlanggut/bitsPlayground0/bits/bitsBuild", line 82, in doMain
    doBuild(args, parser)
  File "/build/nlanggut/bitsPlayground0/bits/bits_helpers/build.py", line 702, in doBuild
    (err, overrides, taps) = parseDefaults(args.disable,
  File "/build/nlanggut/bitsPlayground0/bits/bits_helpers/utilities.py", line 565, in parseDefaults
    if exists(archDefaults):
  File "/usr/lib64/python3.9/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

…n `parseDefaults` for default-architecture.
@akritkbehera
Copy link
Collaborator Author

--force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg

Hi @Ni-Langguth
It should be optional now. That was the original intent, consistent with how it works in AliBuild.

bits build --defaults cms::o2 gcc --force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg -w temp -c cms.bits

==> Configured directory:
    /home/akbehera/Desktop/repositories/repositories/cms.bits

==> Package Recipe will be searched in the following order
    cms,bits
    ```
    

@pbuncic
Copy link
Contributor

pbuncic commented Jan 7, 2026

I

--force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg

Hi @Ni-Langguth It should be optional now. That was the original intent, consistent with how it works in AliBuild.

bits build --defaults cms::o2 gcc --force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg -w temp -c cms.bits

==> Configured directory:
    /home/akbehera/Desktop/repositories/repositories/cms.bits

==> Package Recipe will be searched in the following order
    cms,bits
    ```
    

I am puzzled why in this example you search cms.bits and bits.bits directories - bits.bits was not specified on the command line. The standard workflow I was imagining was to place bits.rc in cms.bits, cd to cms.bits, search for recipes in $PWD and in all directories specified by the search_path defined in bits.rc. Since we agreed last time to pull together all recipes, there is now a common bits that has everything merged in one place, so search_path=common would in bits.rc would do the trick. If you relly do not want to put bits.rc in cms.bits, you can check out common.bits and point BITS_PATH to it, or we need another argument to set up search_path.

@pbuncic
Copy link
Contributor

pbuncic commented Jan 7, 2026

BTW, this branch has conflicts that need to be resolved.

@akritkbehera
Copy link
Collaborator Author

I

--force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg

Hi @Ni-Langguth It should be optional now. That was the original intent, consistent with how it works in AliBuild.

bits build --defaults cms::o2 gcc --force-unknown-architecture --architecture=x86-64-alma9-gcc15-dbg -w temp -c cms.bits

==> Configured directory:
    /home/akbehera/Desktop/repositories/repositories/cms.bits

==> Package Recipe will be searched in the following order
    cms,bits
    ```
    

I am puzzled why in this example you search cms.bits and bits.bits directories - bits.bits was not specified on the command line. The standard workflow I was imagining was to place bits.rc in cms.bits, cd to cms.bits, search for recipes in $PWD and in all directories specified by the search_path defined in bits.rc. Since we agreed last time to pull together all recipes, there is now a common bits that has everything merged in one place, so search_path=common would in bits.rc would do the trick. If you relly do not want to put bits.rc in cms.bits, you can check out common.bits and point BITS_PATH to it, or we need another argument to set up search_path.

I have a $HOME/.bitsrc file setup which which does the same thing as providing a bits.rc through CLI.
Example:

[bits]
  organisation=cms
[cms]
  pkg_prefix=VO_CMS
  repo_dir=/home/akbehera/Desktop/repositories/repositories
  sw_dir=/home/akbehera/Desktop/repositories/sw
  search_path=cms,bits

@Ni-Langguth
Copy link

Sorry about the late response, this works for me as well.

@pbuncic pbuncic merged commit 40fdba4 into bitsorg:main Jan 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defaults-arch is behaviour is not as per expected.

4 participants