grpc-labview icon indicating copy to clipboard operation
grpc-labview copied to clipboard

Update VIPB Versioning

Open Faraclas opened this issue 2 months ago • 0 comments

Purpose:

  • Previously the VIPM package versioning was maintained exclusively inside the .vipb files
  • The version was updated only via the workflows:
    • build_release_artifacts:
      • (81) run: python ${{runner.workspace}}\grpc-labview\build-it\build.py --libraryVersion ${{github.ref_name}} --target All --pathToBinaries ${{ runner.temp }}\grpc-labview-staged-artifacts\TopLevelDlls
      • passing --libraryVersion to build.py triggers a version bump.
    • update_vipb_on_publish_release : called helper python functions to edit and save the VIPB files
  • This causes comes issues on a few fronts:
    • Heuristically, .vipb files are build specs , the versioning should be done outside of the individual spec files (that what the git tag is for)
    • VIPM can have issues related to its cache and certain versions. Should this happen, there is no way for developers to work-around the issue other than modifying the VIPB files.
    • Multiple files can be time consuming to edit and does not scale compared to a single source of truth.

The solution is to move versioning from being directly implemented in all of the vipb files and into an intermediate VERSION file.

Changes Made:

Workflows

  • update_vipb_on_publish_release: this was left in the repo but disabled (line 10)
  • This workflow is replaced with update_version_on_publish_release
    • This workflow started as a direct copy from the one it is replacing.
    • Calls its new helper update_version.py (which logically replaces the update_vipb_version.py helper)
  • Triggers exactly the same as it did before and takes the version from the git tag just like it did before

Added docs/Workflows.md to provide an overview of what all of the workflows are doing.

VERSION

  • Versioning is now controlled by build-it/VERSION
  • By default, build.py will read the version in this file and apply it to the packages it builds via updating the vipb files during the build

build.py

  • Lines 25-30 provide comments describing how build.py handles versioning

    # Notes on how the --libraryVersion and --lib-version args are used:
    # --libraryVersion is used to update the vipb files before building the vipkgs
    #   --libraryVersion will be null when we are building vipbs for Pull Requests/Testing
    # If --libraryVersion is provided, we will first update the VERSION file with that value
    # --lib-version is provided as a way for testing to set the version in the vipb files without updating the VERSION file
    # It seems there is some duplication in how the version is handled, but this is to maintain compatibility with existing build and test processes

LabVIEW Project

  • The labview project now takes in the version as a command line parameter and passes this to the VIPB files via the JKI provided API

Issues:

  • On my development system, the build will not pass using the current version.
  • I am hoping that its just my system and that the CI will be ok. If not, changes will need to be made to accommodate the CI
    • Most likely this would include another version bump (example 1.6.1.1 --> 1.6.1.2)

Testing: Follow along in my command line for the testing

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> cat .\build-it\VERSION version=1.6.1.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # Test 1 Build without entering any version information. C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # This should use the version in VERSION C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> python .\build-it\build.py --target Win64 Using LabVIEW at C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe on port 3366 to build vipkgs LabVIEWCLI started logging in file: C:\Users\Elias Faraclas\AppData\Local\Temp\lvtemporary_508938.log Using LabVIEW: "C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe" Connection established with LabVIEW at port number 3366.

Operation output: LabVIEW closed successfully. CloseLabVIEW operation succeeded.

Traceback (most recent call last): File "C:\dev2\grpc-labview\build-it\build.py", line 285, in main() File "C:\dev2\grpc-labview\build-it\build.py", line 282, in main gRPCPackageBuilder.build(args) File "C:\dev2\grpc-labview\build-it\build.py", line 225, in build raise Exception(f"Failed to Build vipkgs {build_vipkgs.stderr.decode()}") Exception: Failed to Build vipkgs Operation output: VIPM API_vipm_api.lvlib:Check Package Array Input_vipm_api.vi<ERR> The Package Names array input is empty. Please specify at least 1 package by name.

Complete call chain: VIPM API_vipm_api.lvlib:Check Package Array Input_vipm_api.vi VIPM API_vipm_api.lvlib:Install VI Packages by Name_vipm_api.vi InstallVIPMPackage.vi:5630001 BuildGRPCPackages.vi RunVI.lvclass:RunOperation.vi:5910001 CoreOperation.lvclass:CallRunOperation.vi:4230002 ExecuteRunOperation.vi:5250001 ExecuteOperation.vi:6900002 ExecuteOperation.vi.ProxyCaller RunVI operation failed.

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~1 -0 !]> # Test 1 Fails (on this dev system) as 1.6.1.1 is already a released version C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~1 -0 !]> # The only file that should be changed is the first ,vipb file, which failed to build C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~1 -0 !]> git status On branch grpc/update-vipb-versioning Your branch is ahead of 'origin/grpc/update-vipb-versioning' by 2 commits. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: labview source/gRPC lv Support/build spec/LabVIEW gRPC Library.vipb

no changes added to commit (use "git add" and/or "git commit -a") C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~1 -0 !]> cat .\build-it\VERSION version=1.6.1.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~1 -0 !]> git restore .

