Skip to content

Commit

Permalink
Add steps for generating binaries from mini go app
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <[email protected]>
  • Loading branch information
TG1999 committed Feb 16, 2024
1 parent a3530fb commit 27f9e8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 57 deletions.
68 changes: 11 additions & 57 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,62 +1,16 @@
A Simple Python Project Skeleton
Go-Inspector
================================
This repo attempts to standardize the structure of the Python-based project's
repositories using modern Python packaging and configuration techniques.
Using this `blog post`_ as inspiration, this repository serves as the base for
all new Python projects and is mergeable in existing repositories as well.

.. _blog post: https://blog.jaraco.com/a-project-skeleton-for-python-projects/
- To enable the GoReSym plugin, first you need to install goresym from https://github.com/mandiant/GoReSym/releases/download/v2.6.4/GoReSym.zip
- Unzip the GoReSym.zip, extract goresym for linux and add it in src/go_inspector/bin.
- then change it to executable ```chmod u+x src/go_inspector/bin/GoReSym_lin```
- Install requirements and dependencies using ```make dev```
- Use ```scancode --json-pp - --go-symbol <PATH> --verbose``` to get debug symbols.


Usage
=====
How to generate test binaries
============================

A brand new project
-------------------
.. code-block:: bash
git init my-new-repo
cd my-new-repo
git pull [email protected]:nexB/skeleton
# Create the new repo on GitHub, then update your remote
git remote set-url origin [email protected]:nexB/your-new-repo.git
From here, you can make the appropriate changes to the files for your specific project.

Update an existing project
---------------------------
.. code-block:: bash
cd my-existing-project
git remote add skeleton [email protected]:nexB/skeleton
git fetch skeleton
git merge skeleton/main --allow-unrelated-histories
This is also the workflow to use when updating the skeleton files in any given repository.

More usage instructions can be found in ``docs/skeleton-usage.rst``.


Release Notes
=============

- 2023-07-18:
- Add macOS-13 job in azure-pipelines.yml

- 2022-03-04:
- Synchronize configure and configure.bat scripts for sanity
- Update CI operating system support with latest Azure OS images
- Streamline utility scripts in etc/scripts/ to create, fetch and manage third-party dependencies
There are now fewer scripts. See etc/scripts/README.rst for details

- 2021-09-03:
- ``configure`` now requires pinned dependencies via the use of ``requirements.txt`` and ``requirements-dev.txt``
- ``configure`` can now accept multiple options at once
- Add utility scripts from scancode-toolkit/etc/release/ for use in generating project files
- Rename virtual environment directory from ``tmp`` to ``venv``
- Update README.rst with instructions for generating ``requirements.txt`` and ``requirements-dev.txt``,
as well as collecting dependencies as wheels and generating ABOUT files for them.

- 2021-05-11:
- Adopt new configure scripts from ScanCode TK that allows correct configuration of which Python version is used.
- Run `go tool dist list` to get all possible pairs of OSes and arches to compile the binary.
- Then use a OS/arch pair like this ``GOOS=<OS> GOARCH=<arch> go build -o ./tests/data/app_exe ./tests/data/main.go``
to get compiled binary.
11 changes: 11 additions & 0 deletions tests/data/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"fmt"
"path/filepath"
)

func main() {
s := filepath.Join("a", "b", "c")
fmt.Println(s)
}

0 comments on commit 27f9e8c

Please sign in to comment.