[oi-dev] problems publishing rust
Friedrich Kink
friedrich.kink at fkink.de
Fri Jun 24 16:23:18 UTC 2022
Oh forgot just for the sake of completeness and the brave who want test
on the own here my current Makefile:
BUILD_BITS= 64
USE_OPENSSL11= yes
include ../../../make-rules/shared-macros.mk
COMPONENT_NAME= rustc
COMPONENT_VERSION= 1.61.0
COMPONENT_FMRI= developer/lang/rustc
COMPONENT_SUMMARY= Rust - Safe, concurrent, practical language
COMPONENT_CLASSIFICATION= Development/Other Languages
COMPONENT_PROJECT_URL= http://www.rust-lang.org
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)-src
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH=
sha256:ad0b4351675aa9abdf4c7e066613bd274c4391c5506db152983426376101daed
COMPONENT_ARCHIVE_URL=
https://static.rust-lang.org/dist/$(COMPONENT_ARCHIVE)
COMPONENT_LICENSE= MIT or Apache-2.0
COMPONENT_LICENSE_FILE= LICENSE-APACHE
RUST_PRE_VERSION= 1.60.0
RUST_BOOTSTRAP_PATH= $(BUILD_DIR)/$(MACH64)
RUST_ARCH= x86_64-unknown-illumos
include $(WS_MAKE_RULES)/common.mk
# GCC_VERSION = 7
# Put the bits cargo downloads in a private directory. This could be cached
# somewhere more permanent, but it's important to make sure that a person's
# $HOME/.cargo isn't used.
RUST_VERSION= $(COMPONENT_VERSION)
RUSTUP_HOME= $(BUILD_DIR)/$(MACH64)
CARGO_HOME= $(BUILD_DIR)/$(MACH64)
PATH= $(CARGO_HOME)/bin:$(GCC_BINDIR):$(PATH.gnu)
# workaround the symlink name lenght 100 problem, but hope it is not
neccessary with
# but also with patch src_tools_rust-installer_src_generator.rs.patch
COMPONENT_BUILD_ENV+= CARGO_HOME=$(CARGO_HOME)
COMPONENT_INSTALL_ENV+= CARGO_HOME=$(CARGO_HOME)
COMPONENT_TEST_ENV+= CARGO_HOME=$(CARGO_HOME)
COMPONENT_BUILD_ENV+= RUSTUP_HOME=$(RUSTUP_HOME)
COMPONENT_INSTALL_ENV+= RUSTUP_HOME=$(RUSTUP_HOME)
COMPONENT_TEST_ENV+= RUSTUP_HOME=$(RUSTUP_HOME)
COMPONENT_PRE_CONFIGURE_ACTION += ( \
CLONEY_MODE=hardlink $(CLONEY) $(SOURCE_DIR) $(@D); \
cd $(@D); \
export RUSTUP_HOME=$(RUSTUP_HOME); \
export CARGO_HOME=$(CARGO_HOME); \
export RUSTUP_INIT_SKIP_PATH_CHECK=yes; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-s -- --no-modify-path --default-toolchain stable -y; \
source $(CARGO_HOME)/env; \
rustup install $(RUST_PRE_VERSION); \
rustup default $(RUST_PRE_VERSION)-$(RUST_ARCH); \
rustup show; \
);
PYTHON_VERSION= 3.9
# Need some help to pick the correct ar binary
GNUAR=$(GNUBIN)/ar
# getpwuid_r failure
CXXFLAGS += -D_POSIX_PTHREAD_SEMANTICS
CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
# Add arch triplet to pkg macros
PKG_MACROS+= RUST_ARCH="$(RUST_ARCH)"
# Rust expects the library path to be /usr/lib and is broken otherwise
RUSTC_LIBDIR= $(USRLIBDIR)
CLANG_ROOT= /usr/clang/13.0
CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
CONFIGURE_OPTIONS += --libdir=$(RUSTC_LIBDIR)
CONFIGURE_OPTIONS += --docdir=$(USRSHAREDOCDIR)/rust-$(COMPONENT_VERSION)
CONFIGURE_OPTIONS += --datadir=$(USRSHAREDIR)
CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)
CONFIGURE_OPTIONS += --local-rust-root=$(RUST_BOOTSTRAP_PATH)
CONFIGURE_OPTIONS += --enable-extended # Build and install cargo too.
CONFIGURE_OPTIONS += --default-linker=$(CC)
CONFIGURE_OPTIONS += --set target.$(RUST_ARCH).cc=$(CC)
CONFIGURE_OPTIONS += --set target.$(RUST_ARCH).cxx=$(CXX)
CONFIGURE_OPTIONS += --set target.$(RUST_ARCH).ar=$(GNUAR)
CONFIGURE_OPTIONS += --set target.$(RUST_ARCH).linker=$(CC)
CONFIGURE_OPTIONS += --enable-rpath
CONFIGURE_OPTIONS += --disable-codegen-tests
CONFIGURE_OPTIONS += --disable-dist-src
CONFIGURE_OPTIONS += --disable-llvm-static-stdcpp
CONFIGURE_OPTIONS += --enable-ninja
CONFIGURE_OPTIONS += --enable-vendor
CONFIGURE_OPTIONS += --disable-docs
CONFIGURE_OPTIONS += --disable-compiler-docs
CONFIGURE_OPTIONS += --disable-cargo-native-static
CONFIGURE_OPTIONS += --enable-option-checking
CONFIGURE_OPTIONS += --enable-optimize
CONFIGURE_OPTIONS += --release-channel=stable
CONFIGURE_OPTIONS += --python=$(PYTHON)
CONFIGURE_OPTIONS += --enable-llvm-link-shared
CONFIGURE_OPTIONS += --llvm-root=$(CLANG_ROOT)
COMPONENT_PRE_BUILD_ACTION= rustup default
$(RUST_PRE_VERSION)-$(RUST_ARCH);
# Cleanup standard environment!
COMPONENT_BUILD_ENV =
COMPONENT_BUILD_ENV += OPENSSL_DIR=$(OPENSSL_PREFIX)
COMPONENT_BUILD_ENV += OPENSSL_LIB_DIR=$(OPENSSL_PREFIX)/lib/amd64
COMPONENT_BUILD_ENV += OPENSSL_INCLUDE_DIR=$(OPENSSL_PREFIX)/include
COMPONENT_BUILD_ENV += OPENSSL_STATIC=0
COMPONENT_BUILD_ENV += CC=$(CC)
COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
#COMPONENT_BUILD_ENV += LDFLAGS="-L$(OPENSSL_PREFIX)/lib/$(MACH64) -lssl
-lcrypto"
COMPONENT_BUILD_ENV += CXX=$(CXX)
#COMPONENT_BUILD_ENV += CPPFLAGS="-I$(OPENSSL_PREFIX)/include"
COMPONENT_BUILD_ENV += CXXFLAGS="$(CXXFLAGS)"
COMPONENT_BUILD_ENV += AR=$(GNUAR)
COMPONENT_BUILD_ENV += RUSTC=$(CARGO_HOME)/bin/rustc
# Enforce linker consistency
COMPONENT_BUILD_ENV += RUSTFLAGS="-C linker=$(CC)"
COMPONENT_BUILD_ENV += RUST_BACKTRACE=1
GMAKE = $(PYTHON)
COMPONENT_BUILD_GMAKE_ARGS =
COMPONENT_BUILD_TARGETS = build
COMPONENT_BUILD_ARGS = ./x.py -vv
COMPONENT_INSTALL_ARGS = ./x.py
# Cleanup standard environment
COMPONENT_INSTALL_ENV =
COMPONENT_INSTALL_ENV += $(COMPONENT_BUILD_ENV)
# Set install path
COMPONENT_INSTALL_ENV += DESTDIR=$(PROTO_DIR)
COMPONENT_PRE_INSTALL_ACTION = mkdir -p $(PROTO_DIR)
RUSTC_BIN_POST = cargo
RUSTC_BIN_POST+= clippy-driver
RUSTC_BIN_POST+= rls
RUSTC_BIN_POST+= rustc
RUSTC_BIN_POST+= rustdoc
# Build dependencies (make sure completions are installed)
REQUIRED_PACKAGES += utility/bash-completion
REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
REQUIRED_PACKAGES += developer/clang-13
REQUIRED_PACKAGES += library/libssh2
REQUIRED_PACKAGES += library/http-parser
# Auto-generated dependencies
REQUIRED_PACKAGES += library/security/openssl-11
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += SUNWcs
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += web/curl
Am 18.06.2022 um 15:49 schrieb Friedrich Kink via oi-dev:
> Dear all,
>
> I try to prepare new rustc package with current version 1.61.0. So far
> building and installing is already working. But publishing
> respectively make REQUIRED_PACKAGES immediately bails out with the
> following error message:
>
> make REQUIRED_PACKAGES
> /usr/bin/python3.9 RESOLVE_DEPS=
> /usr/src/myoi-userland/components/developer/rust/build/.resolved-i386
> /usr/bin/python3.9: can't open file
> '/usr/share/src/myoi-userland/components/developer/rust/RESOLVE_DEPS=':
> [Errno 2] No such file or directory
> make: *** [/usr/share/src/myoi-userland/make-rules/ips.mk:516:
> REQUIRED_PACKAGES] Error 2
>
> truss shows that make REQUIRED_PACKAGE really tries to open the file
> /usr/share/src/myoi-userland/components/developer/rust/RESOLVE_DEPS=
> Any idea what goes wrong here? To simplify things I just used sample
> manifest p5m file to exclude home made errors.
>
> Any hints are welcome.
>
> kind regards,
>
> Fritz
>
>
> _______________________________________________
> oi-dev mailing list
> oi-dev at openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
>
More information about the oi-dev
mailing list