Skip to content

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Jan 29, 2024

Resolves the #86 (review).

@@ -177,14 +177,17 @@ case "$HOST" in
;;
esac

# Unsetting the CMAKE_PREFIX_PATH variable resolves linking issues
# with bitcoin-qt. This action is possible because other packages
# using Guix's cmake-build-system continue to build without issues.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves linking issues # with bitcoin-qt.

Can this be more specific? Why is this only needed in Guix? Is it fixed in later versions of Qt?

Guix's cmake-build-system continue to build without issues.

Is this guaranteed? Or just happens to work now by chance / might break in the future?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves linking issues # with bitcoin-qt.

Can this be more specific?

Otherwise, the build/src/qt/CMakeFiles/bitcoin-qt.dir/link.txt contains -L/home/hebasto/.guix-profile/lib (on my machine), which results in errors noted by @TheCharlatan.

Why is this only needed in Guix?

Because Guix sets it to a value which does not work for us. For more details, please refer to https://mail.gnu.org/archive/html/guix-commits/2015-03/msg00518.html.

Is it fixed in later versions of Qt?

I don't know. Lurking through the https://bugreports.qt.io did not help much.

Guix's cmake-build-system continue to build without issues.

Is this guaranteed? Or just happens to work now by chance / might break in the future?

No guarantees. However, if any package, which uses Guix's cmake-build-system, fails to find its dependencies we still able to specify hint via the CMAKE_LIBRARY_PATH and/or CMAKE_INCLUDE_PATH environment variables.


As an alternative solution, we might consider the patching:

sed -i "s|-L${CMAKE_PREFIX_PATH}/lib||" build/src/qt/CMakeFiles/bitcoin-qt.dir/link.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, the build/src/qt/CMakeFiles/bitcoin-qt.dir/link.txt contains -L/home/hebasto/.guix-profile/lib (on my machine),

Ok, so this isn't really guix specific then, other than it's currently only been seen in Guix (i.e I assume a problematic -L could appear outside of a Guix build)? Shouldn't this be worked around by patching Qt in depends?

Because Guix sets it to a value which does not work for us.

You mean doesn't work for Qt? I assume the exact same problem would happen to anyone (outside of Guix) setting CMAKE_PREFIX_PATH to a value Qt doesn't like?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworked. The CMAKE_PREFIX_PATH environment variable is not touched anymore.

@hebasto hebasto marked this pull request as ready for review January 29, 2024 14:22
@hebasto
Copy link
Owner Author

hebasto commented Jan 29, 2024

Guix build (both x86_64 and arm64):

