Repo with Facebook Infer dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This message is for those of you who have expressed an interest in
packaging Facebook's Infer code analysis tool.  There is now a COPR
repo available with, I think, all of the dependencies in it.  Create
~/.config/mock/fedora-rawhide-infer.cfg with these contents:

```
include('/etc/mock/fedora-rawhide-x86_64.cfg')

config_opts['root'] = 'fedora-rawhide-infer'

config_opts[f'{config_opts.package_manager}.conf'] += """

[infer]
name=Copr repo for infer owned by jjames
baseurl=https://copr-be.cloud.fedoraproject.org/results/jjames/Infer/fedora-rawhide-$basearch/
type=rpm-md
skip_if_unavailable=False
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/jjames/Infer/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
cost=10
"""
```

I've only just started figuring out how to package Infer itself.  See
the attached spec file for what I have so far.  I won't have time to
touch it again for a few days, so if any of you interested parties
want to take a stab at it, please go ahead.

Be aware that infer builds a modified version of clang, and that takes
quite awhile.  Start a build, go have dinner, come back to see what
happened. :-)  It would be interesting to determine whether any of
their modifications are critical; i.e., can we use the Fedora build of
clang?

I'll post a message on the ocaml-devel list regarding getting the
dependencies into Fedora.
-- 
Jerry James
http://www.jamezone.org/
# The latest version, 1.1.0, fails to buld.  We use a git snapshot until the
# next release.
%global commit  e0ecc32c37c6fe5af8e05b88f88da17006d321ed
%global date    20220304
%global forgeurl https://github.com/facebook/infer

# Infer builds a modified version of clang
%global llvm_ver 12.0.1

# LTO leads to build failures, reason unknown
%global _lto_cflags %{nil}

Name:           infer
Version:        1.1.0
Summary:        Static analyzer for Java, C, C++, and Objective-C

%forgemeta

Release:        1%{?dist}
License:        MIT
URL:            https://fbinfer.com/
Source0:        %{forgesource}
Source1:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{llvm_ver}/llvm-project-%{llvm_ver}.src.tar.xz

BuildRequires:  ant
BuildRequires:  autoconf
BuildRequires:  cmake
BuildRequires:  emacs-nox
BuildRequires:  emacs-tuareg
BuildRequires:  erlang-erts
BuildRequires:  erlang-rebar3
BuildRequires:  gcc-c++
BuildRequires:  libatomic
BuildRequires:  libpfm-devel
BuildRequires:  libtool
BuildRequires:  make
BuildRequires:  maven-local
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-annotations)
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-core)
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-databind)
BuildRequires:  mvn(com.fasterxml.jackson.dataformat:jackson-dataformat-smile)
BuildRequires:  mvn(com.google.guava:guava)
BuildRequires:  mvn(junit:junit)
BuildRequires:  mvn(org.hamcrest:hamcrest)
BuildRequires:  mvn(org.jsr-305:ri)
BuildRequires:  ninja-build
BuildRequires:  ocaml >= 4.12.0
BuildRequires:  ocaml-ansiterminal-devel >= 0.7
BuildRequires:  ocaml-apron-devel >= 0.9.13
BuildRequires:  ocaml-async-devel >= 0.14.0
BuildRequires:  ocaml-atdgen-devel >= 2.0.0
BuildRequires:  ocaml-base-devel
BuildRequires:  ocaml-base64-devel >= 3.0.0
BuildRequires:  ocaml-biniou-devel
BuildRequires:  ocaml-cmdliner-devel >= 1.0.0
BuildRequires:  ocaml-containers-data-devel
BuildRequires:  ocaml-containers-devel >= 3.4
BuildRequires:  ocaml-core-devel >= 0.14.0
BuildRequires:  ocaml-ctypes-devel >= 0.9.2
BuildRequires:  ocaml-dune >= 2.7
BuildRequires:  ocaml-dune-build-info-devel
BuildRequires:  ocaml-easy-format-devel
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-fpath-devel
BuildRequires:  ocaml-iter-devel
BuildRequires:  ocaml-javalib-devel >= 3.2.1
BuildRequires:  ocaml-memtrace-devel >= 0.1.2
BuildRequires:  ocaml-menhir
BuildRequires:  ocaml-merlin
BuildRequires:  ocaml-mtime-devel
BuildRequires:  ocaml-ocamlbuild
BuildRequires:  ocaml-ocamldoc
BuildRequires:  ocaml-ocamlgraph-devel
BuildRequires:  ocaml-ocp-indent-devel
BuildRequires:  ocaml-ounit-devel >= 2.0.5
BuildRequires:  ocaml-parmap-devel >= 1.0
BuildRequires:  ocaml-ppx-blob-devel
BuildRequires:  ocaml-ppx-compare-devel >= 0.14.0
BuildRequires:  ocaml-ppx-deriving-devel >= 4.1
BuildRequires:  ocaml-ppx-enumerate-devel >= 0.14.0
BuildRequires:  ocaml-ppx-expect-devel >= 0.14.0
BuildRequires:  ocaml-ppx-fields-conv-devel >= 0.14.0
BuildRequires:  ocaml-ppx-yojson-conv-devel >= 0.14.0
BuildRequires:  ocaml-ppxlib-devel >= 0.21.0
BuildRequires:  ocaml-sawja-devel >= 1.5.11
BuildRequires:  ocaml-shexp-devel
BuildRequires:  ocaml-smtlib-utils-devel
BuildRequires:  ocaml-sqlite-devel
BuildRequires:  ocaml-xmlm-devel >= 1.2.0
BuildRequires:  ocaml-yojson-devel >= 1.7.0
BuildRequires:  ocaml-zarith-devel >= 1.7
BuildRequires:  ocaml-zip-devel >= 1.11
BuildRequires:  ocamlformat
BuildRequires:  opam-user-setup
BuildRequires:  patchelf
BuildRequires:  patdiff
BuildRequires:  perl-generators
BuildRequires:  perl(Digest::SHA)
BuildRequires:  perl(FindBin)
BuildRequires:  perl(lib)
BuildRequires:  pkgconfig(gmp)
BuildRequires:  pkgconfig(libedit)
BuildRequires:  pkgconfig(libelf)
BuildRequires:  pkgconfig(libffi)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(mpfr)
BuildRequires:  pkgconfig(ncurses)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist pygments}
BuildRequires:  %{py3_dist pyyaml}
BuildRequires:  utop-devel
BuildRequires:  which
BuildRequires:  xar-devel

