Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 26, 2025

This PR implements comprehensive cross-platform build automation that automatically compiles and packages the ulog library for multiple architectures whenever a new tag is created.

Problem Addressed

The repository lacked automated builds for different architectures, requiring manual compilation for users targeting ARM devices or different platforms. This created a barrier for adoption on embedded systems and cross-platform development.

Solution

Added a GitHub Actions workflow (.github/workflows/release.yml) that:

  • Triggers automatically on any tag push matching v* pattern
  • Builds for 3 architectures:
    • linux-x64: Native x86_64 build with full examples and tools
    • linux-arm64: Cross-compiled ARM64/AArch64 build (library only)
    • linux-arm32: Cross-compiled ARM32 build (library only)
  • Creates release packages containing static libraries, headers, and documentation
  • Uploads all packages to a single GitHub release automatically

Key Features

Architecture Verification

Each build produces correctly targeted binaries:

# ARM32 output
ulog.c.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV)

# ARM64 output  
ulog.c.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV)

# x64 output
ulog.c.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV)

Smart Cross-compilation

  • Uses standard Ubuntu cross-compilation toolchains (gcc-aarch64-linux-gnu, gcc-arm-linux-gnueabihf)
  • Disables examples/tools for ARM builds to avoid linker compatibility issues
  • Includes full examples and tools only in the x64 package

Package Contents

Each release includes:

  • Static library (libulog.a) for the target architecture
  • Complete header files for development
  • Platform-specific README with usage instructions
  • Examples and tools (x64 package only)

Usage

Developers can now simply:

  1. Create a tag: git tag v1.0.0 && git push origin v1.0.0
  2. Download the appropriate package from the GitHub releases page
  3. Link against the pre-built library: gcc -I./include your_program.c -L./lib -lulog

Testing

The implementation has been thoroughly tested with:

  • Local cross-compilation verification for all architectures
  • Complete workflow simulation producing correct packages
  • Binary architecture verification using file and objdump
  • Package content validation

Documentation

Added CROSS_PLATFORM_BUILDS.md with comprehensive documentation covering:

  • Supported platforms and usage instructions
  • Troubleshooting guide for common issues
  • Technical details about cross-compilation approach
  • Package contents and structure

This automation significantly reduces the barrier to adoption for embedded developers and ensures consistent, reliable builds across all supported architectures.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits July 26, 2025 06:34
Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
…ary files

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
@shawnfeng0 shawnfeng0 changed the title [WIP] 帮我在每个tag的版本上自动编译打包一个x64和arm32, arm64平台的包 [WIP] 在每个tag的版本上自动编译打包一个x64和arm32, arm64平台的包 Jul 26, 2025
Copilot AI changed the title [WIP] 在每个tag的版本上自动编译打包一个x64和arm32, arm64平台的包 Add automated cross-platform builds for x64, ARM32, and ARM64 on tag releases Jul 26, 2025
Copilot AI requested a review from shawnfeng0 July 26, 2025 06:42
Copilot finished work on behalf of shawnfeng0 July 26, 2025 06:42
@shawnfeng0
Copy link
Owner

shawnfeng0 commented Jul 26, 2025

All platforms need to compile the logroller binary file as well.

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 26, 2025

所有的平台都需要把logroller的bin文件也编译出来

Done! I've updated the workflow to enable logroller compilation for all platforms including ARM64 and ARM32. The changes in commit 351d675 enable build_tools: "ON" for both ARM platforms and update the documentation to reflect that all packages now include the logroller binary.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of shawnfeng0 July 26, 2025 07:01
@shawnfeng0 shawnfeng0 marked this pull request as ready for review July 26, 2025 11:50
@shawnfeng0 shawnfeng0 merged commit a70ecdd into main Jul 26, 2025
4 checks passed
@shawnfeng0 shawnfeng0 deleted the copilot/fix-d95c445a-a196-4235-913a-15c7cad9823c branch July 26, 2025 13:43
shawnfeng0 added a commit that referenced this pull request Jul 27, 2025
…releases (#3)

* Initial plan

* Add cross-platform release workflow for tags

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Update cross-platform workflow with architecture fixes and remove binary files

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Add comprehensive documentation for cross-platform builds

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Enable logroller compilation for all platforms including ARM64 and ARM32

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
shawnfeng0 added a commit that referenced this pull request Jul 27, 2025
…releases (#3)

* Initial plan

* Add cross-platform release workflow for tags

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Update cross-platform workflow with architecture fixes and remove binary files

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Add comprehensive documentation for cross-platform builds

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Enable logroller compilation for all platforms including ARM64 and ARM32

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
shawnfeng0 added a commit that referenced this pull request Jul 27, 2025
…releases (#3)

* Initial plan

* Add cross-platform release workflow for tags

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Update cross-platform workflow with architecture fixes and remove binary files

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Add comprehensive documentation for cross-platform builds

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

* Enable logroller compilation for all platforms including ARM64 and ARM32

Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shawnfeng0 <23150404+shawnfeng0@users.noreply.github.com>
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.

2 participants