17b64ab27e7018a32a231d42cf73ac0902e0645f98f246e80b2de6e0cf682cc0  guix-build-6bd8789858de/output/aarch64-linux-gnu/SHA256SUMS.part
43ab1e7f5565f7172f3342d239bfbcefdca652ea37e00e48ad9a19e119cb289a  guix-build-6bd8789858de/output/aarch64-linux-gnu/bitcoin-6bd8789858de-aarch64-linux-gnu-debug.tar.gz
38c8da04af4db06df87efdb5a05e0b059b6c90a840af5fcc4f5e7d7caf04c231  guix-build-6bd8789858de/output/aarch64-linux-gnu/bitcoin-6bd8789858de-aarch64-linux-gnu.tar.gz
3adf03850d3771d91fd8691639dd34e39a4d70fed77d206ae9e9df743bbc3094  guix-build-6bd8789858de/output/arm-linux-gnueabihf/SHA256SUMS.part
953aab517f334ef2a520806b561d20435447c993cf4f4ba6b82a56ea93758306  guix-build-6bd8789858de/output/arm-linux-gnueabihf/bitcoin-6bd8789858de-arm-linux-gnueabihf-debug.tar.gz
67b8743ce118828de14157a767cd69693a43bc02b8ad516cf8cf7f55473c7c5c  guix-build-6bd8789858de/output/arm-linux-gnueabihf/bitcoin-6bd8789858de-arm-linux-gnueabihf.tar.gz
b1f316d7b602f340a505a9122adc2c437fbb6e69ece6753d21336eb30a8886eb  guix-build-6bd8789858de/output/dist-archive/bitcoin-6bd8789858de.tar.gz
6820b41b9f58f037891d998a3e7a09cc0dcb322b2177a315be5f90b8e83c3708  guix-build-6bd8789858de/output/powerpc64-linux-gnu/SHA256SUMS.part
f1b116d0bc2fdb8eb6979a4d6f7f74759e8e8f00c209edd3f223c77db18ee1d0  guix-build-6bd8789858de/output/powerpc64-linux-gnu/bitcoin-6bd8789858de-powerpc64-linux-gnu-debug.tar.gz
ea442fdc6e440d223adba6b9c1d489448925408ffeb9b45fc7ba2f452a19b143  guix-build-6bd8789858de/output/powerpc64-linux-gnu/bitcoin-6bd8789858de-powerpc64-linux-gnu.tar.gz
faa3c069c847e81d020cbfcca8d12b6d7401cce028a9ba7454bd61da037d3c38  guix-build-6bd8789858de/output/powerpc64le-linux-gnu/SHA256SUMS.part
43a20f7b6180ee99df89573d95725d3357cb9b9b0c8ba072488e1f4bb332612a  guix-build-6bd8789858de/output/powerpc64le-linux-gnu/bitcoin-6bd8789858de-powerpc64le-linux-gnu-debug.tar.gz
26ce21d5b0738702828f53d4bf26f44c448791b32f61c84a39e667e4ad230709  guix-build-6bd8789858de/output/powerpc64le-linux-gnu/bitcoin-6bd8789858de-powerpc64le-linux-gnu.tar.gz
0918bb7952fada9ce10e641a26f2f7594fe9138d9d1a7d4423a66558c8a94ebd  guix-build-6bd8789858de/output/riscv64-linux-gnu/SHA256SUMS.part
3b26035115f50f54fe3c416ea1b287bbeb537d6ba659fd52824c50aaa177c8e0  guix-build-6bd8789858de/output/riscv64-linux-gnu/bitcoin-6bd8789858de-riscv64-linux-gnu-debug.tar.gz
3129188cfa46a70a853abb2e85138bac772bfcc98de235185a589c9b44077b62  guix-build-6bd8789858de/output/riscv64-linux-gnu/bitcoin-6bd8789858de-riscv64-linux-gnu.tar.gz
3bd116309d27f06d4ef7fbcdbdbe2da1ae5b80342aff9dbcdeb7f6ab8031bbe3  guix-build-6bd8789858de/output/x86_64-linux-gnu/SHA256SUMS.part
cd652100dba7f2ba9045e4e1f4acfe2015345d1eb63bad2e406c8e91f5903405  guix-build-6bd8789858de/output/x86_64-linux-gnu/bitcoin-6bd8789858de-x86_64-linux-gnu-debug.tar.gz
be915ea154adf5e24714e9f5c8d28d3d10b655893ca3feea723dcf7d1f8c7306  guix-build-6bd8789858de/output/x86_64-linux-gnu/bitcoin-6bd8789858de-x86_64-linux-gnu.tar.gz

@hebasto hebasto added the enhancement New feature or request label Jan 29, 2024
`# Required to ignore the CMAKE_PREFIX_PATH environment` \
`# variable set by Guix, which works for native search paths,` \
`# but not for cross-compiling.` \
-DCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH=OFF \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is needed, can it be set ealier / in depends and then passed down as part of the configuration? I assume anything built with CMake in depends could have this same problem? Setting this at this point, would make it seem like our depends configuration is leaky. The toolchain file/configuration it produces should not be looking outside of depends for anything?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was that I considered first. However, CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH=OFF disables other facilities the user might be interested in, for example the <PackageName>_DIR variable. And, in other non-controlled by Guix cases, the user is the one who is responsible for the CMAKE_PREFIX_PATH environment variable.