# Infer builds modified versions of llvm and clang
Provides:       bundled(clang) = %{llvm_ver}
Provides:       bundled(llvm) = %{llvm_ver}

%description
Infer is a static analysis tool for Java, C++, Objective-C, and C.

%prep
%forgesetup

# Unpack the clang sources
mkdir -p facebook-clang-plugins/clang/src/download
cd facebook-clang-plugins/clang/src/download
cp -p %{SOURCE1} .
tar xf %{SOURCE1}
mv llvm-project-%{llvm_ver}.src llvm-project
patches="err_ret_local_block.patch mangle_suppress_errors.patch AArch64SVEACLETypes.patch benchmark_register.patch nsattributedstring.patch"
for patch in $patches; do
  patch --force -p1 < ../$patch
done
cd -

# Install into a temporary directory while building
mkdir -p facebook-clang-plugins/clang/install/lib/ocaml
sed -i "/LLVM_OCAML_INSTALL_PATH/s,\${OCAML_STDLIB_PATH},$PWD/facebook-clang-plugins/clang/install/lib/ocaml," \
    facebook-clang-plugins/clang/src/download/llvm-project/llvm/cmake/config-ix.cmake

# Tell the clang build which python executable to use
sed -i '/-DLLVM_TARGETS_TO_BUILD/a\  -DPython3_EXECUTABLE=%{python3}' \
    facebook-clang-plugins/clang/setup.sh

# Update the ounit name
sed -i 's/oUnit/ounit2/g' configure.ac infer/src/clang/dune.in \
  infer/src/clang/unit/dune infer/src/deadcode/dune.in infer/src/dune.in \
  infer/src/nullsafe/unit/dune infer/src/unit/dune.in

# Generate the configure script
./autogen.sh

%build
export STRIP=true
%configure

# The upstream Makefile objects to us setting MAKEFLAGS, so don't.
# It adds parallelism to the build itself.
# We do not have an flambda-enabled OCaml, so choose the dev build.
make BUILD_MODE=dev-noerror

%install
%make_install

%files
%doc CONTRIBUTORS README.md
%license LICENSE

%changelog
* Fri Mar  4 2022 Jerry James <loganjerry@xxxxxxxxx> - 1.1.0-1.20220304gite0ecc32
- Initial RPM
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux