profile
viewpoint

qartis/translink 4

Some source files related to translink magnetic tickets

qartis/attack 2

when resistors attack

qartis/gdb-challenges 2

a collection of small challenge programs to practise reverse-engineering techniques

qartis/templat 2

a basic html templating engine for c

qartis/avrfbus 1

An AVR-based GPS/GSM tracker

qartis/c5gui 1

A graphical c5 client

qartis/cgiadmin 1

A simple admin panel for a website, written in c

qartis/dori 1

Distributed Outdoor Robotic Instruments

qartis/eagle 1

eagle libraries

qartis/flatland-zh 1

A typeset chinese translation of Flatland (1884)

issue openedgoogle/cpu_features

Python bindings

This is not an issue as such. Just wrote python bindings for this library. Thanks for this awesome repo!

https://github.com/Narasimha1997/py_cpu

created time in 8 hours

startedmattvenn/logo-to-gds2

started time in 21 hours

startedhi5/CSV

started time in 20 days

startedLNIS-Projects/skywater-openfpga

started time in 22 days

issue commentgoogle/cpu_features

ECCN for cpu_features

I'm not an expert, I think cpu_features is NOT on the Commerce Control List (CCL) so maybe, you could use EAR99, but you should ask to a lawyer instead.

ref: https://www.bis.doc.gov/index.php/licensing/commerce-control-list-classification/export-control-classification-number-eccn https://www.bis.doc.gov/index.php/documents/regulations-docs/13-commerce-control-list-index/file

shridhargowda100

comment created time in 24 days

issue openedgoogle/cpu_features

ECCN for cpu_features

Hi, For documentation purpose and project release process we need the Export control classification number(ECCN) for cpu_features if it applies. Can you please let me know the ECCN ?

created time in 24 days

startedpeterbjornx/patchtools_pub

started time in a month

pull request commentgoogle/cpu_features

Add GitHub CI jobs

runners specification: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners

Mizux

comment created time in a month

pull request commentgoogle/cpu_features

Add GitHub CI jobs

Comparing Travis-CI and GitHUb actions trace, travis-ci has already install qemu so worker didn't try to rebuild it while on github action it failed while building it

ref: for aarch64

  • https://pipelines.actions.githubusercontent.com/4PhP80PVRjrauHWV4V3uBqw0G4ZPm73uB9cHYNNdgtJUVMnFvh/_apis/pipelines/1/runs/51/signedlogcontent/4?urlExpires=2020-10-27T12%3A17%3A07.8850850Z&urlSigningMethod=HMACV1&urlSignature=TYNT9UYO8VkHkqHJTxKxCcjOnNn5Lnxx%2Bwg18gjic28%3D
  • https://api.travis-ci.org/v3/job/739264181/log.txt

travis trace

...
+[[ -n aarch64 ]]
+installqemuifneeded
+local VERSION=2.11.1
+local ARCHES=aarch64
++echo aarch64
++sed 's#$# #;s#\([^ ]*\) #\1-linux-user #g'
+local 'TARGETS=aarch64-linux-user '
+echo '2.11.1 aarch64-linux-user '
+cmp --silent /home/travis/cpu_features_archives/qemu/.build -
+echo 'qemu 2.11.1 up to date!'
qemu 2.11.1 up to date!

githubtrace

...
2020-10-27T11:50:19.3438647Z + [[ -n aarch64 ]]
2020-10-27T11:50:19.3439307Z + installqemuifneeded
2020-10-27T11:50:19.3439995Z + local VERSION=2.11.1
2020-10-27T11:50:19.3440542Z + local ARCHES=aarch64
2020-10-27T11:50:19.3441084Z ++ echo aarch64
2020-10-27T11:50:19.3441954Z ++ sed 's#$# #;s#\([^ ]*\) #\1-linux-user #g'
2020-10-27T11:50:19.3442993Z + local 'TARGETS=aarch64-linux-user '
2020-10-27T11:50:19.3444694Z + cmp --silent /home/runner/cpu_features_archives/qemu/.build -
2020-10-27T11:50:19.3445919Z + echo '2.11.1 aarch64-linux-user '
2020-10-27T11:50:19.3446827Z + echo 'VERSION: 2.11.1'
2020-10-27T11:50:19.3447798Z + echo 'TARGETS: aarch64-linux-user '
2020-10-27T11:50:19.3448939Z + rm -rf /home/runner/cpu_features_archives/qemu
2020-10-27T11:50:19.3450604Z + local QEMU_URL=http://wiki.qemu-project.org/download/qemu-2.11.1.tar.xz
2020-10-27T11:50:19.3452109Z + local QEMU_FOLDER=qemu-2.11.1
2020-10-27T11:50:19.3453871Z + unpackifnotexists http://wiki.qemu-project.org/download/qemu-2.11.1.tar.xz qemu-2.11.1
2020-10-27T11:50:19.3455623Z + mkdir -p /home/runner/cpu_features_archives
.... // few dozen of lines
2020-10-27T11:51:00.1323858Z   CC      util/memfd.o
2020-10-27T11:51:00.3591803Z util/memfd.c:40:12: error: static declaration of ‘memfd_create’ follows non-static declaration
2020-10-27T11:51:00.3593049Z  static int memfd_create(const char *name, unsigned int flags)
2020-10-27T11:51:00.3594150Z             ^~~~~~~~~~~~
2020-10-27T11:51:00.3636699Z In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:115:0,
2020-10-27T11:51:00.3638002Z                  from /usr/include/x86_64-linux-gnu/bits/mman.h:45,
2020-10-27T11:51:00.3638932Z                  from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
2020-10-27T11:51:00.3639998Z                  from /home/runner/cpu_features_archives/qemu-2.11.1/include/sysemu/os-posix.h:29,
2020-10-27T11:51:00.3641197Z                  from /home/runner/cpu_features_archives/qemu-2.11.1/include/qemu/osdep.h:104,
2020-10-27T11:51:00.3641922Z                  from util/memfd.c:28:
2020-10-27T11:51:00.3643357Z /usr/include/x86_64-linux-gnu/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
2020-10-27T11:51:00.3644164Z  int memfd_create (const char *__name, unsigned int __flags) __THROW;
2020-10-27T11:51:00.3644580Z      ^~~~~~~~~~~~
2020-10-27T11:51:00.3727183Z make: *** [util/memfd.o] Error 1
2020-10-27T11:51:00.3728405Z /home/runner/cpu_features_archives/qemu-2.11.1/rules.mak:66: recipe for target 'util/memfd.o' failed
2020-10-27T11:51:00.3729130Z make: *** Waiting for unfinished jobs....
2020-10-27T11:51:00.9876714Z ##[error]Process completed with exit code 2.
2020-10-27T11:51:00.9959391Z Post job cleanup.
2020-10-27T11:51:01.1096020Z [command]/usr/bin/git version
2020-10-27T11:51:01.1163505Z git version 2.28.0
2020-10-27T11:51:01.1201327Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2020-10-27T11:51:01.1246405Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2020-10-27T11:51:01.1551615Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-10-27T11:51:01.1592216Z http.https://github.com/.extraheader
2020-10-27T11:51:01.1602393Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-10-27T11:51:01.1648172Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2020-10-27T11:51:01.2010194Z Cleaning up orphan processes
Mizux

comment created time in a month

PR opened google/cpu_features

Add GitHub CI jobs

Send it, to avoid to forget it