In other words, I think nothing is wrong with our depends. But Guix just overuses the CMAKE_PREFIX_PATH environment variable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example the _DIR variable.

Discussed this offline. Usage of <PackageName>_DIR variable. is basically just reintroducing ALLOW_HOST_PACKAGES, which is not something we need to support (in depends).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworked per the discussion above.

@hebasto
Copy link
Owner Author

hebasto commented Jan 30, 2024

Updated Guix build:

x86_64
656fdc49571a21c5dea52be53095a7f76fddfa3855d7bcd530a1dd5f736c9912  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/SHA256SUMS.part
a042d54ea5d89dea463132ed0899dd32a694c3d53556ae0bcd694cc786ead189  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/bitcoin-6ed7dd1b3ac0-aarch64-linux-gnu-debug.tar.gz
707cf96ed16921f5d42f9269dc5fdbc144678073051619d4cbca04e2ed892f8a  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/bitcoin-6ed7dd1b3ac0-aarch64-linux-gnu.tar.gz
64b46fe08a3c9533bc26b4298c83b7213f71e54dd217ef95a669ea82ee10646d  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/SHA256SUMS.part
5a22a151fc2fecca428a9c265b306df8de4e8dda68e170c26d6f4d27528bce33  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/bitcoin-6ed7dd1b3ac0-arm-linux-gnueabihf-debug.tar.gz
a5e87ffbafbe02371da1cfd26fff6886a71f64da0ecda1c8379e5180719d02dc  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/bitcoin-6ed7dd1b3ac0-arm-linux-gnueabihf.tar.gz
10265481ca1759ea5a9dc3ca5e39aea213409637807cc4966fcf6eeb5db27ddf  guix-build-6ed7dd1b3ac0/output/dist-archive/bitcoin-6ed7dd1b3ac0.tar.gz
7a766a4d47c47e5ba062f5e132ff6f8f773ecc46f4e1bfb968deb5531e1614c0  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/SHA256SUMS.part
ba6a4eed1a29da578334230b4c8696c3d8f74a7712893cbf363f2424a1b2ec31  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64-linux-gnu-debug.tar.gz
0dbd32b18f205238c412f270f5cd63a6ce314b2cb18d6800b36fbae4b0079f4d  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64-linux-gnu.tar.gz
bb783bef5a8970f9df063c862f8145e2315941311d805853688780d8bce4fad5  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/SHA256SUMS.part
7d62f424d234ce4e2a2ac5b90b0df50e144d83b4681d0a3615da56ef8422905a  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64le-linux-gnu-debug.tar.gz
01a67a476992ef81cba1badd9e2b6309b344dcdb781e8eb082e2e1b261535343  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64le-linux-gnu.tar.gz
b2a486ba04d633460f896b97517781399be32ad696ce1043cc7c0cae0d63effb  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/SHA256SUMS.part
c67980922d011eeb15f845a75f8682db48a3495d6c11b0e3cc64fcea9af4fe69  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/bitcoin-6ed7dd1b3ac0-riscv64-linux-gnu-debug.tar.gz
58d28dcdd5cb964982a12b4a830eee14d99aa8858628f1a54dbcf8b3e27ac93a  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/bitcoin-6ed7dd1b3ac0-riscv64-linux-gnu.tar.gz
87a0168ce0313f72d351ae7277676b3a31972cbb7e8859712149219246103fc1  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/SHA256SUMS.part
710f663ff96974045b0e718a81e22bde2b90362cb6d26e5a542b4f245ad8fda4  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/bitcoin-6ed7dd1b3ac0-x86_64-linux-gnu-debug.tar.gz
abf1c462b7a291630662702fe57c96c3ebb9638877579fc369244de22c84aaad  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/bitcoin-6ed7dd1b3ac0-x86_64-linux-gnu.tar.gz

@TheCharlatan
Copy link

Guix builds (x86):

