How do we add swift compile flag to `gym` when using fastlane - fastlane

There are not much documentation about this here in the office documentation page https://docs.fastlane.tools/actions/gym/.
The only thing that mentioned compile flag is:
xcargs:
Pass additional arguments to xcodebuild for the build phase. Be sure to quote the setting names and values e.g. OTHER_LDFLAGS="-ObjC -lstdc++"
This is what we have currently:
gym(options.merge(:export_xcargs => "-allowProvisioningUpdates",
:export_method => "development"))
We would like now adding this flag to our build:
-Xfrontend -warn-long-expression-type-checking=100
We don't want to add it to Xcode project file like this https://github.com/fastred/Optimizing-Swift-Build-Times since we only want this check on the build machine which uses fastlane.
So this is what we tried:
gym(options.merge(:export_xcargs => "-allowProvisioningUpdates",
:export_method => "development",
:xcargs => "-Xfrontend -warn-long-expression-type-checking=100"))
But it keeps complaining about this error:
xcodebuild: error: invalid option '-Xfrontend'
How do we add this flag properly?

This works!
gym(options.merge(:export_xcargs => "-allowProvisioningUpdates",
:export_method => "development",
:xcargs => "OTHER_SWIFT_FLAGS='-Xfrontend -warn-long-expression-type-checking=100'"))

Since it's gym, use export_xcargs: instead of xcargs: and see related answer here if you need to assign a value for the flag - https://stackoverflow.com/a/57972046/4970749

Related

Passing parameters to puppet manifest via command line

I have been searching for an answer to this question with no luck, but is there a way to pass parameters into puppet manifests when running the 'apply' command, in a similar way to the way you pass parameters when running a UNIX script on the command line?
The suggestions I see mention either keeping variables at the top of the manifest for use later, or to store them in a hiera file. But neither really answer the question I am posing?
Any guidance on how to do this would be greatly appreciated?
Edit:
An example of what I have been doing is:
$doc_root = "/var/www/example"
exec { 'apt-get update':
command => '/usr/bin/apt-get update'
}
package { 'apache2':
ensure => "installed",
require => Exec['apt-get update']
}
file { $doc_root:
ensure => "directory",
owner => "www-data",
group => "www-data",
mode => 644
}
file { "$doc_root/index.html":
ensure => "present",
source => "puppet:///modules/main/index.html",
require => File[$doc_root]
}
As you can see the variable is hardcoded at the top, whereas whilst I am trying to use the variable in the same way, I need to be able to pass the value in when running the apply command.
Using lookup functions in conjunction with hiera.yaml files doesn't fulfil my requirements for the same reason.
The only thing I can think may be a work around is to create a UNIX script that accepts parameters, saves those values in a yaml file, and then have the script execute the .pp file.
But I'm hoping that puppet has a way to do this directly.
The common procedure for passing variables into a classless manifest for use with the puppet apply subcommand would be to assign the value to a Facter fact from the CLI, and then resolve its value inside the manifest. You would begin with removing the hardcoded variable doc_root from the head of the manifest. Then, you would modify the variable into a fact like:
file { $facts['doc_root']:
...
file { "${facts['doc_root']}/index.html":
...
require => File["${facts['doc_root']}"] <-- interpolation required due to Puppet DSL inability to resolve hash value as first class expression
You would then pass the Facter value from the puppet apply subcommand like:
FACTER_doc_root=/var/www/example puppet apply manifest.pp
Note this also causes FACTER_doc_root to be temporarily set as an environment variable as a side effect.

How do I set basic options with meson?

I'm trying to configure a project with meson. Specifically, I'm trying to set some of the options.
meson config tells me, among other things:
Core options:
Option Current Value Possible Values Description
------ ------------- --------------- -----------
buildtype debug [plain, debug, debugoptimized, release, minsize, custom] Build type to use
Base options:
Option Current Value Possible Values Description
------ ------------- --------------- -----------
b_lto false [true, false] Use link time optimization
(other options were clipped from this printout of course.)
So, I write:
meson build . --buildtype=release
in my build directory, and this goes fine - no warnings or errors (I double-checked that the option value had changed). Then I write:
meson build . --b_lto=true
but this gets me:
meson: error: unrecognized arguments: --b_lto=true
I also tried -b_lto=true, --b_lto true, b_lto=true and b_lto true. And all of those without the true value. No luck.
How do I set these "base options" then?
The --option=value, and --option value styles to pass arguments only applies to the universial options section in meson's manual...so not to base options, and others. Instead use the -Doption=value syntax to set options. It is the suggested way, since meson setup --help declares [-D option] to be used for setting all sorts of options. See this answer by the meson team. So, in your case run:
meson build . -Db_lto=true
but, better use this ordering, since its specified this way in the manual (man meson).
meson -Db_lto=true build .
or
meson configure build -Db_lto=true
If the build directory changed since the last configure use reconfigure instead.
meson reconfigure build -Db_lto=true
or explicitly:
meson setup --reconfigure -Db_lto=true build

How to add Babel support for nullishCoalescingOperator to vue project?

In my Vue-CLI project, when I tried using the ?? operator, I got this error:
Syntax Error: SyntaxError: /Users/stevebennett/odev/freelancing/v-map/src/components/Map.vue: >Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (30:29):
...
Add #babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.
I installed #babel/plugin-syntax-nullish-coalescing-operator (its name seems to have changed), added it to my babel.config.js:
module.exports = {
presets: ['#vue/app'],
plugins: ['#babel/plugin-syntax-nullish-coalescing-operator'],
};
Now the error message seems to have gone backwards, no reference to the operator name at all:
Module parse failed: Unexpected token (39:35)
You may need an appropriate loader to handle this file type.
| case 8:
| points = _context.sent;
console.log(sheetID ?? 37);
What am I doing wrong?
For me, the #babel/plugin-syntax-nullish-coalescing-operator plugin would not work, which is the one you are using.
I had to use the #babel/plugin-proposal-nullish-coalescing-operator plugin which is the one that the error message suggests you use.
Additionally, I noticed this on the page for the #babel/plugin-syntax-nullish-coalescing-operator plugin:
I can't say for sure if this will fix your problem, but it certainly fixed mine

What is wrong with my MyConfig.pm?

I'm trying to install perl modules local to my user - I don't have root access. I have setup in my directory structure the following place for perl libs: /dasd/home/miner/perl5lib/lib/lib (don't ask) - I want my perl modules there.
I am going to foolishly post my whole MyConfig.pm - I think just make_arg, make_install_arg, and make_pl_arg are important, but I spose therein lies my question: I'm not sure exactly how cpan works (and can't easily google it) so I don't know exactly the point of params in MyConfig.pm.
'build_dir' => q[/dasd/home/miner/.cpan/build],
'cache_metadata' => q[1],
'cpan_home' => q[/dasd/home/miner/.cpan],
'dontload_hash' => { },
'ftp' => q[/usr/kerberos/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'histfile' => q[/dasd/home/miner/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/dasd/home/miner/.cpan/sources],
'links' => q[/usr/bin/links],
'make' => q[/usr/bin/make],
'make_arg' => q[LIB= dasd/home/perl5lib/lib/lib PREFIX=~/perl5lib],
'make_install_arg' => q[LIB= dasd/home/perl5lib/lib/lib],
'makepl_arg' => q[PREFIX=~/perl5lib LIB=/dasd/home/perl5lib/lib/lib INSTALLMAN1DIR=~/perl5lib/man1 INSTALLMAN3DIR=~/perl5lib/man3],
'ncftp' => q[],
To further explain, I run 'cpan MongoDB', for example, and I get a lot of output, all screaming a bunch of errors, it all dies on this error:
Checking if your kit is complete...
Looks good
Writing Makefile for File::Slurp
Writing MYMETA.yml and MYMETA.json
make: *** No rule to make target `dasd/home/perl5lib/lib/lib'. Stop.
/usr/bin/make LIB= dasd/home/perl5lib/lib/lib PREFIX=~/perl5lib -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running make for K/KR/KRISTINA/MongoDB-0.45.tar.gz
Is already unwrapped into directory /dasd/home/miner/.cpan/build/MongoDB-0.45
CPAN.pm: Going to build K/KR/KRISTINA/MongoDB-0.45.tar.gz
make: *** No rule to make target `dasd/home/perl5lib/lib/lib'. Stop.
/usr/bin/make LIB= dasd/home/perl5lib/lib/lib PREFIX=~/perl5lib -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
What does "No rule to make target `dasd/home/perl5lib/lib/lib' mean? I don't want to make that dir...I want to make the makefile echoed by cpan when they say this "Writing Makefile for File::Slurp". Which i think I want to be in the /dasd/home/perl5lib/lib/lib directory. I'm assuming we are doing File::Slurp because MongoDB depends on it in some way.
I wish I had a better way to phrase the question - but in short here it is: teach me what this all means - how can MyConfig.pm be changed to do what I want?
"No rule to make target `dasd/home/perl5lib/lib/lib'" means that you put a space between LIB= and dasd/home/perl5lib/lib/lib (when it should have been a /), making them separate arguments. make thinks that dasd/home/perl5lib/lib/lib is the name of a file you want it to build, and it doesn't know how.
I'd start by editing MyConfig.pm in a text editor and just search for LIB= dasd and replace it with LIB=/dasd.
You say your libraries are stored in /dasd/home/miner/perl5lib/lib/lib yet your config file has dasd/home/perl5lib/lib/lib.
You seem to need a leading / and a /miner step in the path.

'make installdeps' fails with Net::FTP-related error

I am writing Catalyst application which uses Module::Install for module building. I keep all project-related modules in separate directory with local::lib:
eval $(perl -Mlocal::lib=$HOME/work/projects/freevideo)
Recently I've moved to amd64 environment, and 'make installdeps' stopped working:
nikita#freevideo-dev:~/fv$ make installdeps
/usr/bin/perl "-Iinc" Makefile.PL --config= \
--installdeps=Text::Table,0,Catalyst::Log::Log4perl,1.04,\
Catalyst::Plugin::Session,0,Catalyst::Plugin::Session::State::Cookie,0,\
Catalyst::Plugin::Session::Store::FastMmap,0,Catalyst::Plugin::Authentication,0,\
Catalyst::Plugin::Authorization::Roles,0,Catalyst::Plugin::Unicode,0,\
Catalyst::Plugin::SmartURI,0,Catalyst::Model::DBIC::Schema,0.5,\
Catalyst::View::JSON,0.33,Catalyst::View::TT,0.37,\
Template::Plugin::ListUtil,0.02,Template::Stash::ForceUTF8,0.03,\
Encode,2.43,DateTime,0.70,DateTime::Format::MySQL,0.04,\
Mail::RFC822::Address,0.3,Digest::MD5,2.51,Data::Dumper,2.131,DBIx::Class,0.08194
include /home/nikita/work/projects/freevideo/FreeVideo/inc/Module/Install.pm
include inc/Module/Install/Metadata.pm
include inc/Module/Install/Base.pm
include inc/Module/Install/Makefile.pm
Cannot determine perl version info from lib/FV.pm
Cannot determine license info from lib/FV.pm
include inc/Module/Install/Catalyst.pm
include inc/Module/Install/Include.pm
include inc/File/Copy/Recursive.pm
*** Module::Install::Catalyst
Please run "make catalyst_par" to create the PAR package!
*** Module::Install::Catalyst finished.
include inc/Module/Install/Scripts.pm
include inc/Module/Install/AutoInstall.pm
include inc/Module/AutoInstall.pm
*** Installing dependencies...
Can't use an undefined value as a symbol reference at \
/usr/share/perl/5.10/Net/FTP/dataconn.pm line 54.
Compilation failed in require at \
/usr/share/perl5/Module/Install/AutoInstall.pm line 37.
make: *** [installdeps] Error 111
Here's my Makefile.PL:
# IMPORTANT: if you delete this file your app will not work as
# expected. you have been warned
use inc::Module::Install;
use strict;
use warnings;
name 'FV';
all_from 'lib/FV.pm';
requires 'Moose'; # Moose is required for Catalyst
# Catalyst components
requires 'Catalyst::Runtime' => '5.7015';
requires 'Catalyst::Log::Log4perl' => '1.04';
requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::Static::Simple';
requires 'Catalyst::Plugin::Session';
requires 'Catalyst::Plugin::Session::State::Cookie';
requires 'Catalyst::Plugin::Session::Store::FastMmap';
requires 'Catalyst::Plugin::Authentication';
requires 'Catalyst::Plugin::Authorization::Roles';
requires 'Catalyst::Plugin::Unicode';
requires 'Catalyst::Plugin::SmartURI';
requires 'Catalyst::Action::RenderView';
requires 'Catalyst::Model::DBIC::Schema' => '0.5';
requires 'Catalyst::View::JSON' => '0.33';
requires 'Catalyst::View::TT' => '0.37';
# pragmas
requires 'parent';
requires 'utf8' => '1.07';
requires 'feature' => '1.13';
requires 'Config::General'; # This should reflect the config file format you've chosen
# See Catalyst::Plugin::ConfigLoader for supported formats
# Template Toolkit
requires 'Template' => '2.22';
requires 'Template::Plugin::ListUtil' => '0.02';
requires 'Template::Stash::ForceUTF8' => '0.03';
# other
requires 'POSIX' => '1.17';
requires 'Exporter' => '5.63';
requires 'Encode' => '2.43';
requires 'Data::GUID' => '0.046';
requires 'DateTime' => '0.70';
requires 'DateTime::Format::MySQL' => '0.04';
requires 'Mail::RFC822::Address' => '0.3';
requires 'Digest::MD5' => '2.51';
requires 'Data::Dumper' => '2.131';
requires 'File::Copy' => '2.14';
requires 'DBIx::Class' => '0.08194';
test_requires 'Test::More';
test_requires 'Test::Exception';
test_requires 'Text::Table';
catalyst;
install_script glob('script/*.pl');
auto_install;
WriteAll;
Everything runs on Ubuntu Natty amd64. Is there any workaround for this?
Solved! CPANPLUS had FTP mirrors written in its configuration, and I was too lazy to properly configure my ftp proxy. After replacing all ftp mirrors with http dependencies were successfully installed.
I had a similar error message : Can't use an undefined value as a symbol reference at /System/Library/Perl/5.12/Net/FTP/dataconn.pm line 54.
From reading Nikita answer, I made these changes to fix it:
sudo vim ~/.cpan/CPAN/MyConfig.pm
in the 'urllist' line: replace ftp by http