Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
cc: "gcc-9", cxx: "g++-9",
glibc_version: "2_31",
cmake_generator: '-G "Ninja"',
build_type: RelWithDebInfo,
cmake_flags: '"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O1 -g -DNDEBUG"'
build_type: RelWithDebInfo
}

steps:
Expand Down Expand Up @@ -83,7 +82,6 @@ jobs:
-B build
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
${{ matrix.config.cmake_generator }}
${{ matrix.config.cmake_flags }}

# It is preferable to do a clean build to ensure all object files are
# deleted and then rebuilt from scratch, which can help resolve
Expand All @@ -94,7 +92,7 @@ jobs:
--build build
--clean-first
--config ${{ matrix.config.build_type }}
-j 2
-j ${{ steps.cpu-cores.outputs.count }}

# The generated source in git must match the output of workflow builds.
# If this step fails, something is changing during build. Either:
Expand Down
3 changes: 3 additions & 0 deletions generated/nidaqmx/nidaqmx_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#include <server/callback_router.h>
#include <server/server_reactor.h>
#include "nidaqmx_library.h"
#ifdef __GNUC__
#pragma GCC optimize("-fno-var-tracking-assignments")
#endif
#include <server/data_moniker_service.h>

namespace nidaqmx_grpc {
Expand Down
3 changes: 3 additions & 0 deletions source/codegen/templates/service.cpp.mako
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, which file is causing the problem? service.cpp or library.cpp? I thought you said it was library.cpp.

Copy link
Contributor Author

@mikeprosserni mikeprosserni Oct 22, 2025

Choose a reason for hiding this comment

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

nidaqmx_library.cpp was the problem. Although the changes made in service.cpp.mako seems to have fixed it: https://github.com/ni/grpc-device/actions/runs/18724889717/job/53406944072?pr=1203

[2600/3669] Building CXX object CMakeFiles/IntegrationTestsRunner.dir/proto/data_moniker.grpc.pb.cc.o
[2601/3669] Building CXX object CMakeFiles/IntegrationTestsRunner.dir/generated/nidaqmx/nidaqmx_library.cpp.o
[2602/3669] Building CXX object CMakeFiles/IntegrationTestsRunner.dir/generated/nidaqmx/nidaqmx_service_registrar.cpp.o

Copy link
Contributor Author

@mikeprosserni mikeprosserni Oct 22, 2025

Choose a reason for hiding this comment

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

In my other PR, I'm trying out those changes in library.cpp.mako instead of service.cpp.mako: https://github.com/ni/grpc-device/pull/1205/files#diff-0cb12eeb765640c93fc98cdc6777d834a23c8042f953a4e41186bc87b72fa252

https://github.com/ni/grpc-device/actions/runs/18726362277/job/53412058096?pr=1205

(note, this did not work, the build failed)

Copy link
Contributor

@bkeryan bkeryan Oct 22, 2025

Choose a reason for hiding this comment

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

That's weird. NiDAQmxLibrary::NiDAQmxLibrary(std::shared_ptr<nidevice_grpc::SharedLibraryInterface> shared_library) is only called from NiDAQmxLibrary::NiDAQmxLibrary() and doesn't seem to be inlined in the v2.13.0 release binaries.

That said, the build time increased by 20 minutes, so I think there may be multiple problem files. nidaqmx_library.cpp may have been the one that pushed the GitHub-hosted runner over the edge and made it run out of memory, but other files may be taking several more minutes than before.

If disabling VTA fixes the build, then I think it's worth seeing what happens when you disable VTA globally instead of per-file.

Copy link
Contributor

Choose a reason for hiding this comment

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

That said, the build time increased by 20 minutes, so I think there may be multiple problem files. nidaqmx_library.cpp may have been the one that pushed the GitHub-hosted runner over the edge and made it run out of memory, but other files may be taking several more minutes than before.

Oops, I was looking at the -j 2 change. Yeah, that's going to slow down the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I still try disabling VTA globally?

Copy link
Contributor Author

@mikeprosserni mikeprosserni Oct 22, 2025

Choose a reason for hiding this comment

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

Ok, I've updated this PR to disable VTA globally. (since the changes with push/pop didn't work)

I reverted all other build changes, and added this to CMakeLists.txt:

# GCC-specific flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-var-tracking-assignments")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-var-tracking-assignments")
endif()

(Note: This worked, the Ubuntu build succeeded after 66 minutes)

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ resource_repository_deps = service_helpers.get_driver_shared_resource_repository
% endif
% if any_non_mockable_functions:
#include "${module_name}_library.h"
#ifdef __GNUC__
#pragma GCC optimize("-fno-var-tracking-assignments")
#endif
% endif
% if streaming_functions_to_generate:
#include <server/data_moniker_service.h>
Expand Down
Loading