656fdc49571a21c5dea52be53095a7f76fddfa3855d7bcd530a1dd5f736c9912  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/SHA256SUMS.part
a042d54ea5d89dea463132ed0899dd32a694c3d53556ae0bcd694cc786ead189  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/bitcoin-6ed7dd1b3ac0-aarch64-linux-gnu-debug.tar.gz
707cf96ed16921f5d42f9269dc5fdbc144678073051619d4cbca04e2ed892f8a  guix-build-6ed7dd1b3ac0/output/aarch64-linux-gnu/bitcoin-6ed7dd1b3ac0-aarch64-linux-gnu.tar.gz
64b46fe08a3c9533bc26b4298c83b7213f71e54dd217ef95a669ea82ee10646d  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/SHA256SUMS.part
5a22a151fc2fecca428a9c265b306df8de4e8dda68e170c26d6f4d27528bce33  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/bitcoin-6ed7dd1b3ac0-arm-linux-gnueabihf-debug.tar.gz
a5e87ffbafbe02371da1cfd26fff6886a71f64da0ecda1c8379e5180719d02dc  guix-build-6ed7dd1b3ac0/output/arm-linux-gnueabihf/bitcoin-6ed7dd1b3ac0-arm-linux-gnueabihf.tar.gz
10265481ca1759ea5a9dc3ca5e39aea213409637807cc4966fcf6eeb5db27ddf  guix-build-6ed7dd1b3ac0/output/dist-archive/bitcoin-6ed7dd1b3ac0.tar.gz
7a766a4d47c47e5ba062f5e132ff6f8f773ecc46f4e1bfb968deb5531e1614c0  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/SHA256SUMS.part
ba6a4eed1a29da578334230b4c8696c3d8f74a7712893cbf363f2424a1b2ec31  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64-linux-gnu-debug.tar.gz
0dbd32b18f205238c412f270f5cd63a6ce314b2cb18d6800b36fbae4b0079f4d  guix-build-6ed7dd1b3ac0/output/powerpc64-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64-linux-gnu.tar.gz
bb783bef5a8970f9df063c862f8145e2315941311d805853688780d8bce4fad5  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/SHA256SUMS.part
7d62f424d234ce4e2a2ac5b90b0df50e144d83b4681d0a3615da56ef8422905a  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64le-linux-gnu-debug.tar.gz
01a67a476992ef81cba1badd9e2b6309b344dcdb781e8eb082e2e1b261535343  guix-build-6ed7dd1b3ac0/output/powerpc64le-linux-gnu/bitcoin-6ed7dd1b3ac0-powerpc64le-linux-gnu.tar.gz
b2a486ba04d633460f896b97517781399be32ad696ce1043cc7c0cae0d63effb  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/SHA256SUMS.part
c67980922d011eeb15f845a75f8682db48a3495d6c11b0e3cc64fcea9af4fe69  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/bitcoin-6ed7dd1b3ac0-riscv64-linux-gnu-debug.tar.gz
58d28dcdd5cb964982a12b4a830eee14d99aa8858628f1a54dbcf8b3e27ac93a  guix-build-6ed7dd1b3ac0/output/riscv64-linux-gnu/bitcoin-6ed7dd1b3ac0-riscv64-linux-gnu.tar.gz
87a0168ce0313f72d351ae7277676b3a31972cbb7e8859712149219246103fc1  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/SHA256SUMS.part
710f663ff96974045b0e718a81e22bde2b90362cb6d26e5a542b4f245ad8fda4  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/bitcoin-6ed7dd1b3ac0-x86_64-linux-gnu-debug.tar.gz
abf1c462b7a291630662702fe57c96c3ebb9638877579fc369244de22c84aaad  guix-build-6ed7dd1b3ac0/output/x86_64-linux-gnu/bitcoin-6ed7dd1b3ac0-x86_64-linux-gnu.tar.gz

Copy link

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6ed7dd1