Few notes:

  • I also remove the option ENABLE_TESTING so instead it will use the default value provided by CTest module with in ON. I would say for CMake user it is more common to use -DENABLE_TESTING=OFF than the opposite. Feel free to remove it.

  • ARM and MIPS jobs fails not sure it is a runner problems (i.e. maybe there are a real bug but since Travis-CI use cache you didn't catch it long time ago) note: note sure using cache is a really good idea for a such small project (from a compile time point of view ;)), small speedup at the cost of missing some bugs ?

+91 -3

0 comment

4 changed files

pr created time in a month

issue commentgoogle/cpu_features

Prefer CMAKE_POSITION_INDEPENDENT_CODE over BUILD_PIC

was on my todo list, forget about it.

BTW thanks for the feedback !

mablanchard

comment created time in a month

issue openedgoogle/cpu_features

Prefer CMAKE_POSITION_INDEPENDENT_CODE over BUILD_PIC

Would be nice to use the standard CMAKE_POSITION_INDEPENDENT_CODE CMake build configuration variable over the custom BUILD_PIC for position independent code generation.

created time in a month

startedwhitequark/groupXIV

started time in a month

delete branch google/cpu_features

delete branch : provide_release_script

delete time in a month

push eventgoogle/cpu_features

Guillaume Chatelet

commit sha 6d0767e0d9269919452dfa20a326cb4a6529171a

Provides a release script (#142) Fixes #141

view details

push time in a month

PR merged google/cpu_features

Provides a release script

Fixes #141

+72 -0

0 comment

1 changed file

gchatelet

pr closed time in a month

issue closedgoogle/cpu_features

CMake: version management

Currently the version is hard coded directly in CMakeLists.txt, e.g.: https://github.com/google/cpu_features/blob/a8397ba4591237c17d18e4acc091f5f3ebe7391e/CMakeLists.txt#L9

So each time a new release is pushed, using the github release interface, you must do the sync manually with the CMakeLists.txt

We should instead try to generate it from the last git tag (and fallback to 9.9.9 or 9999 like gentoo) IMHO

Proposal

A small proposal (not tested!!!)

CMakeLists.txt:

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(utils)
set_version(VERSION)
project(CpuFeatures VERSION ${VERSION} LANGUAGES C)

cmake/utils.cmake:

function(get_version_from_git_tag GIT_VERSION)
  find_package(Git QUIET)
  if(NOT GIT_FOUND)
    message(STATUS "Did not find git package.")
    set(VERSION 9.9.9)
  else()
    # If no tags can be found, it is a git shallow clone
    execute_process(COMMAND
      ${GIT_EXECUTABLE} describe --tags
      RESULT_VARIABLE _OUTPUT_VAR
      OUTPUT_VARIABLE FULL
      ERROR_QUIET
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
    if(NOT _OUTPUT_VAR)
      set(VERSION "${RESULT_VARIABLE}")
    else()
      message(STATUS "Did not find any tag.")
      set(VERSION "9.9.9")
    endif()
  endif()
  set(${GIT_VERSION} "${VERSION}" PARENT_SCOPE)
endfunction()

function(set_version VERSION)
  # Retrieve version from git tag if .git is present otherwise set it to 9.9.9
  get_filename_component(GIT_DIR ".git" ABSOLUTE)
  if(EXISTS ${GIT_DIR})
    get_version_from_git_tag(GIT_VERSION)
  else()
    # If not a git repo force version to 9.9.9
    set(GIT_VERSION "9.9.9")
  endif()
  set(${VERSION} "${GIT_VERSION}" PARENT_SCOPE)
endfunction()

ref: Gentoo 9999 ebuild https://forums.gentoo.org/viewtopic-p-7428490.html

closed time in a month

Mizux

push eventgoogle/cpu_features

Guillaume Chatelet

commit sha bf69232e7a60666ac41b7da92dcba8f99f1e4563

Fix shebang, bash error mode and remove unused variable

view details

push time in a month

Pull request review commentgoogle/cpu_features

Provides a release script

+#!/bin/bash++set -e # Fail on error++ACTION='\033[1;90m'+FINISHED='\033[1;96m'+READY='\033[1;92m'+NOCOLOR='\033[0m'+ERROR='\033[0;31m'++echo -e "${ACTION}Checking environnement${NOCOLOR}"+if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]

Let's keep it simple for now and improve if we feel it's needed.

gchatelet

comment created time in a month

Pull request review commentgoogle/cpu_features

Provides a release script

+#!/bin/bash

note: #!/usr/bin/env bash is more portable IMHO ref: https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html

gchatelet

comment created time in a month

Pull request review commentgoogle/cpu_features

Provides a release script

+#!/bin/bash++set -e # Fail on error++ACTION='\033[1;90m'+FINISHED='\033[1;96m'+READY='\033[1;92m'+NOCOLOR='\033[0m'+ERROR='\033[0;31m'++echo -e "${ACTION}Checking environnement${NOCOLOR}"+if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]

should we use full sem ver regex ? (overkill IMHO) https://semver.org/ (bottom) https://regex101.com/r/Ly7O1x/3/

note: CMake also allow a "tweak" field https://cmake.org/cmake/help/latest/command/project.html#options note: I've never use it, but sometine it is use when you just want to bump a dependency/compiler config but your source code is not touched, not sure it is releavant for cpu_features

gchatelet

comment created time in a month

Pull request review commentgoogle/cpu_features

Provides a release script

+#!/bin/bash++set -e # Fail on error

-u Treat unset variables and parameters other than the special parameters "@" and "*" as an error when performing parameter expansion.

gchatelet

comment created time in a month

push eventgoogle/cpu_features

Guillaume Chatelet

commit sha 85e26ab23ddedb7da5cbd7bc1db6a890d67081ef

Change copy/pasted action name.

view details

push time in a month

PR opened google/cpu_features

Provides a release script

Fixes #141

+72 -0

0 comment

1 changed file

pr created time in a month

create barnchgoogle/cpu_features

branch : provide_release_script

created branch time in a month

issue commentgoogle/cpu_features

CMake: version management

As per our off line discussion let's create a simple bash script that will take care of the release process (version bump, tag, github release and release notes)

Mizux

comment created time in a month

issue commentgoogle/cpu_features

CMake: version management

for package maintainers using a git clone with the tag, it should work.

Now the bad news, for archive based build, you'll end up with the fallback i.e. the wrong version name...

Mizux

comment created time in a month

issue commentgoogle/cpu_features

CMake: version management

Thanks for the proposal! How does this interact with installation? Does it put a burden on package maintainers?

Mizux

comment created time in a month

issue openedgoogle/cpu_features

CMake: version management

Currently the version is hard coded directly in CMakeLists.txt, e.g.: https://github.com/google/cpu_features/blob/a8397ba4591237c17d18e4acc091f5f3ebe7391e/CMakeLists.txt#L9

So each time a new release is pushed, using the github release interface, you must do the sync manually with the CMakeLists.txt

We should instead try to generate it from the last git tag (and fallback to 9999 like gentoo) IMHO

Proposal

A small proposal (not tested!!!)

CMakeLists.txt:

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(utils)
set_version(VERSION)
project(CpuFeatures VERSION ${VERSION} LANGUAGES C)

cmake/utils.cmake:

function(get_version_from_git GIT_VERSION)
  find_package(Git QUIET)
  if(NOT GIT_FOUND)
    message(STATUS "Did not find git package.")
    set(VERSION 9.9.9)
  else()
    # If no tags can be found, it is a git shallow clone
    execute_process(COMMAND
      ${GIT_EXECUTABLE} describe --tags
      RESULT_VARIABLE _OUTPUT_VAR
      OUTPUT_VARIABLE FULL
      ERROR_QUIET
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
    if(NOT _OUTPUT_VAR)
      set(VERSION "${RESULT_VARIABLE}")
    else()
      message(STATUS "Did not find any tag.")
      set(VERSION "9.9.9")
    endif()
  endif()
  set(${GIT_VERSION} "${VERSION}" PARENT_SCOPE)
endfunction()

function(set_version VERSION)
  # Retrieve version from git tag if .git is present otherwise set it to 9.9.9
  get_filename_component(GIT_DIR ".git" ABSOLUTE)
  if(EXISTS ${GIT_DIR})
    get_version_from_git(GIT_VERSION)
  else()
    # If not a git repo force version to 9.9.9
    set(GIT_VERSION "9.9.9")
  endif()
  set(${VERSION} "${GIT_VERSION}" PARENT_SCOPE)
endfunction()

ref: Gentoo 9999 ebuild https://forums.gentoo.org/viewtopic-p-7428490.html

created time in a month

created taggoogle/cpu_features

tagv0.6.0

A cross platform C99 library to get cpu features at runtime.

created time in a month

more