Test 1 Fails with released version

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # Test 2. Repeat using all the defaults but set to testing lib version 1.6.1.2 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> python .\build-it\build.py --target Win64 --lib-version v1.6.1.2 Using LabVIEW at C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe on port 3366 to build vipkgs LabVIEWCLI started logging in file: C:\Users\Elias Faraclas\AppData\Local\Temp\lvtemporary_526391.log Using LabVIEW: "C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe" Connection established with LabVIEW at port number 3366.

Operation output: LabVIEW closed successfully. CloseLabVIEW operation succeeded.

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> # All 3 .vipb files should have changed and the VERSION should be unchanged C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> git status On branch grpc/update-vipb-versioning Your branch is ahead of 'origin/grpc/update-vipb-versioning' by 2 commits. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: labview source/Client Server Support New/build spec/gRPC Server and Client Template [2].vipb modified: labview source/gRPC lv Servicer/build spec/LabVIEW gRPC Servicer.vipb modified: labview source/gRPC lv Support/build spec/LabVIEW gRPC Library.vipb

no changes added to commit (use "git add" and/or "git commit -a") C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> cat .\build-it\VERSION version=1.6.1.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> git restore .

Test 2 passes with testing version

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # Test 3. Repeat test 2 but use a different LabVIEW version. Using LabVIEW at C:\Program Files\National Instruments\LabVIEW 2023\LabVIEW.exe on port 3363 to build vipkgsersion 2023 --labview-bits 64 --lib-version v1.6.1.2 LabVIEWCLI started logging in file: C:\Users\Elias Faraclas\AppData\Local\Temp\lvtemporary_951221.log Using LabVIEW: "C:\Program Files\National Instruments\LabVIEW 2023\LabVIEW.exe" Connection established with LabVIEW at port number 3363.

Operation output: LabVIEW closed successfully. CloseLabVIEW operation succeeded.

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> # <-- those the files that changes are the 3 VIPB we expect. I will restore them after checking the VERSION C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> cat .\build-it\VERSION version=1.6.1.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~3 -0 !]> git restore .

Test 3 passes with testing version lv2023

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # Test 4. Now emulate initiating a version bump which is the only time --libraryVersion gets used. C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> # We also expect the VERSION file to bump here as well C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]> python .\build-it\build.py --target Win64 --libraryVersion v1.6.2.1 Using LabVIEW at C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe on port 3366 to build vipkgs LabVIEWCLI started logging in file: C:\Users\Elias Faraclas\AppData\Local\Temp\lvtemporary_410613.log Using LabVIEW: "C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe" Connection established with LabVIEW at port number 3366.

Operation output: LabVIEW closed successfully. CloseLabVIEW operation succeeded.

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> # <--- 4 changed filess this time. One of them should be version updated to 1.6.2.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> git status On branch grpc/update-vipb-versioning Your branch is ahead of 'origin/grpc/update-vipb-versioning' by 2 commits. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: build-it/VERSION modified: labview source/Client Server Support New/build spec/gRPC Server and Client Template [2].vipb modified: labview source/gRPC lv Servicer/build spec/LabVIEW gRPC Servicer.vipb modified: labview source/gRPC lv Support/build spec/LabVIEW gRPC Library.vipb

no changes added to commit (use "git add" and/or "git commit -a") C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> cat .\build-it\VERSION version=v1.6.2.1 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> # Note the v here. This is OK. Bumping the VIPB version takes its version from the git tag C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> # The git tag is in the form v1.2.3.4 , versions without the v will also work (as shown above) C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> # Still, this may cause some issues so I will fix the writing of VERSION to remove the v C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2 +0 ~4 -0 !]> git restore . C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑2]>

Test 4 passes

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑3]> # Test 5 Repeat 4 with a new version and check VERSION for no v C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4]> # Repeat Test 5 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4]> python .\build-it\build.py --target Win64 --libraryVersion v1.6.2.2 Using LabVIEW at C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe on port 3366 to build vipkgs LabVIEWCLI started logging in file: C:\Users\Elias Faraclas\AppData\Local\Temp\lvtemporary_224535.log Using LabVIEW: "C:\Program Files (x86)\National Instruments\LabVIEW 2019\LabVIEW.exe" Connection established with LabVIEW at port number 3366.

Operation output: LabVIEW closed successfully. CloseLabVIEW operation succeeded.

C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4 +0 ~4 -0 !]> # <<---- 4 files changed as expected. Lets see if VERSION got saved without the 'v' this time C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4 +0 ~4 -0 !]> cat .\build-it\VERSION version=1.6.2.2 C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4 +0 ~4 -0 !]> git status On branch grpc/update-vipb-versioning Your branch is ahead of 'origin/grpc/update-vipb-versioning' by 4 commits. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: build-it/VERSION modified: labview source/Client Server Support New/build spec/gRPC Server and Client Template [2].vipb modified: labview source/gRPC lv Servicer/build spec/LabVIEW gRPC Servicer.vipb modified: labview source/gRPC lv Support/build spec/LabVIEW gRPC Library.vipb

no changes added to commit (use "git add" and/or "git commit -a") C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4 +0 ~4 -0 !]> git restore . C:\dev2\grpc-labview [grpc/update-vipb-versioning ↑4]> # Looks good. Time to PR this.

Test 5 Also passes

Faraclas avatar Dec 17 '25 21:12 Faraclas