@hebasto hebasto merged commit 5ccc4c8 into cmake-staging Feb 1, 2024
hebasto pushed a commit that referenced this pull request Jul 26, 2025
c40dbbb test: Move `script_assets_tests` into its own suite (Hennadii Stepanov)

Pull request description:

  This PR ensures that the `script_assets_tests` test case is explicitly reported as "Skipped" when it is not run, making it clearer when running the test suite with `ctest`:

  - on the master branch @ 9355578:
  ```
  $ env -u DIR_UNIT_TEST_DATA ctest --test-dir build -j 16 -R "^script_"
  Internal ctest changing into directory: /home/hebasto/git/bitcoin/build
  Test project /home/hebasto/git/bitcoin/build
      Start 87: script_tests
      Start 83: script_p2sh_tests
      Start 85: script_segwit_tests
      Start 86: script_standard_tests
      Start 84: script_parse_tests
  1/5 Test #84: script_parse_tests ...............   Passed    0.11 sec
  2/5 Test #86: script_standard_tests ............   Passed    0.11 sec
  3/5 Test #85: script_segwit_tests ..............   Passed    0.12 sec
  4/5 Test #83: script_p2sh_tests ................   Passed    0.12 sec
  5/5 Test #87: script_tests .....................   Passed    0.36 sec

  100% tests passed, 0 tests failed out of 5

  Total Test time (real) =   0.37 sec
  ```
  - with this PR:
  ```
  $ env -u DIR_UNIT_TEST_DATA ctest --test-dir build -j 16 -R "^script_"
  Internal ctest changing into directory: /home/hebasto/git/bitcoin/build
  Test project /home/hebasto/git/bitcoin/build
      Start 83: script_assets_tests
      Start 88: script_tests
      Start 84: script_p2sh_tests
      Start 86: script_segwit_tests
      Start 87: script_standard_tests
      Start 85: script_parse_tests
  1/6 Test #85: script_parse_tests ...............   Passed    0.11 sec
  2/6 Test #83: script_assets_tests ..............***Skipped   0.12 sec
  3/6 Test #86: script_segwit_tests ..............   Passed    0.11 sec
  4/6 Test #87: script_standard_tests ............   Passed    0.11 sec
  5/6 Test #84: script_p2sh_tests ................   Passed    0.12 sec
  6/6 Test #88: script_tests .....................   Passed    0.36 sec

  100% tests passed, 0 tests failed out of 6

  Total Test time (real) =   0.37 sec

  The following tests did not run:
   83 - script_assets_tests (Skipped)
  $ env DIR_UNIT_TEST_DATA=/home/hebasto/git/bitcoin/qa-assets/unit_test_data ctest --test-dir build -j 16 -R "^script_"
  Internal ctest changing into directory: /home/hebasto/git/bitcoin/build
  Test project /home/hebasto/git/bitcoin/build
      Start 83: script_assets_tests
      Start 88: script_tests
      Start 84: script_p2sh_tests
      Start 86: script_segwit_tests
      Start 87: script_standard_tests
      Start 85: script_parse_tests
  1/6 Test #85: script_parse_tests ...............   Passed    0.11 sec
  2/6 Test #87: script_standard_tests ............   Passed    0.11 sec
  3/6 Test #86: script_segwit_tests ..............   Passed    0.11 sec
  4/6 Test #84: script_p2sh_tests ................   Passed    0.12 sec
  5/6 Test #88: script_tests .....................   Passed    0.35 sec
  6/6 Test #83: script_assets_tests ..............   Passed    1.58 sec

  100% tests passed, 0 tests failed out of 6

  Total Test time (real) =   1.58 sec
  ```

ACKs for top commit:
  maflcko:
    re-ACK c40dbbb 👈
  ajtowns:
    ACK c40dbbb
  achow101:
    ACK c40dbbb

Tree-SHA512: 25713e1c3b507b6f2a5fecc7b1ea285a6642b906c248769238a58fc0df48489ac5f7606778f9e3653b407b7f1d06563e1554d04321303b350c80eb888500cc5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants